Generating Distributions using the Pearson System

2 views (last 30 days)
Hello,
i am working on the example:
my problem is, when i generate normal ditributed numbers
x=randn(1000,1)
and calculate the statistical moments:
moments = {mean(x),std(x),skewness(x),kurtosis(x)}
and i like to check for the kind of distribution in x (where i know it should be normal) with:
[r,type] = pearsrnd(moments{:},10000,1);
the result for [type] is 4 meaning 'Not related to any standard distribution' while it should give [type]=0 'normal distributed'
has someone an answer for this behavior or what do i do wrong. i am using matlab 2010b
p.s. when i use the standardvalues for a normal distribution in:
[r,type] = pearsrnd(0,1,0,3,10000,1);
it gives the correct [Type]
best regards....

Answers (3)

Peter Perkins
Peter Perkins on 20 Feb 2015
This picture on Wikipedia illustrates what's going on: the normal is a point on that picture (the point (0,3)), the limiting case of five of the other cases., including Type IV. You're generating random values from a standard normal, but there's no reason to expect that the sample moments will be equal to the population moments. And since the normal is only a point on that picture, in general the sample moments will be near (0,3), but not on (0,3).
It's no different than asking, "why isn't mean(randn(1000,1)) exactly equal to 0?"
Hope this helps.

Perry
Perry on 16 Mar 2015
ok so u are saying that my normal random nb. dont have the moments/points of 0,3 and thats why they dont come out with the tag 'normal distributed' but schouldnt normal random generated numbers with randn fall within the depicted range of normal distribution in the wiki picture ? so what i simply tried to do is calculating back to prove that randn gives normal distributed samples (distribution fitting)
i am confused

Peter Perkins
Peter Perkins on 23 Mar 2015
It's no different than asking, "why isn't mean(randn(1000,1)) exactly equal to 0?" You're confusing the moments of a distribution with the sample moments of a random sample.
randn returns a random sample from a standard normal distribution. There is no reason to expect that the sample moments of that random sample will be exactly equal to the moments of the distribution.

Community Treasure Hunt

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

Start Hunting!