Path: news.mathworks.com!not-for-mail
From: Alan Weiss <aweiss@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Improving precision in fminunc
Date: Thu, 08 Oct 2009 08:02:06 -0400
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <hakkbu$hj4$1@fred.mathworks.com>
References: <hai3rg$qhc$1@fred.mathworks.com>
NNTP-Posting-Host: weissa.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1255003326 18020 172.31.57.141 (8 Oct 2009 12:02:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 8 Oct 2009 12:02:06 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
In-Reply-To: <hai3rg$qhc$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:575879


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