Filter löschen
Filter löschen

How can I use fmincon for maximum likelihood optimization?

6 Ansichten (letzte 30 Tage)
Richard
Richard am 13 Sep. 2012
I am trying to use fmincon to obtain mle's for my model. Using the 'mle' function it gives me a solution, but the solution is not unique. I have therefore applied constraints to some of the parameters and tried to use 'fmincon' instead. But every time I run 'fmincon', with different starting values, it keeps giving me
Max Line search Directional 1st-order
Iter F-count f(x) c'straint steplength derivative optimality Procedure
0 5 12059.9 0
1 10 NaN 9.095e-13 1 -1.34e+04 Inf
2 15 NaN NaN 1 NaN Inf Hessian not
I'm not sure what's going wrong. I've included my code for the objective function, log-likelihood in this case, and the command lines I am using to run the optimization problem.
function ln_like = Skellam_Log_likelihood(parameters)
D = importdata('E:\Matlab Data Files\Emprical Data\GoalDifference.dat','D');
mu = parameters(1);
h = parameters(2);
a1 = parameters(3);
a2 = parameters(4);
for i = 1:1:length(D)
pdf(i) = Skellam_pdf(D(i),mu,h,a1,a2);
end
pdf = log(pdf);
ln_like = -1*sum(pdf);
end
x0 = [1 1 .2 -.2];
opts = optimset('Display','iter','Algorithm','active-set');
[x fval] = fmincon(@Skellam_Log_likelihood,x0,[],[],[0 0 1 1],0,[],[],... [],opts)

Antworten (0)

Kategorien

Mehr zu Nonlinear Optimization finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by