Calculating the Log-Likelihood Value Produced at dfittool

1 Ansicht (letzte 30 Tage)
Berk
Berk am 24 Jun. 2011
Hi,
I am using dfittool to fit a 1-dimensional data into a statistical distribution and each attempt produces a log-likelihood value. As far as I understood, the higher this value the better the distribution represents the data.
My question is how to calculate that log-likelihood value in a m-file? I found this relevant thread, http://www.mathworks.cn/matlabcentral/newsreader/view_thread/307588#836278, however when I tried to fit the data produced (y vector, I can't choose Poisson when I select x or mu vector), the log-likelihood value is not the same.
Thanks, Berk

Antworten (1)

Teja Muppirala
Teja Muppirala am 27 Jun. 2011
The log likelihood is calculated like this:
1. Evaluate the PDF at each data-point.
2. Take the log of those values.
3. Sum those up.
For example, if your original data is "x" and the distribution object that you created from DFITTOOL is called "pd" then:
sum(log(pdf(pd,x)))
will give you the log-likelihood.

Community Treasure Hunt

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

Start Hunting!

Translated by