LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
moment_factorial_from_binomial.m
1function f = moment_factorial_from_binomial(b)
2% f = moment_factorial_from_binomial(b)
3%
4% Converts the binomial moments b_n = E[nchoosek(N,n)] of a discrete random
5% variable N into the factorial moments f_n = E[N(N-1)...(N-n+1)] via the
6% one-to-one correspondence
7%
8% f_n = n! * b_n
9%
10% Input:
11% b: vector of length n+1 holding b_0,...,b_n, i.e. b(i) is the moment of
12% order i-1 and b(1) = b_0 = 1
13%
14% Output:
15% f: vector of length n+1 holding f_0,...,f_n, with the same orientation
16% as b
17%
18% Reference:
19% A. Heindl and A. van de Liefvoort. Moment conversions for discrete
20% distributions. PMCCS, 2003, Section 4.
21%
22% Example:
23% f = moment_factorial_from_binomial([1,2,2,4/3])
24
25bcol = b(:);
26n = length(bcol)-1;
27f = zeros(n+1,1);
28for i = 0:n
29 f(i+1) = factorial(i) * bcol(i+1);
30end
31if isrow(b)
32 f = f.';
33end
34end
Definition Station.m:245