Levenberg-Marquardt Fit - Scaling the data, number of iterations, stop criterion

Hi there,
I am currently working on some extensive L-M-Fits envolving 8 and 11 coefficients unsing LabView 7.1. All fits are running without any error message (Took some time though ). It would be great, if you could answer my following questions:
1. In the help-file under "levenberg Marquardt" it says: "Scale the X-data so that delta X is at least 1E-2."
This sentence is quite ambiguous . Should it be larger or smaller 1E-2? In my opinion it should be smaller, let's say e.g. 1E-4, shouldn't it?
The results of the fit vary, if I change the delta X! That's why I somehow doubt the my fit results so far.
How should I scale it? I have 11000 measuring points and the corresponding Y-values are normalized and thus lie in between 0 and 1.
2. Connected to the fit described above:
Is there the possibility to display the number of iterations used for a certain fit?
3. What ist the stop criterion for the L-M-VI? Normally it should be given by an accuracy goal or something comparable?
Is there the possibility to change it somehow?
As written above I don't believe in the fit-results as long as I am not sure of using the VI properly.
Thanks in advance for your help

Hi Altenbach,
thanks for the fast answer...
@LabVIEW 8.0 Upgrade: That was, what I thought, when I checked the new features of 8.0... I'll talk to my Prof...
@express VI: No I am using the normal "Levenberg-Marquardt.vi" found under "Analyze/Mathmetics/Curve Fittings"
@delta X: see "help-file.jpg"-image attached. It shows the part of the help file containing the "delta X" part. X- and Y-values are used correctly in my question.
I have checked the code of the L-M-Fit-VI and in the Sub-VI "Levenberg Marquardt P.D.VI"  I've found the constant "1E-8" followed by a "logarithm base to" and "power of 2", which is finally used as a numerical stepwidth for the derivatives.
I understand the situation now as followed: my delta X should be >1E-2 (e.g.: 0.1 or 1) in order to be greater than the numerical step width (1E-8) with which the Algorithm is working in order to have the algorithm working properly. Then my function is changing in a larger scale than the one the LevMar-Fit is working with. This would prevent my partial derivatives of "going to hell"
There is another "1E-8" in a case structure of the subVI "Lev Mar Prep.vi" which is probably the accuracy limitation of the complete fit-algorithm.
I haven't wired a constant standard deviation array so far and I don't think that it would be nescessary, since my Y-values are in between 0 and 1 which should give the algorithm enough digits to work properly.
Nevertheless, I had several fits running with deltaX=1 first followed by deltaX=0.01 and the results varied, what should I do now? Which are the correct ones?
Unfortunately the last fit of my VI conatins coefficients which depend on each other, which makes the standard deviation values for the best fit parameters useless (they are MUCH larger than the original value of the best fit coefficient). Thus I cannot compare the "absolute errors" of the fit in order to compare whether they cover same values.
The version of the VI attached is an older one, the later ones are more complicated, since they include more other calculations, which have no influence on the problem discussed here.
Unfortunately running the programm with my settings takes quite a long time, which makes it difficult to quickly change some settings and than have it calculated again and again
Thanks again for the help.
Attachments:
help-file.jpg ‏610 KB
lev-mar-fit-problem.vi ‏882 KB

