LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
moment_negbinomial_from_upfactorial.m
1function bm = moment_negbinomial_from_upfactorial(fp)
2% bm = moment_negbinomial_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 negative-binomial moments
6% b_n^- = E[nchoosek(N+n-1,n)] via the one-to-one correspondence
7%
8% b_n^- = f_n^+ / n!
9%
10% Input:
11% fp: vector of length n+1 holding f_0^+,...,f_n^+, i.e. fp(i) is the moment
12% of order i-1 and fp(1) = f_0^+ = 1
13%
14% Output:
15% bm: vector of length n+1 holding b_0^-,...,b_n^-, with the same
16% orientation as fp
17%
18% Reference:
19% A. Heindl and A. van de Liefvoort. Moment conversions for discrete
20% distributions. PMCCS, 2003, eq. (7).
21%
22% Example:
23% bm = moment_negbinomial_from_upfactorial([1,2,8,44])
24
25fpcol = fp(:);
26n = length(fpcol)-1;
27bm = zeros(n+1,1);
28for i = 0:n
29 bm(i+1) = fpcol(i+1) / factorial(i);
30end
31if isrow(fp)
32 bm = bm.';
33end
34end
Definition Station.m:245