LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
moment_factorial_from_upfactorial.m
1function f = moment_factorial_from_upfactorial(fp)
2% f = moment_factorial_from_upfactorial(fp)
3%
4% Converts the upward-factorial moments f_n^+ = E[N(N+1)...(N+n-1)] of a
5% discrete random variable N into the factorial moments
6% f_n = E[N(N-1)...(N-n+1)] by means of the Lah numbers,
7%
8% f_n = sum_{k=1}^{n} (-1)^(n-k) * L(n,k) * f_k^+ for n >= 1
9% f_0 = 1
10%
11% Input:
12% fp: vector of length n+1 holding f_0^+,...,f_n^+, i.e. fp(i) is the moment
13% of order i-1 and fp(1) = f_0^+ = 1
14%
15% Output:
16% f: vector of length n+1 holding f_0,...,f_n, with the same orientation
17% as fp
18%
19% Reference:
20% A. Heindl and A. van de Liefvoort. Moment conversions for discrete
21% distributions. PMCCS, 2003, Section 4.
22%
23% Example:
24% f = moment_factorial_from_upfactorial([1,2,8,44])
25
26fpcol = fp(:);
27n = length(fpcol)-1;
28L = moment_lah(n);
29f = zeros(n+1,1);
30f(1) = 1;
31for i = 1:n
32 for k = 1:i
33 f(i+1) = f(i+1) + (-1)^(i-k) * L(i+1,k+1) * fpcol(k+1);
34 end
35end
36if isrow(fp)
37 f = f.';
38end
39end
Definition Station.m:245