Cumulants#

See also Wikipedia [1214]

Calculating the cumulants from the pmf vector#

cumulants_from_pmfvector(self, x, nl, order, show=False)#

where ctx is ipm, dec, mpm, or gmp.

Calculates the cumulants \(\kappa_r\) from the pmf vector.

Calculating the cumulants from the factorial moments#

ctx.cumulants_from_factorialmoments(self, mfac)#

where ctx is ipm, dec, mpm, or gmp.

Calculates the cumulants \(\kappa_r\) from the factorial moments.

Calculating the cumulants from the raw moments#

ctx.cumulants_from_rawmoments(raw_moments)#

where ctx is ipm, dec, mpm, or gmp.

Calculates the cumulants \(\kappa_r\) from the raw moments \(\mu_r'\) (see Lee and Lin [426], Rinne [505], p. 36):

\[\kappa_r = \mu_r' - \sum_{j=1}^{r-1} \binom{r-1}{j-1} \mu_{r-j}' \kappa_j\]

Calculating the cumulants from the central moments#

ctx.cumulants_from_centralmoments(cumulants, central)#

where ctx is ipm, dec, mpm, or gmp.

Calculates the cumulants \(\kappa_r\) from the central moments \(\mu_r\) :

\[\kappa_r = \mu_r - \sum_{j=2}^{r-1} \binom{r-1}{j-1} \mu_{r-j} \kappa_j, \quad r>1, \quad \kappa_1=\mu_1.\]
>>> from mpfunlab import dec, mpr, ivr, ivc
>>> ivr.dps = 25; ivr.pretty = True
>>> ivr.exp([-inf,0])
[0.0, 1.0]
>>> ivr.exp([0,1])
[1.0, 2.71828182845904523536028749558]

Calculating the cumulants from the cumulant-generating function#

ctx.cumulants_from_cdf(k, cgf)#

where ctx is ipm, dec, mpm, or gmp.

The cumulants \(\kappa _{n}\) are obtained from a power series expansion of the cumulant generating function:

\[K(t)=\sum _{n=1}^{\infty }\kappa _{n}{\frac {t^{n}}{n!}}=\mu t+\sigma ^{2}{\frac {t^{2}}{2}}+\cdots .\]

This expansion is a Maclaurin series, so the n-th cumulant can be obtained by differentiating the above expansion n times and evaluating the result at zero:

\[\kappa _{n}=K^{(n)}(0).\]