I am trying to use the non-linear curve fit function Lev-mar IV to try to find a best fit line for some data which is modeled by an equation which contains some complex numbers and hyperbolic trig functions. The best fit cure always returns to me as a nearly horizontal line. I think i would be able to solve this problem If I could place upper and lower bounds on two of the three variables the equation is optimizing, and if I could reduce the "step size" the function goes at when optimizing.
I believe that the step size of the function is too large as when I run the program with the optimization function iterating once with very high tolerance, the input values are not returned to me; instead I receive values that have been off by as much as 250. Additionally, these values are negative, and the real life phenomenon that the model represents cannot be negative.
Thanks for your time
Solved! Go to Solution.
As a starting point, you can try the Constrained Nonlinear Curve Fit VI , which lets you define parameter bounds. Still maybe you should carefully analyze the problem, for example are some parameters highly correlated? How do the partial derivatives look like? Sometimes you can reparametrize the model differently for a more stable fit.
Feel free to attach your Code and some typical data.
I've attached some code for you to look at. the file reflection with two windows is the program and the other file is for reference for the optimization function. I cannot attach any data sets because most of my data is spreadsheets with thousands of rows, the file is too large.
Thanks. I will probably not weed through all that messy code.
All I need is:
If you simulate the data using the parameter guesses, how similar is it to the experimental data?