Conversion of a vector of moments to raw cumulants.
moment2cumulant(moms)
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.
Returns
a vector of the cumulants. The first element of the input shall be the same as the first element of the output.
Details
The 'raw' cumulants kappai are connected to the 'raw' (uncentered) moments, mui′ via the equation
κn=μn′−m=1∑n−1(m−1n−1)κmμn−m′
Note that this formula also works for central moments, assuming the distribution has been normalized to zero mean.
Note
The presence of a NA or infinite value in the input will propagate to the output.
Examples
# normal distribution, mean 0, variance 1n.cum <- moment2cumulant(c(0,1,0,3,0,15))# normal distribution, mean 1, variance 1n.cum <- moment2cumulant(c(1,2,4,10,26))# exponential distributionlambda <-0.7n <-1:6e.cum <- moment2cumulant(factorial(n)/(lambda^n))