Similar Messages

  • SetMaxIterations API not setting the max number of iterations

    Hi
    Am using oracle 9.2.0.1.0 version.
    trying to use OCCI's bulk insertion feature using AP setMaxIteration, addIterations and executeUpdate combinations.
    from code (OCCI) if i do stmt->setMaxIterations(60)
    and then check for number of max iterations set by setMaxIterations using getMaxIterations it returns me 1(default value).
    Did setMaxParamSize as well.
    Also, moving ahead if I bind params of the statement and on reaching addIteration API, it throws an SQLException -: "ORA-32142: maximum number of iterations exceeded"
    Hope this was not a bug in this version of Oracle, if so request you to let me know in which version it got fixed and the patch location.
    Also, if anyone has this version, pl write down few lines of code and verify in the same oracle version, so that I can figure out whether this is a problem in my code or oracle supplied OCCI 9 libraries.
    Thanking you in anticipation.
    Regards
    Navin Sharma
    Code snippet:
    conn = env->createConnection("scott", "tiger","");
    stmt = conn->createStatement("INSERT INTO table_name VALUES(:1,:2)");
    stmt->setMaxIterations(62);
    cout<<"Number of iterations set by setMaxIterations - "<<stmt->getMaxIterations();
    stmt->setInt(1,100);
    stmt->setString(2,"Hello OCCI");
    stmt->addIteration();
    stmt->setInt(1,400);
    stmt->setInt(2,"Am using bulk updates");
    stmt->executeUpdate();

    Please update to the latest patch on 9.2 or 10g.
    Rgds.

  • Read Historical Trend VIs do not return all of the data between start and stop.

    My Main.vi manually writes data to Memory tags in DSC. If my Main is running, calls to Read Historical Trend.vi and Read Historical Trends.vi sometimes take a very long time (~60 seconds in some cases). In addition, most of the time the last data point from that time period is missing.
    For example, I have a discrete tag that is False before the start time, and goes True and then False again before the stop time. I know that this happens because I can see it in the Tag Monitor. However, when I call Read Historical Trend.vi, only 2 data are returned: a 0 with a timestamp from before the start time, and a 1 with a timestamp just after the start time. There is no 0 with a timestamp befor
    e the stop time, but there should be. If I wait for several and then try again, sometimes the data will be correct. But if I stop Main.vi and try again with the same exact timestamps, the data are returned immediately and nothing is missing.
    I also occasionally get Error -1967390704 occurred at CIT_ReadStringTrace.vi. I'm not sure what causes that, because it doesn't happen every time.
    I am using Labview 6.0.2, DSC 6.0.2 with the fixes, and the latest Logos (4.4).

    Jake,
    We have identified the issue and developed a potential workaround. Please create an email (not discussion forum) request so we can contact you on this.
    Regards,
    Michael Shasteen
    Applications Engineering
    National Instruments
    www.ni.com/ask
    1-866-ASK-MY-NI

  • Cannot set up an alias on iCloud? have followed the instructions. It will not allow my new alias name which fits inbetween the specified no of characters?

    I am having problems creating a new alias in my iCloud.
    I have followed the instructions to the letter.
    It does not accept my new alias name which fits in the prerequisite number of characters?

    Post in the iCloud forum area.

  • I've just migrated my Logic Pro 9.1.8 to a new Mac because my old computer crashed. They are asking for a serial number, but I don't have the install disks anymore. Is there someplace in the software itself that I can find the serial number?

    I've just migrated my Logic Pro 9.1.8 to a new Mac because my old computer crashed. They are asking for a serial number, but I don't have the install disks anymore. Is there someplace in the software itself that I can find the serial number?

    Please stop making multiple posts on the same subject.. This is the third thread you have created in a short space of time asking the same question.
    Please read the answers given in this thread you posted...
    https://discussions.apple.com/thread/5311324?tstart=0

  • Error: 'BP category 1 does not fit the data in category 2'

    Hi,
                i have written a program to create a contact person and the code for it is pasted below...when i run this program i get nothing but this message in the status bar 'BP category 1 does not fit the data in category 2'...can someone tell me wht the error means and y it is coming.
    thanks:)
    pushpa
    *table for storing the line by line records in the excel file
    TYPES: BEGIN OF TTAB,
            REC(1000) TYPE C,
           END OF TTAB.
    DATA ITAB TYPE TABLE OF TTAB WITH HEADER LINE.
    *variable for storing the name of the excel file to be uploaded
    DATA UP_FILE TYPE STRING.
    *data to be uploaded
    TYPES: BEGIN OF TDAT,
            FLD1 TYPE BAPIBUS1006_CENTRAL_ORGAN-NAME1,
            FLD2 TYPE BAPIBUS1006_ADDRESS-STREET,
            FLD3 TYPE BAPIBUS1006_ADDRESS-CITY,
            FLD4 TYPE BAPIBUS1006_ADDRESS-REGION,
            FLD5 TYPE BAPIBUS1006_ADDRESS-POSTL_COD1,
            FLD6 TYPE BAPIBUS1006_ADDRESS-COUNTRY,
            FLD7 TYPE BAPIBUS1006_CENTRAL-PARTNEREXTERNAL,
           END OF TDAT.
    DATA IDAT TYPE TABLE OF TDAT WITH HEADER LINE.
    DATA: BUSINESSPARTNER TYPE BAPIBUS1006_HEAD-BPARTNER,
          CENTRALDATA TYPE BAPIBUS1006_CENTRAL,
          ORGANIZATION TYPE BAPIBUS1006_CENTRAL_ORGAN,
          ADDRESS TYPE BAPIBUS1006_ADDRESS,
          BAPIRETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    PARAMETERS P_FILE TYPE LOCALFILE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          STATIC    = 'X'
        CHANGING
          FILE_NAME = P_FILE.
    START-OF-SELECTION.
      UP_FILE = P_FILE.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                = UP_FILE
        TABLES
          DATA_TAB                = ITAB
        EXCEPTIONS
          FILE_OPEN_ERROR         = 1
          FILE_READ_ERROR         = 2
          NO_BATCH                = 3
          GUI_REFUSE_FILETRANSFER = 4
          INVALID_TYPE            = 5
          NO_AUTHORITY            = 6
          UNKNOWN_ERROR           = 7
          BAD_DATA_FORMAT         = 8
          HEADER_NOT_ALLOWED      = 9
          SEPARATOR_NOT_ALLOWED   = 10
          HEADER_TOO_LONG         = 11
          UNKNOWN_DP_ERROR        = 12
          ACCESS_DENIED           = 13
          DP_OUT_OF_MEMORY        = 14
          DISK_FULL               = 15
          DP_TIMEOUT              = 16
          OTHERS                  = 17.
    *writing out the contents of the internal table itab
      LOOP AT ITAB.
        WRITE:/ ITAB-REC.
        CLEAR IDAT.
        SPLIT ITAB-REC AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
                    INTO IDAT-FLD1 IDAT-FLD2 IDAT-FLD3 IDAT-FLD4 IDAT-FLD5 IDAT-FLD6 IDAT-FLD7.
        APPEND IDAT.
      ENDLOOP.
      LOOP AT IDAT.
        MOVE: IDAT-FLD1 TO ORGANIZATION-NAME1,
              IDAT-FLD2 TO ADDRESS-STREET,
              IDAT-FLD3 TO ADDRESS-CITY,
              IDAT-FLD4 TO ADDRESS-REGION,
              IDAT-FLD5 TO ADDRESS-POSTL_COD1,
              IDAT-FLD6 TO ADDRESS-COUNTRY,
              IDAT-FLD7 TO CENTRALDATA-PARTNEREXTERNAL,
              '0001' TO CENTRALDATA-PARTNERTYPE.
        CALL FUNCTION 'BAPI_BUPA_CREATE_FROM_DATA'
          EXPORTING
            PARTNERCATEGORY         = '1'
            CENTRALDATA             = CENTRALDATA
            CENTRALDATAORGANIZATION = ORGANIZATION
            ADDRESSDATA             = ADDRESS
          IMPORTING
            BUSINESSPARTNER         = BUSINESSPARTNER
          TABLES
            RETURN                  = BAPIRETURN.
        IF BAPIRETURN IS NOT INITIAL.
          READ TABLE BAPIRETURN INDEX 1.
          MESSAGE
            ID BAPIRETURN-ID
            TYPE BAPIRETURN-TYPE
            NUMBER BAPIRETURN-NUMBER
            WITH BAPIRETURN-MESSAGE_V1
            BAPIRETURN-MESSAGE_V2
            BAPIRETURN-MESSAGE_V3
            BAPIRETURN-MESSAGE_V4.
          EXIT.
        ENDIF.
        REFRESH BAPIRETURN.
        CLEAR BAPIRETURN.
        CALL FUNCTION 'BAPI_BUPA_ROLE_ADD'
          EXPORTING
          BUSINESSPARTNER = BUSINESSPARTNER
          BUSINESSPARTNERROLE = 'BUP001'
          DIFFERENTIATIONTYPEVALUE =
          TABLES
          RETURN = BAPIRETURN.
        IF BAPIRETURN IS NOT INITIAL.
          READ TABLE BAPIRETURN INDEX 1.
          MESSAGE
            ID BAPIRETURN-ID
            TYPE BAPIRETURN-TYPE
            NUMBER BAPIRETURN-NUMBER
            WITH BAPIRETURN-MESSAGE_V1
            BAPIRETURN-MESSAGE_V2
            BAPIRETURN-MESSAGE_V3
            BAPIRETURN-MESSAGE_V4.
          EXIT.
        ENDIF.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE:/ 'Business Partner ID:', BUSINESSPARTNER.
      ENDLOOP.

    Hi Pushpa,
             you can use following code to create relationships using BAPI. In this Business partner is organisatin. contact persion paramenter is person. other information related to relationship details
    CALL FUNCTION 'BAPI_BUPR_CONTP_CREATE'
        EXPORTING
          BUSINESSPARTNER           = SEARCH_PARTNER
          CONTACTPERSON             = CONTACT_SAP
      VALIDFROMDATE             = '00010101'
      VALIDUNTILDATE            = '99991231'
      DEFAULTRELATIONSHIP       =
      ADDRESSGUID               =
          CENTRALDATA             = WA_CENTRAL_DATA
          ADDRESSDATA             = WA_ADDR_DATA
          TABLES
        BAPIADTEL                 = I_TEL_DATA
        BAPIADFAX                 = I_FAX_DATA
      BAPIADTTX                 =
      BAPIADTLX                 =
        BAPIADSMTP                = I_EMAIL_DATA
      BAPIADRML                 =
      BAPIADX400                =
      BAPIADRFC                 =
      BAPIADPRT                 =
      BAPIADSSF                 =
      BAPIADURI                 =
      BAPIADPAG                 =
      BAPIAD_REM                =
      BAPICOMREM                =
         RETURN                    = I_RETURN
    hope this will help you
    Siva

  • Where do I get the Levenberg Marquardt vi?

    I would like to use the Levenberg Marquardt routine in a vi that I am developing I have the base version of LABVIEW 7.1. Do I need to get the Full version to have this analysis tool or is there somewhere else I can get this routine?
    Thanks,
    Andrew

    Hi
    You can get the in the function menu in block diagram
    Function>Mathematics>Curve Fitting>Levenberg Marquardt.vi
    or you can check in the drive location
    X:\Program Files\National Instruments\LabVIEW 6\vi.lib\GMath\opti.llb
    Hope that satisfies you need
    Regards
    [email protected]
    [email protected]
    Attachments:
    Levenberg Marquardt.vi.llb ‏1 KB

  • Truncate the data to fit

    The AppleWorks Spreadsheet just started giving me the message "attempting to paste cells off the document bounds. Truncate the data to fit?". What settings should I look at to continue the page vertically?

    Go to Format > Document... & set the number of rows and/or columns you need then paste.

  • "BP Category 1 does not fit the data in category 2"  "Replies Appreciated"

    Hi Gurus,
    When i am trying to create an "Individual Account" in UI, I am getting the error "BP Category 1 does not fit the data in category 2".
    If i try to create a "group" then it says "BP Category 3 does not fit the data in category 2".
    It allows me to create only "Corporate Account" i..e. Category 2.
    What should i do to create "Individual Account" and "Group". (Category1 & Category 3).
    Individual Account (Category 1) - "BP Category 1 does not fit the data in category 2".
    Corporate Account (Category 2) - Able to create only Corporate Account
    Group (Category 3) - "BP Category 3 does not fit the data in category 2".
    Thanks & Regards
    Rohan

    Hi Rohan,
    Hope this SAP Note : 1232459, Solves your problem.
    You might have created a custom configuration for corporate accounts.
    Unfortunately in case of custom configurations exist, they are selected with higher priority.
    So in this case the configuration for corporate accounts is also shown for individual accounts,
    this causes error.
    In order to solve this problem, create a custom configuration for individual account also,
    i.e for view BP_HEAD/AccountDetails. Object type BP_ACCOUNT and object subtype INDIVIDUAL.
    Please make sure that the custom configuration includes the fields firstname and lastname for
    persons instead of name1 and name2 which are only allowed for corporate accounts.
    I hope the above information resolves your problem.
    Best Regards
    Shiven

  • CRM 2007 IC : error "BP category 2 does not fit the data in category 1"

    Hi Guys,
    When I am trying to save the data on the Bupacreate page it gives the error as follows.
    "BP category 2 does not fit the data in category 1".
    Can anyone suggest what is causing this error to happen and how this error can be corrected.
    thanks & regards
    Sandy

    Hi,
    This error usually occrus when you try to set field in without specifing bptype ie person, group etc. In our scenario we were trying to set field in Person which was not present in group. but since do_prepare_output method is same in both, that feild was getting set for group as well. When we placed restriction this error got removed.
    Best regards
    Pankaj Kumar

  • Report for displaying the order number & order date..

    HI ALL,
    can any body help me for displaying the order number,customer name,material name & order date..in report
    i dnt know the which are the table i need to use...
    can anybody tell me which are table do i need to use and fields in tables
    input to report from the user are cutomer number,purchase order numbervendor number & sales number
    waiting for positive reply form u people.....
    thanks
    Zabeerulla
    Moderator message: "spec dumping", please work yourself first on your requirement, do some research, talk to a functional consultant near you.
    Edited by: Thomas Zloch on Feb 28, 2011 2:14 PM

    Thx  dharma raj  ...
    problem is ,input to report from the user are cutomer number,purchase order number,vendor number & sales number
    report should contain
    customer name
    order date
    order #
    vendor name
    material name
    can u please tell me which are the table do i need to use...
    i have ,please look into it...let me know if am incorrect
    customer name -> kna1_name where kna1_kunnr=knagv_kunnr
    order date -> vbak_audat
    order nunber->vbak_vbeln
    vendor name -> LFA1_NAME where LFA1_LIFNR=MEPO_TOPLINE(superfileld)
    material # -> VBAP_ARKTX where VBAP_VBELN=VBAK_VBELN
    HELP ME OUT...
    THX
    ZABEER

  • How can I display date+time and not the point number in excell?

    Hi everyone,
    Could anybody tell me how I can save date + time to a file, so that  I can display on a diagram(excel) : date+time in (ox) and data (oy)? :
    My program sets in (ox) the point number and not the date+time....( although  date and time are written correctly in the column...)
    Any help would be great,
    Thanks,
    regards,
    Marc

    hi there,
    excel uses 01.01.1900 00:00 as the time offset, LabVIEW uses 01.01.1904 02:00, so you can't display the correct datetime in excel when you write the time as a fractional number of seconds from LabVIEW. you must format the datetime in LabVIEW to a string and write that to the column. use the "Format Date/Time String" - function and for example "%d.%m.%Y %H:%M:%S%3u" as the format string (see the functions help for more examples). you also could format your data to a string using "Format Into String" - function and write the file as a 2D string array. the decimal point you have to use depends on your system and its settings, but you can specify the decimal point in the Format string like "%.;%f" (means fractional number with point as decimal point).
    best regards
    chris 
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • I have a large number of photos imported into iPhoto with the dates wrong.  How can I adjust multiple photos (with varying dates) to the same, correct, date?

    I have a large number of photos imported into iPhoto with the dates wrong.  How can I adjust multiple photos (with varying dates) to the same, correct, date?

    If I understand you correctly, when you enter a date in the Adjust Date and Time window, the picture does not update with the date you enter.  If that is the case then something is wrong with iPhoto or your perhaps your library.
    How large a date change are you putting in?  iPhoto currently has an issue with date changes beyond about 60 years at a time.  If the difference between the current date on the image and the date you are entering is beyond that range that may explain why this is not working.
    If that is not the case:
    Remove the following to the trash and restart the computer and try again:
    Home > Library > Caches > com.apple.iphoto
    Home > Library > Preferences > com.apple.iPhoto (There may be more than one. Remove them all.)
    ---NOTE: to get to the "home > library" hold down option on the keyboard and click on "Go" > "Library" while in the Finder.
    Let me know the results.

  • How can I have a program prompt a user to input a selected number of simultaneous (different devices run off com/rs232 ports) and be able to compile all the data and/or graph it simultaneously?

    I have a project that I'm working on that I could use some help on.
    Some background on it is I'm taking data from a balance via RS-232 (can be a selectable list of balances), and then communicating with them on their own separate COM port. I need these to then run in parallel to then take masses in regular increments and then output them to a graph and/or TDMS file. 
    What I'm trying to have is that a subVI prompts the user to how many simultaneous runs will be going.
    Then I will want multiple pop prompts (one for each simultaneous run) which will have initial data input (data cluster) and then associate these with the COM port and the specified balance. 
    I initially thought of utilizing a For Loop this way but I can't get these windows to pop up multiple times while storing their own values in say a cluster array. Can anyone give me any ideas to get me a little further?

    Cameron,
    I've created a prompt for the user to select the number or runs to be run simultaneously. 
    This then should trigger the amount of prompts the user needs to input - ie VISA resource, and headers to label the "samples".
    I want this to be done in multiples (somewhere around 1-10 simultaneous runs - bounded by the program) so that data points from multiple sources can be taken and graphed/saved to file. I just am having issues with the loop situation to be able to keep prompting the user X times and also output the data to the front panel. Originally i thought I could somehow manipulate a tab control container but I'm getting roadblocked. 
    Does that help you understand what I'm trying to do?
    I've attached an image of what I want the user to input for each sampling.
    Attachments:
    Capture11.JPG ‏24 KB

  • How to get the week number of year from a Date object?

    Hi!
    I would like to know the week number of the year from a specified Date.
    I dont know how to set the first day of week, and set the minimum days of a week.
    I want to use Monday for first day of week, and at least 4 days of month in a week.
    For example if its 1st, January is Friday, then the first week starts on 4th, Monday.
    Anyone can help?

    Sorry. I should think before I move.
         public static int getWeekOfYear(Date date) {
             Calendar calendar = Calendar.getInstance();
             calendar.setTime(date);
             calendar.setFirstDayOfWeek(Calendar.MONDAY);
             calendar.setMinimalDaysInFirstWeek(4);
             return calendar.get(Calendar.WEEK_OF_YEAR);
         }

Maybe you are looking for

  • Final Cut Pro 6 App says it's 495GB in size! Say what?

    I'm trying to clear out hard drive space to keep FCP 7 and FCPX running smooth. I was horrified to discover that under my directory Macintosh>Applications>Final Cut Pro 6 =495.27GB in size! In comparison to FCPX 10.1 which is 3.34GB in size.  How can

  • Open the Web Console when a pop-up opens

    Suppose I am working with a webpage and I have the console open. Then, I click in an element, and the javascript code that handles the event decides to open a new window. That window does not have the console open, so I miss some details of the http

  • Packagin and Deploying Fusion Web Application

    Hi, I have created a Fusion web application which has Model and ViewController projects. I have created a deployment profiles as below for each project. 1) Model - Which creates an "ADF Library Jar File" 2) ViewController - Which creates a "War" file

  • How much ram will my iMac hold?

    How do I find out what the max RAM my Mac will hold and what type of RAM it takes?

  • SA won't start Mailman

    I'm trying to start Mailman with SA so I can go to the WWWeb interface and configure it properly, but I seem to be stuck at enabling mailing lists. I click on "Enable Mailing Lists", I get a popup asking me for the master MailMan password and an admi