1function m = moment_raw_from_cumulant(kappa)
2% m = moment_raw_from_cumulant(kappa)
4% Converts the cumulants kappa_n of a random variable X into its power (raw)
5% moments m_n = E[X^n], by running the exponential-formula recursion forward,
7% m_n =
sum_{k=1}^{n} nchoosek(n-1,k-1) * kappa_k * m_(n-k)
9% with m_0 = 1. Equivalently m_n =
sum_{pi in
P(n)} prod_{B in pi} kappa_|B|
10% over the set partitions of {1,...,n}. Inverse of moment_cumulant_from_raw.
13% kappa: vector of length n+1 holding kappa_0,...,kappa_n, i.e. kappa(i)
is
14% the cumulant of order i-1. Element 1
is ignored, since kappa_0 = 0
15% carries no information
18% m: vector of length n+1 holding m_0,...,m_n, with the same orientation as
22% m = moment_raw_from_cumulant(moment_cumulant_from_raw([1, 2, 6, 22]));
25% V.
P. Leonov and A. N. Shiryaev. On a method of calculation of
26% semi-invariants. Theory of Probability and its Applications,
36 acc = acc + nchoosek(i-1,k-1) * kcol(k+1) * m(i-k+1);