Borrar filtros
Borrar filtros

Log likelihood

80 visualizaciones (últimos 30 días)
Nuchto
Nuchto el 22 de Mayo de 2012
Comentada: Jessica Hopf el 3 de Mzo. de 2023
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

Respuesta aceptada

Tom Lane
Tom Lane el 24 de Mayo de 2012
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 comentarios
Tom Lane
Tom Lane el 29 de Mayo de 2012
Sadly, it doesn't say much on its own. You could compare it to the likelihood of other fits.
Jessica Hopf
Jessica Hopf el 3 de Mzo. de 2023
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

Iniciar sesión para comentar.

Más respuestas (2)

the cyclist
the cyclist el 22 de Mayo de 2012
Editada: John Kelly el 26 de Feb. de 2015
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 comentarios
the cyclist
the cyclist el 23 de Mayo de 2012
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 el 24 de Mayo de 2012
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.

Iniciar sesión para comentar.


Oleg Komarov
Oleg Komarov el 24 de Mayo de 2012
It will fit several distributions and should return the NLL (NegLogLik) for each.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by