Calculating the Log-Likelihood Value Produced at dfittool

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

답변 (1개)

Teja Muppirala
Teja Muppirala 2011년 6월 27일
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.

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2011년 6월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by