Path: news.mathworks.com!not-for-mail
From: Marcelo Marazzi <mREMOVEmaALLraCAPITALSzzi@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Have fminunc show the gradient?
Date: Fri, 15 Aug 2008 16:41:48 -0400
Organization: The MathWorks, Inc.
Lines: 25
Message-ID: <g84pmc$rle$1@fred.mathworks.com>
References: <g7sm8a$fgh$1@fred.mathworks.com> <g8268q$384$1@fred.mathworks.com> <g828c9$8g$1@fred.mathworks.com> <g83uvq$nna$1@fred.mathworks.com>
NNTP-Posting-Host: marazzim.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 1218832908 28334 172.31.57.176 (15 Aug 2008 20:41:48 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 15 Aug 2008 20:41:48 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.16 (Windows/20080708)
In-Reply-To: <g83uvq$nna$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:485753



There is a built-in plot function that plots the norm of the gradient.

One way to run it is to open the optimtool, and select FIrst Order 
Optimality under Plot Functions. There is a way to run this from the 
command line as well.

I assume you're using the medium-scale algorithm. This algorithm
does not compute the Hessian, but rather a so-called quasi-Newton
approximation to the inverse of the Hessian. This matrix is only
an approximation (often crude), and to the inverse of the Hessian
(not to the Hessian itself), so it's not made available via the
output function - typically it's not useful.

The output function gives you access to each iterate x; you can
compute the Hessian (or an approximation to it via finite differences)
at x inside the output function.

-Marcelo

David Doria wrote:
> Ok, now I would like to see the hessian that it calculates
> at every step... I don't see this in the OptimValues list...
> is there a way to get at it?
> 
> Dave