필터 지우기
필터 지우기

How can I use fmincon in the mle function?

조회 수: 3 (최근 30일)
Richard
Richard 2012년 9월 13일
I am trying to use the mle function with constraints on the parameters. According to the matlab help you can choose between fminsearch (default) and fmincon (as long as you have the Optimization Toolbox) using 'optimfun'. The issue is it doesn't say how you set constraints when using fmincon instead of fminsearch.
This is the command line I am running in matlab
[para ci] = mle(D,'pdf',@Skellam_pdf,'start',[1,.5,.2,-.2],'optimfun','fmincon')
It still generally finds a solution but the parameters rarely, if ever, satisfy the constraints. I'm not sure if it is possible to add constraints(as I haven't been to find a way) but it seems unlikely that matlab wouldn't have included this in the mle function.

답변 (1개)

Edward Umpfenbach
Edward Umpfenbach 2012년 9월 13일
Simple answer. Type:
help fmincon
It contains all the info for fmincon and some simple examples. Don't see a need to repeat it.
If something isn't clear in the help, then say so. Supply MLE as an anonymous function to fmincon.
  댓글 수: 1
Richard
Richard 2012년 9월 13일
Thanks. I will read up about fmincon now. Just to clarify when you say I should "supply MLE as an anonymous function to fmincon", should I attempt something like,
x = fmincon(@fun_mle,x0,[],[],Aeq,beq)
function F = fun_mle(data)
params = mle(data,'pdf',@Skellam_pdf,'start',[1,.5,.2,-.2]);
F = Skellam_loglf(params);
end
Is that correct?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by