Fit distribution using moments
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
proy
am 23 Jan. 2024
Bearbeitet: John D'Errico
am 23 Jan. 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 Kommentare
Akzeptierte Antwort
John D'Errico
am 23 Jan. 2024
Bearbeitet: John D'Errico
am 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 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
