Curve fitting tool problem- upper and lower bounds

14 views (last 30 days)
I have graphed this surface[ z= -b*log(m*x) + c*y] in the normal matlab setting and I am not trying to see if it fits my data.
But is keeps saying "Ignoring NaNs in data. Inf computed by model function, fitting cannot continue. Try using or tightening upper and lower bounds on coefficients. "
Here is a screen shot of my bounds.
I am sorry but every time I enter my own equation in here it says this, can you explain how to avoid this, what is happening? it does it for even very simple equations.
  1 Comment
Esha Bhargava
Esha Bhargava on 20 Nov 2015
There are a number of issues that influence curve fitting.
1. The most notable is selection of model, either from the curve-fitting library or the user's custom equations. You can try different models to fit the data.
2. Some preprocessing of data prior to fitting curve is helpful. This may include:
*Transforming the response data. *Removing Infs, NaNs, and outliers.
3. The fitting process is more likely to converge if you supply as much information as possible about the coefficients being estimated:
- Make intelligent guesses as starting values. If you have an idea about the likely coefficient values, then use those as starting values. - In absence of knowledge of starting values, try a variety of different starting values. - Try restraining the parameters. For example if you know a parameter has to be positive, placing its lower bound at 0 may lead the iterative process toward a solution that it might not find otherwise.
4. There are various fitting options that you can adjust:
- Try different algorithms. - Increase the number of iterations or function evaluations allowed. - Reduce the convergence tolerance.
5. Try also sub-setting the data and fitting different subsets of data separately.
6. Another strategy is to fit a term at a time. So say you think your model is
y = c+ a*exp(b*x) + d*sin(f*x);
Then they might want to fit
y = c + a*exp(b*x)
and then use the resulting coefficients for a, b, and c as starting points when fitting the whole equation
y = c+ a*exp(b*x) + d*sin(f*x);

Sign in to comment.

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!