1function m = moment_raw_from_central(mc, m1)
2% m = moment_raw_from_central(mc, m1)
4% Converts
the central moments m_n^c = E[(N-m_1)^n] of a random variable N
5% into
the power (raw) moments m_n = E[N^n] by means of
the inverse binomial
6% transform in
the variation that involves
the mean m_1,
8% m_n = sum_{k=0}^{n} nchoosek(n,k) * m_k^c * m_1^(n-k)
10% The mean must be supplied separately since m_1^c = 0 carries no information
11% on it. The conversion also holds
for continuous random variables.
14% mc: vector of length n+1 holding m_0^c,...,m_n^c, i.e. mc(i)
is the moment
15% of order i-1 and mc(1) = m_0^c = 1
19% m: vector of length n+1 holding m_0,...,m_n, with
the same orientation
23% A. Heindl and A. van de Liefvoort. Moment conversions for discrete
24% distributions. PMCCS, 2003, Section 4.
27% m = moment_raw_from_central(moment_central_from_raw([1,2,6,22]), 2)
32 line_error(mfilename,
'The mean m1 must be a scalar.');
37 m(i+1) = m(i+1) + nchoosek(i,k) * mccol(k+1) * m1^(i-k);