1function kappa = moment_factcumulant_from_factorial(f)
2% kappa = moment_factcumulant_from_factorial(f)
4% Converts the factorial moments f_n = E[N(N-1)...(N-n+1)] of a discrete random
5% variable N into its factorial cumulants, the coefficients of the logarithm of
6% the probability generating function expanded about z = 1,
8% log E[z^N] =
sum_{n>=1} kappa_n (z-1)^n / n!
10% The factorial cumulants stand to the factorial moments exactly as the
11% cumulants stand to the power moments, so the same recursion applies,
13% f_n =
sum_{k=1}^{n} nchoosek(n-1,k-1) * kappa_k * f_(n-k)
15% For a Poisson variable of rate lambda all factorial cumulants beyond the
16% first vanish, which makes them the natural measure of departure from Poisson
17% behaviour in the counting process of a MAP.
20% f: vector of length n+1 holding f_0,...,f_n, i.e. f(i)
is the moment of
21% order i-1 and f(1) = 1
24% kappa: vector of length n+1 holding the factorial cumulants of order
25% 0,...,n, with the same orientation as f and element 1 equal to 0
28% kappa = moment_factcumulant_from_factorial([1, 2, 4, 8]);
31% V.
P. Leonov and A. N. Shiryaev. On a method of calculation of
32% semi-invariants. Theory of Probability and its Applications,
35kappa = moment_cumulant_from_raw(f);