Varying Lev-Mar init. conditions causes wide change in fit coeficients.

Hey, I'm trying to use the advanced Lev-Mar fit vi to fit an exponential decay with an offset. I noticed that when I vary the initial condition for the time constant by 5% I get significant changes in my fit coeficient for the same parameter. However, when I multiply my input Y values by 10^4, the fit coeficients are more robust and change little with initial conditions that vary more than 10%. Also, the values now seem to match well with values I obtain when I perform the same fit in the Origin plotting program. Why is this? All my values are in double precision so I don't see how this could be a precision issue.

The Lev-Mar has a well-known "bug" in the termination condition IF you fail to wire the "standard Deviation Input". In this case, the standard deviation is taken as 1, which is fine except for the case where your y-data is very small (e.g. all in microvolts or nanovolts). In this case, the function is considered converged after one iteration using the initial guesses.
You have two options:
(1) (not recommended) Edit the Lev-MAR.vi and make the diagram constant in the bottom center much smaller.
(2) (RECOMMENDED!) Always wire a "standard deviation input array". In your case, just create an array with equal size as your data, initialized with numbers corresponding to the noise in your data. It does not need to be accurate, you could just take it as e.g. 10E-4 to 10e-6 times your y-range (y-max minus y-min).
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Please help on this Lev-Mar problem

    Hi,
    I have two acquisition data sources that need
    to be fitted. Then the fitted parameters are
    passed along with data for further processing.
    As the data is heardware generated, I made a
    similar 'signal generator' to present very closely
    the problem.
    ===Please see the attached vi file===
    As you can see, these two Lev-Mar's function
    / derivatives are obviously different. We can edit
    the fuction / derivative node. But the problem
    is that when one is edited, the other changes too.
    Anyways, we can NOT have two different functions.
    My question is: How to have two different function
    / Deveritives here?
    By the way, how to replace the MatLab box into
    function node in my attached example?
    I can 'wire' the out
    put to next if it's a
    function node. It says the type of variables are
    different (output is a real instead of array).
    Attachments:
    Lev-Mar-Question2.vi ‏99 KB

    You have a few options for multiple function/derivatives.
    1. If you can express the model functions using the formula string syntax, then you might consider using the "Levenberg Marquardt.vi". Unfortunately the Levenberg-Marquardt.vi does not allow the specification of the derivative of the model function and always uses numerical derivatives. It is also somewhat slower than the "Nonlinear Lev-Mar Fit.vi".
    2. You could also save a copy of the "Nonlinear Lev-Mar Fit.vi" using a different name, and also the "Lev-Mar ABX.vi" and "Target Fnc & Deriv Nonlin.vi" with different names. Then you would have a different set of VIs to implement the curve fitting on two different models. This is ugly, but would work.
    3. You could modify the "Nonlinear Lev-Mar
    Fit.vi", "Lev-Mar ABX.vi", and "Target Fnc & Deriv Nonlin.vi" to accept/pass VI references. The "Target Fnc & Deriv Nonlin.vi" would then perform a call by reference to a VI that you wrote implementing the current model function.
    To replace the Matlab script node place the formula node inside a for-loop. The for-loop will auto-index the x and t arrays, and auto-build the y-array.

  • How to constrain parameters in Lev-Mar?

    It's a common case for non-linear fitting.
    How can it be done in LabView's Lev-Mar?
    Thanks.

    The provided LabVIEW implementation does not contain options for parameter bounds.
    One solution would be to re-parametrize your code in terms of unconstrained variables that cause a constraint on your original parameters.
    Some transformations for one-sided or two-sided parameter bounds are given here:
    http://www.id.unizh.ch/software/unix/statmath/sas/sasdoc/stat/chap19/sect41.htm
    The link also lists references with more details.
    LabVIEW Champion . Do more with less code and in less time .

  • Ajustement de courbe (Fitt) Lev-Mar

    Bonjour/Bonsoir
    Je veux faire un ajustement de courbe en utilisant le modèle de Mar-Lev pour des mesures de la Réflectivité en fonction de la longeur d'onde mais j'ai pas réussi à le faire;
    Les valeurs de "n" et "k"  varient en fonction de la longueur d'onde mais la je les ai pris fixes, es ce qu'il y a une possibilité de prendre les paramètres comme étant des tableaux ??.
    Les valeurs de "ns" et "ks"  je peux les considérer fixes mais comment faire pour changer leurs valeursr dans la formule ( Utilisation d'une variable globale ???)
    je voudrais savoir aussi es ce que c'est mieux d'utiliser Lev-Mar : VI ou chaine de formule.
    Je sais pas s'il manque d'autres informations .
    merci pour votre aide.
    Cordialement.
    Pièces jointes :
    1NI.png ‏37 KB
    2NI.png ‏62 KB

    Bonjour,
    "Les valeurs de "n" et "k"  varient en fonction de la longueur d'onde mais la je les ai pris fixes, es ce qu'il y a une possibilité de prendre les paramètres comme étant des tableaux ??."
    --> oui, tout est possible. seulement je ne vois pas où sont ces paramètres dans le code, donc c'est dur.
    Les valeurs de "ns" et "ks"  je peux les considérer fixes mais comment faire pour changer leurs valeursr dans la formule ( Utilisation d'une variable globale ???)
    --> si je comprends, ils sont fixes mais tu veux pouvoir contrôler leur valeur depuis "l'extérieur". Dans ce cas, variable globale ou variable globale fonctionnelle (=VGF). Tu trouveras des exemples facilement pour les VGF
    "je voudrais savoir aussi es ce que c'est mieux d'utiliser Lev-Mar : VI ou chaine de formule."
    --> à toi de voir selon tes exigences et tes critères. La formule est peut-être plus performantes en terme de temps d'exécution, mais le code tient plus de place dans le diagramme, il est peut-être moins lisible. Moi je prendrais la formule, car ça s'exécute plus vite et on sait exactement quel calcul est fait.
    Francis M | Voir mon profil
    Certified LabVIEW Developer

  • SAP report showing sales orders on which pricing conditions have been chang

    Is there a SAP report that shows a list of sales orders on which pricing conditions have been changed.
    My knowledge is:
    Review pricing condition transaction data table (‘KONV’) helps is some way.

    Hi Ashish,
    I don't know any such a report, but I guess you can play arround with table CDPOS.
    Change doc. object = VERKBELEG
    Table Name = KONVC.
    Actually this will take lot of time.
    Thanks,
    Mandar

  • Oracle Hint not causing any change to explain plan

    Hi,
    I was facing a problem about ORA-00600 for using Connect by Prior query,
    details of which are at -
    Connect by Prior - ORA-00600: internal error code, arguments: [kkqcbydrv:1
    As is documented by Oracle, workaround for this is to use /*+ NO_UNNEST */ in query.
    I displayed the explain plan for original query and after putting hint in query.
    There is no difference in the explain plans, I am a starter for explain plans and don't know much of it.
    But shouldn't the hint cause some change in explain plan?
    Even the hash values as mentioned in explain plans are same.
    Thanks in advance.
    Av.

    Perhaps it would help if you put the query (with the hint) and the explain plan here.

  • The bookmark tab went from the right side to the left side. I did not change that. what cause the change from the right side to the left side?

    The bookmark tab went from the right side to the left side. I did not change that. what cause the change from the right side to the left side? Also the the Mozilla Firefox tab on the upper left hand corner changed.
    Its was a red colored tab and now its blue in color. I did not change any thing!

    Hey jimmiet,
    There were some recent ui changes around the downloads manager. What version where you on before? Anyway, you can customize things in Firefox really easily. Take a look at [[Customize Firefox controls, buttons and toolbars|this article on customizing Firefox]] for details. Should be a piece of cake to move the bookmarks button.
    As for the color of the button, you might be in [[Private Browsing - Browse the web without saving information about the sites you visit|Private Browsing]] mode. That changes the color of the button from orange to a purplish color.
    Matt

  • Curve Fit of ODE, should I use Lev-Mar or Constrained Nonlinear Optimization?

    I wanna do a curve fitting of differential equations, following is the equations:
    dx/dt = u*x-a*x
    ds/dt = b*u*x+c*x
    dp/dt = d*u*x+e*x+f*p
    and u = um*s/(km+s+s^2/ki)
    I've tried "nonlinear curve fit( Lev-Mar)", but I met difficulties when writing the f(x,a) of Lev-Mar.
    Then I tried "Constrained Nonlinear Optimization", I found that the example "Estimate Nonlinear Spring Constant.vi"
    in the "labview\examples\math\curvefit.llb" was similar to the fitting I tried to do, but there was only one parameter
    need to estimate in this example,but what I need is to estimate 3 parameters.
    However,I modified the example to my equations, it failed again.
    How can I achieve this? is it possible to do this fit only using Labview VIs or need Matlab Script Node?
    Any help will be appreciated.

    I forgot to mention that in the equations above,  a,b,c,d,e,f is constant,
    and the data of x,s,p corresponding with the data of time is already known,
    and which parameters I wanna identify is um,km,and ki
    帖子被myafu在12-22-2006 01:33 AM时编辑过了

  • DreamWeaver CS3 - How to excute a site wide change...

    I am using Dreamweaver (DW) CS3. I have updated a few pages
    which had the ending of .HTM. After the modification to the pages
    the ending of the file names were changed to .ASP. The pages work
    well in their test environment.
    OK, so the pages were known by the site with the file name
    extension of .HTM
    The file name extension is now .ASP
    How do I update very page in the site so that they no longer
    look for the old file name but the
    new name, which ends with the extension of .ASP?
    Thanks!
    Happy New Year!

    I would also suggest that you never rename your files like
    this outside of
    DW. By renaming them in DW's File panel, you allow DW to
    manage the links
    automatically.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "martcol" <[email protected]> wrote in
    message
    news:gjg0k4$nrk$[email protected]..
    > DW comes with a very sophisticated Find & Replace
    tool that would do what
    > you
    > want
    >
    >
    http://tinyurl.com/97cknp
    >
    > It also has a tool for checking broken links
    >
    >
    http://tinyurl.com/7aegnq
    >
    > I would suggest that before you make site-wide changes
    you back it up
    > somewhere.
    >

  • A confusing lev-mar error

    I am trying to fit a Lorentzian to some acquired data using the lev-mar function, and it returns the error "wrong model equation". I know for a fact that the data has a lorentzian shape because I wrote a little vi to fit it manually using the exact same equation. Does anyone have a suggestion as to what to do next, or at least what the "wrong model equation" error really means? Thank you.
    JPC

    The error refers to a syntax issue with the "model description" input.
    This input is a cluster of three strings: model, which is the actual equation (Ex: a+b*x+c*x^2); paramters, which are the solvable variables (a, b, & c in the previous ex.) inputted as an array of strings; and the independent variable (x).
    All 3 parts of the model must match exactly (e.g. you can't have 3 variables in the model and 1 in the parameters, and if you designate x as the independent variable, there must be an x in the model equation).
    Additionally, the model equation follows standard LabVIEW formula node syntax, except there are no input variables designated ("y=x+1" won't work but "x+1" will) and you don't need a semi-colon terminator.
    Let me know how it goes,
    ~j5
    2006 Ultimate LabVIEW G-eek.

  • Editing the Text May Cause Layout Changes Message

    I have tons of files created in old illustrator 6.0 and now that I have CS2 loaded on Mac OS X.5.8 I'd like to open and edit some of these documents.
    It says, "This file contains text that was created in a previous version of Illustrator. This legacy text must be updated before you can edit it." It asks you to either Choose Update or OK to update later.
    So I chose Update for one of the files, save without compression. Then I open it and it looks OK. I thought that this UPDATING would allow me to work with the document freely. However, when I attempt to change some type I get a warning saying that "Editing the text may cause layout changes.• Choose Copy Text Object to update the text and preserve the original layout as a separate object. • Choose Update to update the text without creating a separate reference object." Why am I getting this warning? Do I really have to click on every bit of type I wish to edit and deal with this message each time? If I choose "update" the type disappears entirely and if I choose "copy text object" it grays out and I can't select it. Either way I have no way of editing my document.
    Please advise and keep answers as simple as possible.
    Thanks.
    http://s277.photobucket.com/albums/kk61/exitrealestate001/?action=view&current=bydefault2. jpg
    http://i277.photobucket.com/albums/kk61/exitrealestate001/bydefault2.jpg
    <a href="http://s277.photobucket.com/albums/kk61/exitrealestate001/?action=view&current=bydefault2. jpg" target="_blank"><img src="http://i277.photobucket.com/albums/kk61/exitrealestate001/bydefault2.jpg" border="0" alt="Photobucket"></a>
    [IMG]http://i277.photobucket.com/albums/kk61/exitrealestate001/bydefault2.jpg[/IMG]

    Hi Mylenium,
    Wow. What a nightmare. We're not talking just retyping, it's really re-typesetting etc.
    Tell me, if I were to copy and paste the old document into a new one or something like that, would that bypass this problem?
    Also, someone in another thread which I started (link to it below) mentioned that I could "batch update the files as CMYK and with the legacy type updated as well." I know that it's separate issue, but I was wondering if I were to do this, might it help with this Text Editing issue?
    http://forums.adobe.com/message/2740960#2740960
    Please advise.
    Thanks in advance, very much.

  • Curvefit of the reflectivi​ty with Lev-Mar

    Hello,
    I am a beginner with Labview and I need your help, I recuper the data of the reflectivity from the spectrometer (3648 points) and I am going to make the fitting to extract information about the thickness and refractive indices n and k (k in the general case it will be zero because the materials used are oxides and I work in the visible range.
    I want to use the model of Lev-Mar but I have the problem with the model, i have used the formula node to write the eqaution of the reflectivity, and currently I am block.
    Data.txt
    column1 = Lambda
    column 2 : Reflectivity
    the substrate is Pyrex  ; n= 1,47
    the thin film is Ti-Nb, the index is like that of the titane(Antase) : ñ = 2,561 + i2,488
    Thank you very much.
    Nb: i know my english is so bad
    Attachments:
    fit1.png ‏36 KB
    fit2.png ‏30 KB
    Data.txt ‏51 KB

    Thank you very much Lynn,
    I did what you told me to do and it works a better,
    I would like to know if you can help me, I have the values of the reflectivity R as a function of the wavelength (lambda) but the indices " n "  and " k " are also a function of lambda.
    R = (n,k,d,lambda )   and  the dispersion equation n(lambda) and k(lambda)
    With the curvefit Lev-Mar is possible to define these parameter ? if you have ideas that will be cool

  • Header condition value is changing in Invoice compare to Sales Order

    Hi,
    I have created one Sales Order with five line items and total quantity is 100 units. I have one header condition type and the value is 1000 USD in Sales Order.
    Now I have created delivery and changed the quantity from 100 units to 105 units..
    And than I  have created Invoice. If i check the Header condition type value now it it 1100 USD instead of 1000USD(header condition type value should be the same as in Sales Order)
    Can anyone suggest me why the header condition value is changing in Invoice where as it should be as same as in Order?
    Thank you for your support
    Best Regards
    Amjathpasha

    Hi Amjad,
    You might check in copy controls for the Pricing type if the prices are getting re-determined at the time of billing.
    Although, if it is, the value should have been 1050 USD and not 1100 USD.
    As you know item condiitons for all the items are added up to the header, you might want to analyze item conditions as well.
    Also, since you are delivering 105 units instead of 100, do you still want the system to charge for 100 units? Or is it something related to under-delivery/over-delivery tolerance?
    Regards,
    Amit

  • On the 652X, is there a way to know which port/line caused the change detection w/o checking each individual line?

    On the 652X, is there a way to know which port/line caused the change detection w/o checking each individual line? This question relates to creating an interrupt handler when there are many events that cause an interrupt.

    No. Read the User Manual, CH4, Change Notification.

  • Problem: Fitting Lev-Mar with Error Function

    Hi everyone,
    I have very little experience with LabVIEW and I'm trying for the first time to do some NonLinear Curve fit for some data I have.
    I've searched in forums for almost a day and couldn't find what I need. The problems are:
    1) I need to fit a function of the following type: P = Po/2 - Po/2*erf(sqrt(2)*(x-xo)/w) , where Po, xo and w are my parameters.
    But in my error2.vi I cannot link my y=sqrt(2)*(x-xo)/w  variable of the erf function to the input, because the erf.vi does not accept 1D array as input and doesn't give that as output as well. The output thing is another problem, since the input of F(x,a) needs to be a 1D array.
    2) I read about the Lev-Mar NonLinear CurveFit VI and I think I got what needs to be done. However, a I was having problems in wiring my Static VI Reference to the F(x,a) input in the Lev-Mar VI and it didn't give me a broken wire only when I made de Reference a "Strictly Typed VI Reference". What does that mean? Why did it only work with that?
    I know these are some pretty basic doubts, but I've been trying to understand it for quite some time and couldn't get this done.
    Thanks.
    PS* The fitting function (subvi) is the error2.vi file.
    Solved!
    Go to Solution.
    Attachments:
    error2.vi ‏13 KB
    FittingGaussianKnife.vi ‏15 KB

    Try this. Seem to work  just fine (LabVIEW 2013).
    (don't try to graph the best parameters, graph the best fit output!)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FittingGaussianKnife_MODCA.vi ‏17 KB
    error2_MODCA.vi ‏14 KB
    erfit.png ‏40 KB

Maybe you are looking for

  • Photoshop CC 2014: lost advance tab in menu Archive file info

    Hi to all. Recently I install Photoshop CC 2014, and I can't find the advance tab in the window "File Info" inside the Archive Menu, when I choose it. did we lost this tab in CC2014? Can I find this "advance" tab in other menu into Photoshop CC 2014?

  • Technical Content Cube for Multi Provider Information???

    Hi all, Can anyone suggest which Technical Content Cube will give  Information about Multi Provider and its underlying Info Providers(Last load tiem of Info Provider)?. Thanks Deepika

  • Business Intelligence Applications 7.9.6.1

    Hello, We are installing the Oracle Business Intelligence Applications 7.9.6.1 to integrate with Oracle EBS Release 12 (12.1.1) Instance. BI Apps Environment: 1. IBM AIX v5.3 -> Oracle 11g (11.1.0.7.0), BI Apps 7.9.6.1, Informatica PowerCenter Servic

  • How do you chance the color and style of my iPad upgrade yesterday?  The new change is awful.

    The changes made to the layout of my iPad are just plain yucky.  I will not be upgrading my other iPad if this is what the future is.  The calendar and all the other applications are just plain bad.  Too much white and ugly colors.  What can be done

  • Transports group

    Hello all I am trying to configure tranport group in PI 7 but it only let me configure landscapes I want to assign dev business sytem to qa business system how can I do that? thx Shai