Clear Filters
Clear Filters

Calculating the Log-Likelihood Value Produced at dfittool

2 views (last 30 days)
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

Answers (1)

Teja Muppirala
Teja Muppirala on 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!