moment2cumulant: Convert moments to raw cumulants.

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/moments.r

Description

Conversion of a vector of moments to raw cumulants.

Usage

1

Arguments

moms

a vector of the moments. The first element is the first moment (the mean). If centered moments are given, the first moment must be zero. If raw moments are given, the first moment must be the mean.

Details

The 'raw' cumulants kappa_i are connected to the 'raw' (uncentered) moments, mu'_i via the equation

κ_n = μ_n' - ∑_{m=1}^{n-1} {n-1 \choose m-1} κ_m μ_{n-m}'

Note that this formula also works for central moments, assuming the distribution has been normalized to zero mean.

Value

a vector of the cumulants. The first element of the input shall be the same as the first element of the output.

Note

The presence of a NA or infinite value in the input will propagate to the output.

Author(s)

Steven E. Pav shabbychef@gmail.com

See Also

cumulant2moment

Examples

1
2
3
4
5
6
7
8
# normal distribution, mean 0, variance 1
n.cum <- moment2cumulant(c(0,1,0,3,0,15))
# normal distribution, mean 1, variance 1
n.cum <- moment2cumulant(c(1,2,4,10,26))
# exponential distribution
lambda <- 0.7
n <- 1:6
e.cum <- moment2cumulant(factorial(n) / (lambda^n))

Example output



PDQutils documentation built on May 2, 2019, 12:39 p.m.