Maximum likelihood estimation for sum of series

Hello,
Im trying to estimate the maximum likelihood for a sum of series. Right now my code looks like this:
a=[30 20 30]
b=[50 10 40]
F = symsum(log(exp(a*k)/(exp(a*k)+exp(b*k))),k,[0 3])
custlogpdf = @(data,k) F
phat = mle(test.individuum,'logpdf',custlogpdf,...
'start',[1])
My custom distribution should be this funktion
Unbenannt.PNG
and P in this case are
Unbenannt2.PNG
How do I insert the funktion into the symsum? I hope someone can help me with this problem.

 Accepted Answer

Matt J
Matt J on 25 Jan 2019
Edited: Matt J on 25 Jan 2019
The mle command is not a symbolic solver. You must use a regular numeric implementation of your logpdf to apply mle().
a=[30 20 30]
b=[50 10 40]
phat = mle([a;b],'logpdf',@custlogpdf,'start',[1]);
function LL=custlogpdf(data,beta)
a=data(1,:);
b=data(2,:);
LL=sum(1./exp(beta*(b-a)));
end

2 Comments

Hey, thank you for your help.
The mle() doesn't accept [a;b]. I get the error message "Data must be a vector".
I see. Well, then by all means go ahead and make it a vector instead.

Sign in to comment.

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products

Release

R2018b

Asked:

on 25 Jan 2019

Commented:

on 25 Jan 2019

Community Treasure Hunt

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

Start Hunting!