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