how to optimize maximum like-hood function?
Afficher commentaires plus anciens
I try to use maximum like-hood approach to calculate some parameters. But I do not know the specific expression of the posibility density function. I write code like this:
i = 2:1000;
p0 = [1, 1, 1];
[x, fval] = fminunc(@(x)(-sum(log(pdf(data(i), t(i), data(i-1), t(i-1), x(1), x(2), x(3))))), p0);
( the function pdf can return a posibility density function when you give a set of input, data(i), t(i), data(i-1), t(i-1), x(1), x(2), x(3). )
And I think I should sum all the natural logarithm of posibility density function and put the result in to an optimizer, so I write these codes. But it can not run well. There is an error says Failure in initial objective function evaluation. FMINUNC cannot continue. However, if I give i a specific number, such as 2 or 3, it can work. But in this way, I can't use other data. I have 1000 thousand pairs of data(i) and t(i).
Réponses (0)
Catégories
En savoir plus sur Parallel Computing Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!