LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
moment_upfactorial_from_negbinomial.m
1function fp = moment_upfactorial_from_negbinomial(bm)
2% fp = moment_upfactorial_from_negbinomial(bm)
3%
4% Converts the negative-binomial moments b_n^- = E[nchoosek(N+n-1,n)] of a
5% discrete random variable N into the upward-factorial moments
6% f_n^+ = E[N(N+1)...(N+n-1)] via the one-to-one correspondence
7%
8% f_n^+ = n! * b_n^-
9%
10% Input:
11% bm: vector of length n+1 holding b_0^-,...,b_n^-, i.e. bm(i) is the moment
12% of order i-1 and bm(1) = b_0^- = 1
13%
14% Output:
15% fp: vector of length n+1 holding f_0^+,...,f_n^+, with the same
16% orientation as bm
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% fp = moment_upfactorial_from_negbinomial([1,2,4,22/3])
24
25bmcol = bm(:);
26n = length(bmcol)-1;
27fp = zeros(n+1,1);
28for i = 0:n
29 fp(i+1) = factorial(i) * bmcol(i+1);
30end
31if isrow(bm)
32 fp = fp.';
33end
34end
Definition Station.m:245