Thread Subject: lsqcurvefit, exitflag=3

Subject: lsqcurvefit, exitflag=3

From: Matthew

Date: 18 Jan, 2012 22:11:10

Message: 1 of 2

Hi, I am using lsqcurvefit to model 9 simultaneous equations. When it runs, I repeatedly get an exitflag of 3, and a message that says I may be in a local minimum. I believe I am, as the fits to my data are quite bad. I think the problem may be that one of my equations produces values that are ~50 times larger than all the other equations. The large valued equation seems to be fitting just fine, i.e., the residual being calculated is dominated by the equation with the large values.

Can someone suggest what I might do to get around this. I have always heard that scaling data down is a bad idea, but I am contemplating dividing the large equation by 50, scaling my corresponding data, and then trying it again, but I wanted to see if someone else had ever run into a similar problem.

Thanks

Subject: lsqcurvefit, exitflag=3

From: Hernan Romero

Date: 19 Jan, 2012 15:57:33

Message: 2 of 2

Hi Matthew,

Yes, scaling the problem as you describe is exactly what you need to do in
order to obtain a better fit. Depending on your version of MATLAB, you
might be able to set the ScaleProblem to 'Jacobian' if you are using the
Levenberg Marquardt algorithm. This is described in the documentation for
lsqcurvefit:
web([docroot '/toolbox/optim/ug/lsqcurvefit.html'])

I hope this helps

-HR

"Matthew" <matthew.merritt.nospam@utsouthwestern.edu> wrote in message
news:jf7g1u$27g$1@newscl01ah.mathworks.com...
> Hi, I am using lsqcurvefit to model 9 simultaneous equations. When it
> runs, I repeatedly get an exitflag of 3, and a message that says I may be
> in a local minimum. I believe I am, as the fits to my data are quite bad.
> I think the problem may be that one of my equations produces values that
> are ~50 times larger than all the other equations. The large valued
> equation seems to be fitting just fine, i.e., the residual being
> calculated is dominated by the equation with the large values.
> Can someone suggest what I might do to get around this. I have always
> heard that scaling data down is a bad idea, but I am contemplating
> dividing the large equation by 50, scaling my corresponding data, and then
> trying it again, but I wanted to see if someone else had ever run into a
> similar problem.
>
> Thanks

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
lsqcurvefit Matthew 18 Jan, 2012 17:14:11
rssFeed for this Thread

Contact us at files@mathworks.com