1function m = moment_joint_raw_from_cumulant(kappa)
2% m = moment_joint_raw_from_cumulant(kappa)
4% Converts the joint cumulants of a random vector into its joint power (raw)
5% moments, by running the multivariate exponential-formula recursion forward,
7% m_a =
sum_(0<b<=a) prod_l nchoosek(a_l-[l=j], b_l-[l=j]) kappa_b m_(a-b)
9% with m_0 = 1 and j the first dimension in which a
is nonzero. Inverse of
10% moment_joint_cumulant_from_raw.
13% kappa: array of size (n_1+1)x...x(n_d+1) holding the joint cumulants;
17% m: array of the same size holding the joint power moments, element 1 being
21% m = moment_joint_raw_from_cumulant(moment_joint_cumulant_from_raw(m0));
24% V.
P. Leonov and A. N. Shiryaev. On a method of calculation of
25% semi-invariants. Theory of Probability and its Applications,
28sz = moment_tensorsize(kappa);
31stride = cumprod([1, sz(1:end-1)]);
32kv = reshape(kappa, [], 1);
42 if any(b > 1) && b(j) > 1
45 alpha = a(l) - 1 - (l == j);
46 beta = b(l) - 1 - (l == j);
47 c = c * nchoosek(alpha, beta);
50 acc = acc + c * kv(1 + sum((b-1).*stride)) * mv(1 + sum((a-b).*stride));
71m = reshape(mv, size(kappa));