From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Estimation Problem in Newton Method
Date: Thu, 17 Jun 2010 17:30:27 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <hvdm3j$70q$>
References: <hv4vse$9h1$> <hv6foa$3ho$> <hvct0c$n90$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1276795827 7194 (17 Jun 2010 17:30:27 GMT)
NNTP-Posting-Date: Thu, 17 Jun 2010 17:30:27 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:645850

"Antony zerrar" <> wrote in message <hvct0c$n90$>...
> Can I ask you how would it be possible to change this model to fsolve or fmincon? 

  I don't see why you are using matlab for this problem at all, Antony.  Using elementary calculus you can easily determine that in the upper half of the x1,x2 plane (x2 > 0) your function, f(x1,x2), attains a local maximum at:

 x1 = 1/11*sum(d) = mean(d)
 x2 = 1/3*sum((d-mean(d)).^2) = 10/3*var(d)

That is where both components of the gradient, m and s, become zero.  A 'surf' plot in the neighborhood of this point should make this evident.

  In the lower half of the x1,x2 plane (x2 < 0) there is no local maximum or minimum as the function varies from minus infinity to plus infinity throughout that half-plane.

  Newton's method (properly done,) fsolve, and fmincon should all find that solution easily if given an appropriate initial estimate, but why do it that way when the solution is so easily found by hand?

  I am assuming here, based on your earlier statement, that your function is:

 f(x1,x2) =  -3/2*log(abs(x2)) - sum((d-x1)^2)/(2*x2)

where d = [-1 5 2 -2 4 3 -3 6 3 1 -2].

Roger Stafford