LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
moment_tail_from_binomial.m
1function t = moment_tail_from_binomial(b)
2% t = moment_tail_from_binomial(b)
3%
4% Converts the binomial moments of a nonnegative integer random variable into
5% its survival (tail) probabilities,
6%
7% t_m = sum_{j>=m} (-1)^(j-m) * nchoosek(j-1,m-1) * b_j, m >= 1
8%
9% with t_0 = 1. Inverse of moment_binomial_from_tail. The inversion is exact on
10% the finite box supplied, the matrix being unit upper triangular, but it
11% reconstructs the true tail only if the binomial moments were themselves those
12% of a law supported on 0,...,n.
13%
14% Input:
15% b: vector of length n+1 holding b_0,...,b_n
16%
17% Output:
18% t: vector of length n+1 holding t_0,...,t_n, with the same orientation as b
19%
20% Example:
21% t = moment_tail_from_binomial(moment_binomial_from_tail([1, 1, 1, 0]));
22%
23% Reference:
24% A. Heindl and A. van de Liefvoort. Moment conversions for discrete
25% distributions. PMCCS, 2003.
26
27bcol = b(:);
28n = length(bcol)-1;
29t = moment_housematrix('tail_from_binomial', n) * bcol;
30if isrow(b)
31 t = t.';
32end
33end