1function b = moment_binomial_from_negbinomial(bm)
2% b = moment_binomial_from_negbinomial(bm)
4% Converts
the negative-binomial moments b_n^- = E[nchoosek(N+n-1,n)] of a
5% discrete random variable N into
the binomial moments b_n = E[nchoosek(N,n)]
6% by means of
the shifted binomial transform
8% b_n = sum_{k=1}^{n} (-1)^(n-k) * nchoosek(n-1,k-1) * b_k^-
for n >= 1
12% bm: vector of length n+1 holding b_0^-,...,b_n^-, i.e. bm(i)
is the moment
13% of order i-1 and bm(1) = b_0^- = 1
16% b: vector of length n+1 holding b_0,...,b_n, with
the same orientation
20% A. Heindl and A. van de Liefvoort. Moment conversions
for discrete
21% distributions. PMCCS, 2003, eq. (14).
24% b = moment_binomial_from_negbinomial([1,2,4,22/3])
32 b(i+1) = b(i+1) + (-1)^(i-k) * nchoosek(i-1,k-1) * bmcol(k+1);