Error in optimization process
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to fit a gumbel distribution on a series of data. So I want to minimize the negative of maximum likelihood by optimizing two variables var(1) and var(2). This is my code:
X=xlsread('file.xlsx');
options = optimset('MaxFunEvals',1000,'FinDiffType','central');
options=optimset(options,'Display','iter','MaxIter',1000,'TolCon',1e-6);
lb=0;
ub=Inf;
var=zeros(2,1);
x = fmincon(@(var)Gumbel(var,X),1,1,[],[],[],[],lb,ub,[],options);
and my Gumbel function is:
function f=Gumbel(var, X)
f=-sum(log((1./var(1)).*exp(-(X-var(2))./var(1)-exp(-(X-var(2))./var(1)))))
Can someone help me why I am getting errors?! Thanks
2 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with Optimization Toolbox 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!