From: Alan_Weiss <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: use fminsearch and fmincon to find MLE
Date: Fri, 14 Dec 2012 13:32:20 -0500
Organization: MathWorks
Lines: 18
Message-ID: <kafrbk$69$>
References: <kadqg5$ehk$> <kadrlf$i7v$> <kadsoq$lg2$> <kaffio$ja8$> <kafhls$qip$>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: 1355509940 201 (14 Dec 2012 18:32:20 GMT)
NNTP-Posting-Date: Fri, 14 Dec 2012 18:32:20 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0
In-Reply-To: <kafhls$qip$>
Xref: comp.soft-sys.matlab:784848

On 12/14/2012 10:47 AM, Lizzy wrote:
> And can anyone please tell me if this code is correct?
> coefInit = [1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;9];
> options_fminsearch = 
> optimset('Display','iter','TolFun',1e-4,'TolX',1e-4,'MaxIt',10000000,'MaxFunEvals',10000000000000);
> [coefEst,fval,exitflag,output] = fmincon(@(coef) 
> llk(coef,q,p,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12),coefInit,A,b,[],[],[],[],[],options_fminsearch);

I don't know why you reset the fmincon options TolFun and TolX, and I 
don't know why you call it options_fminsearch, and I don't know why you 
don't use the 'sqp' or 'interior-point' algorithms.

But the syntax looks correct. And with that many dimensions (17), you 
probably wouldn't get reliable fminsearch results.

Alan Weiss
MATLAB mathematical toolbox documentation