LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
moment_binomial_from_factorial.m
1function b = moment_binomial_from_factorial(f)
2% b = moment_binomial_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 binomial moments b_n = E[nchoosek(N,n)] via the
6% one-to-one correspondence
7%
8% b_n = f_n / n!
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% b: vector of length n+1 holding b_0,...,b_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, Section 4.
21%
22% Example:
23% b = moment_binomial_from_factorial([1,2,4,8])
24
25fcol = f(:);
26n = length(fcol)-1;
27b = zeros(n+1,1);
28for i = 0:n
29 b(i+1) = fcol(i+1) / factorial(i);
30end
31if isrow(f)
32 b = b.';
33end
34end
Definition Station.m:245