LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
moment_raw_from_factorial.m
1function m = moment_raw_from_factorial(f)
2% m = moment_raw_from_factorial(f)
3%
4% Converts the factorial moments f_n = E[N(N-1)...(N-n+1)] of a discrete
5% random variable N into the power (raw) moments m_n = E[N^n] by means of the
6% Stirling numbers of the second kind,
7%
8% m_n = sum_{k=0}^{n} S(n,k) * f_k
9%
10% Input:
11% f: vector of length n+1 holding f_0,...,f_n, i.e. f(i) is the moment of
12% order i-1 and f(1) = f_0 = 1
13%
14% Output:
15% m: vector of length n+1 holding m_0,...,m_n, with the same orientation
16% as f
17%
18% Reference:
19% A. Heindl and A. van de Liefvoort. Moment conversions for discrete
20% distributions. PMCCS, 2003, eq. (13).
21%
22% Example:
23% m = moment_raw_from_factorial(moment_factorial_from_raw([1,2,6,22]))
24
25fcol = f(:);
26n = length(fcol)-1;
27m = moment_stirling2(n) * fcol;
28if isrow(f)
29 m = m.';
30end
31end
Definition Station.m:245