Learn R Programming

PearsonDS (version 1.3.1)

matchMoments: Fitting (Incomplete) Set of Moments to Given Distribution Type

Description

For a given incomplete (skewness or kurtosis are missing) set of moments, the complete set of moments (mean, variance, skewness, and kurtosis) is calculated, using a given distribution type (if possible). Either the complete set of moments or the distribution parameters are returned.

Usage

matchMoments(mean, variance, skewness = NA, kurtosis = NA, type, moments,
             skewness.sign = c("+", "-"), return.distribution = FALSE)

Value

If return.distribution==TRUE: list of parameters for Pearson distribution. First entry gives type of distribution (0 for type 0, 1 for type I, ..., 7 for type VII), remaining entries give distribution parameters (depending on distribution type).

If return.distribution==FALSE: numeric vector with named elements

mean, variance, skewness, kurtosis corresponding to a Pearson distribution of type type.

Arguments

mean

target mean.

variance

target variance.

skewness

target skewness (maybe NA, which is the default).

kurtosis

target kurtosis (not excess kurtosis, maybe NA, which is the default).

type

required distribution type (either one of the numbers 0, 1, ..., 7 or one of "0", "I", "II", "III", "IV", "V", "VI", or "VII").

moments

optional vector/list of mean, variance, skewness, kurtosis (not excess kurtosis) in this order. Overrides the input parameters mean, variance, skewness, kurtosis (if given).

skewness.sign

"+""} or \code{"-"". Gives the sign of the resulting skewness if the input parameter skewness is NA and the resulting skewness is not zero (default: "+").

return.distribution

TRUE or FALSE. If set to FALSE (default), the complete set of moments is returned, if set to TRUE, the list of parameters for the corresponging Pearson distribution is returned.

References

[1] Johnson, N. L., Kotz, S. and Balakrishnan, N. (1994) Continuous Univariate Distributions, Vol. 1, Wiley Series in Probability and Mathematical Statistics, Wiley

[2] Johnson, N. L., Kotz, S. and Balakrishnan, N. (1994) Continuous Univariate Distributions, Vol. 2, Wiley Series in Probability and Mathematical Statistics, Wiley

See Also

PearsonDS-package, Pearson, pearsonFitM, pearsonMoments

Examples

Run this code
matchMoments(mean=0,variance=1,kurtosis=4.5,type=3,return.distribution = TRUE)
matchMoments(mean=0,variance=1,kurtosis=4.5,type="III")
matchMoments(mean=0,variance=1,kurtosis=4.5,type="III",skewness.sign="-")

matchMoments(mean=0,variance=1,skewness=-2,type="III",return.distribution = TRUE)
pearsonFitM(moments=matchMoments(mean=0,variance=1,skewness=-2,type="III"))
matchMoments(mean=0,variance=1,skewness=-2,type="III")

Run the code above in your browser using DataLab