Categories &

Functions List

Function Reference: pearsrnd

statistics: r = pearsrnd (mu, sigma, skew, kurt)
statistics: r = pearsrnd (mu, sigma, skew, kurt, m)
statistics: r = pearsrnd (mu, sigma, skew, kurt, m, n, …)
statistics: r = pearsrnd (mu, sigma, skew, kurt, [m, n, …])
statistics: [r, type, coefs] = pearsrnd (…)

Random arrays from the Pearson system of distributions.

r = pearsrnd (mu, sigma, skew, kurt) returns a random value drawn from the distribution in the Pearson system with mean mu, standard deviation sigma, skewness skew, and kurtosis kurt. kurt is the (non-excess) kurtosis, and the moments must satisfy kurt > skew^2 + 1.

pearsrnd (mu, sigma, skew, kurt, m, n, …) or pearsrnd (…, [m, n, …]) returns an m-by-n-by-… array of random values, following the size conventions of randn.

[r, type, coefs] = pearsrnd (…) also returns the type of the Pearson distribution (an integer 0 to 7) in type, and the three coefficients coefs = [c0, c1, c2] of the denominator quadratic of the Pearson differential equation for the standardized distribution, so that f'(x) / f (x) = -(x + c1) / (c0 + c1 x + c2 x^2).

The Pearson types are: 0 normal, 1 four-parameter beta, 2 symmetric four-parameter beta, 3 gamma, 4 (not a named distribution), 5 inverse gamma, 6 beta prime, and 7 Student’s t. Type 4 is generated by numerical inversion of its cumulative distribution function.

See also: johnsrnd, random, randn

Source Code: pearsrnd

Identify the Pearson type matching a set of moments

 [r, type, coefs] = pearsrnd (0, 1, 0.75, 4)
r = 0.2812
type = 6
coefs =

   0.938525   0.344262   0.020492

Draw a sample with a target mean, sd, skewness, and kurtosis

 r = pearsrnd (10, 2, 1, 5, 1, 1000);
 [mean(r), std(r)]
ans =

   10.0632    2.0653