Fit distribution using moments
27 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
proy
el 23 de En. de 2024
Editada: John D'Errico
el 23 de En. de 2024
There is a `fitdist` function to find distribution based on the given data.
Is there a function to find a distribution given moments?
Thank you.
0 comentarios
Respuesta aceptada
John D'Errico
el 23 de En. de 2024
Editada: John D'Errico
el 23 de En. de 2024
This is something commonly done using either the Pearson or Johnson family of distributions. (It has been many years since I looked at this, so there may be other choices by now too.) The MATLAB stats TB offers the Pearson family (which I think I recall is the better choice anyway.)
lookfor pearson
For example, given the first 4 moments, we can use those tools.
help pearscdf
How would you use them? Simple enough. For example, I know the normal distribution has skewness zero, and kurtosis 3. So a normal distribution, with mean 1, and standard deviation 1/2 would have the cdf...
[~,T] = pearscdf([],1,1/2,0,3)
A Pearson type 0 is a normal distribution. Whoopsie do! I got it right!
And we can plot the cdf as:
fplot(@(x) pearscdf(x,1,1/2,0,3))
You can use pearsrnd to generate random numbers from that distribution, etc.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Regression en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!