Maximize function (parameters estimation with likelihood)

조회 수: 11 (최근 30일)
Fregior
Fregior 2016년 9월 3일
편집: Fregior 2016년 9월 6일
Hello, I have a function that gives me a likelihood which I want to maximize. The problem is that I need to give 4 parameters that I need to estimate. I have this function:
[z, z0, z1, z2, z3]= myfun(g, g1, g2, x1, g3, x2, x3)
How can I maximize z giving as x1 a 20x20 matrix symmetric?

답변 (1개)

Sindhuja Parimalarangan
Sindhuja Parimalarangan 2016년 9월 6일
To get the maximum likelihood for the function "myfunc", you can use the "fmincon" function. Extra parameters (x1,x2,x3) can be passed by means of anonymous function as an argument to "fmincon".
The general workflow would be to :
1. Construct an anonymous function with x1,x2,x3 2. Specify known parameters g,g1,g2,g3 3. Call "fmincon" of the form - fmincon(@(x1,x2,x3),myfun(g,g1,g2,x1,g3,x2,x3))
Alternately, the anonymous function can be defined outside "fmincon" and used as one of it's arguments.
You can refer to this link for documentation and examples on passing extra parameters: http://www.mathworks.com/help/optim/ug/passing-extra-parameters.html

카테고리

Help CenterFile Exchange에서 R Language에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by