Learn R Programming

PDQutils (version 0.1.4)

moment2cumulant: Convert moments to raw cumulants.

Description

Conversion of a vector of moments to raw cumulants.

Usage

moment2cumulant(moms)

Arguments

moms
a vector of the moments. The first element is the first moment. If centered moments are given, the first cumulant shall be zero.

Value

  • a vector of the cumulants.

Details

The 'raw' cumulants $\kappa_i$ are connected to the 'raw' (uncentered) moments, $\mu_i'$ via the equation $$\kappa_n = \mu_n' - \sum_{m=1}^{n-1} {n-1 \choose m-1} \kappa_m \mu_{n-m}'$$

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

See Also

cumulant2moment

Examples

Run this code
# 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))

Run the code above in your browser using DataLab