Thread Subject: Improving precision in fminunc

Subject: Improving precision in fminunc

From: Mads

Date: 7 Oct, 2009 13:08:01

Message: 1 of 3

Hi,

I am trying to minimize a non-linear function in two varibles. To test whether it works, I have tried using a function to which I know the solution. When my starting guess IS the solution, fminunc of course returns the starting guess as it should. However, when I vary the starting guess just slightly, the precision of the result is bad. Is there a way to increase the precision of the result?

Best regards and thanks a lot!

Mads

Subject: Improving precision in fminunc

From: Marcus M. Edvall

Date: 8 Oct, 2009 00:02:00

Message: 2 of 3

You can setup the problem with tomSym, as per this page for example:
http://tomsym.com/nlp_programming_matlab.html

Then 1st and 2nd order derivatives will be generated automatically and
your precision will become the best it can be.

Best wishes, Marcus
http://tomopt.com/
http://tomdyn.com/

Subject: Improving precision in fminunc

From: Alan Weiss

Date: 8 Oct, 2009 12:02:06

Message: 3 of 3

Mads wrote:
> Hi,
>
> I am trying to minimize a non-linear function in two varibles. To test whether it works, I have tried using a function to which I know the solution. When my starting guess IS the solution, fminunc of course returns the starting guess as it should. However, when I vary the starting guess just slightly, the precision of the result is bad. Is there a way to increase the precision of the result?
>
> Best regards and thanks a lot!
>
> Mads
There are some ideas on improving results here:
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/br44i2r.html

In particular, try changing to central finite differences
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/br44i2r.html#br544um-1
or, even better, supply a gradient and Hessian if you can
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/br44i2r.html#br544vw-1
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/br44i2r.html#br544qb-1

Of course, you can always fool around with tolerances
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/br44i2r.html#br5440b-1

Alan Weiss
MATLAB mathematical toolbox documentation

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
optimization Mads 7 Oct, 2009 09:09:07
precision Mads 7 Oct, 2009 09:09:07
fminunc Mads 7 Oct, 2009 09:09:06
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com