Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: fminsearch and mle
Replies: 4   Last Post: May 3, 2013 9:03 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alan Weiss

Posts: 1,259
Registered: 11/27/08
Re: fminsearch and mle
Posted: May 3, 2013 9:03 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 5/3/2013 5:15 AM, rand olpha wrote:
> I am trying to create a simple mle example by writing a negative log
> likelihood function, assuming a normal distribution, and use
> fminsearch to find the estimates. However, I am struggling to get
> fminsearch to get correct estimated parameters. why I can't get
> correct result?
> load data.mat;% data is 30 x 3 matrix
> params =[2;2;2];
> likepdf=@(dd,p1,p2,p3)
> (1/(sqrt(2*pi)*p1).*exp(-((dd(:,1)-p2*dd(:,2)-p3*dd(:,3)).^2)/2/p1^2));
> myfun = @(par) -prod(likepdf(data,par(1),par(2),par(3)));
> [unparams,negmaxlike,exitflag,output] = fminsearch(myfun,params)
>
> unparams =
>
> 2
> 2
> 2
>
>
> negmaxlike =
>
> 0
>
>
> exitflag =
>
> 1
>
>
> output =
> iterations: 11
> funcCount: 54
> algorithm: 'Nelder-Mead simplex direct search'
> message: [1x194 char]


I suggest you take the log likelihood (you have taken the likelihood).
It is very likely (no pun intended) that the likelihood is about zero in
the region of the initial point, and small perturbations don't change
that. The log likelihood will be more sensitive to small changes in the
parameters.

Alan Weiss
MATLAB mathematical toolbox documentation



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.