Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
termination for function:lsqnonlin

Subject: termination for function:lsqnonlin

From: Toan Cao

Date: 4 Apr, 2013 14:23:09

Message: 1 of 3

Hi everyone,

I am using function "lsqnonlin" for optimization process in which "Levenberg-Marquardt" algorithm is chosen.
Given a cost function F, if i would like to terminate optimization process and use following equation:
 |F(k) - F(k-1)| < alpha*(1+F(k)), where F(k) is cost function value at iteration k

How can i set up this option for the function "lsqnonlin"?
Thanks so much for your advice.
Toan

Subject: termination for function:lsqnonlin

From: Alan_Weiss

Date: 5 Apr, 2013 12:00:09

Message: 2 of 3

On 4/4/2013 10:23 AM, Toan Cao wrote:
> Hi everyone,
>
> I am using function "lsqnonlin" for optimization process in which
> "Levenberg-Marquardt" algorithm is chosen.
> Given a cost function F, if i would like to terminate optimization
> process and use following equation:
> |F(k) - F(k-1)| < alpha*(1+F(k)), where F(k) is cost function value at
> iteration k
>
> How can i set up this option for the function "lsqnonlin"?
> Thanks so much for your advice.
> Toan

Before you do that you might want to understand what termination
conditions lsqnonlin already uses.
http://www.mathworks.com/help/optim/ug/tolerances-and-stopping-criteria.html

You can stop any nonlinear solver using any criterion you like by using
an output function:
http://www.mathworks.com/help/optim/ug/output-functions.html

Good luck,

Alan Weiss
MATLAB mathematical toolbox documentation

Subject: termination for function:lsqnonlin

From: Toan Cao

Date: 5 Apr, 2013 19:03:05

Message: 3 of 3

Alan_Weiss <aweiss@mathworks.com> wrote in message <kjmec9$lt2$1@newscl01ah.mathworks.com>...
> On 4/4/2013 10:23 AM, Toan Cao wrote:
> > Hi everyone,
> >
> > I am using function "lsqnonlin" for optimization process in which
> > "Levenberg-Marquardt" algorithm is chosen.
> > Given a cost function F, if i would like to terminate optimization
> > process and use following equation:
> > |F(k) - F(k-1)| < alpha*(1+F(k)), where F(k) is cost function value at
> > iteration k
> >
> > How can i set up this option for the function "lsqnonlin"?
> > Thanks so much for your advice.
> > Toan
>
> Before you do that you might want to understand what termination
> conditions lsqnonlin already uses.
> http://www.mathworks.com/help/optim/ug/tolerances-and-stopping-criteria.html
>
> You can stop any nonlinear solver using any criterion you like by using
> an output function:
> http://www.mathworks.com/help/optim/ug/output-functions.html
>
> Good luck,
>
> Alan Weiss
> MATLAB mathematical toolbox documentation
Hi Alan Weiss,
The second link is so good, it expresses what i am looking for.
Thank you,
Toan

Tags for this Thread

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.

Contact us