Fit distribution using moments
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
John D'Errico
le 23 Jan 2024
Modifié(e) : John D'Errico
le 23 Jan 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Regression dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!