필터 지우기
필터 지우기

Calculating the Log-Likelihood Value Produced at dfittool

조회 수: 2 (최근 30일)
Berk
Berk 2011년 6월 24일
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.

Community Treasure Hunt

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

Start Hunting!

Translated by