필터 지우기
필터 지우기

Log likelihood

조회 수: 80 (최근 30일)
Nuchto
Nuchto 2012년 5월 22일
댓글: Jessica Hopf 2023년 3월 3일
Hi!
I was wondering how to compute (which function to use) in Matlab the log likelihood but when the data is not normally distributed. Thanks!
Nuchto

채택된 답변

Tom Lane
Tom Lane 2012년 5월 24일
If you have the most recent release of the Statistics Toolbox:
>> x = poissrnd(4,20,1);
>> pd = fitdist(x,'poisson');
>> pd.NLogL
ans =
39.0221
If you do not:
>> mu = poissfit(x);
>> -sum(log(poisspdf(x,mu)))
ans =
39.0221
  댓글 수: 12
Tom Lane
Tom Lane 2012년 5월 29일
Sadly, it doesn't say much on its own. You could compare it to the likelihood of other fits.
Jessica Hopf
Jessica Hopf 2023년 3월 3일
Im curious where the documentation for pd.NLogL is? specifically, I can't find how you would know to do this without having found this answer

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

the cyclist
the cyclist 2012년 5월 22일
편집: John Kelly 2015년 2월 26일
If you have the Statistics Toolbox, you can calculate the (negative) log likelihood for several functional forms.
For example, there is a betalike() function that will calculate the NLL for a beta function.
  댓글 수: 3
the cyclist
the cyclist 2012년 5월 23일
I'm not sure I understand what you mean. When you say you can't "find" them, do you mean they are not in your version of MATLAB? Do you have the Statistics Toolbox?
Or do you mean that you see all those functions, but none of them are for the distribution you are trying to use?
Or do you mean something else?
Nuchto
Nuchto 2012년 5월 24일
I meant the last: none of the functions listed in Matlab R2011a are for my distribution. My distribution is non-log. Anyway, is there a way to know which distribution is my data? I am very much a newbie.

댓글을 달려면 로그인하십시오.


Oleg Komarov
Oleg Komarov 2012년 5월 24일
It will fit several distributions and should return the NLL (NegLogLik) for each.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by