Log likelihood
108 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
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
2012 年 5 月 29 日
Sadly, it doesn't say much on its own. You could compare it to the likelihood of other fits.
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
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
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?
Oleg Komarov
2012 年 5 月 24 日
You can try the following submission: http://www.mathworks.co.uk/matlabcentral/fileexchange/34943-fit-all-valid-parametric-probability-distributions-to-data
It will fit several distributions and should return the NLL (NegLogLik) for each.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!