LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
moment_binotransinv.m
1function x = moment_binotransinv(y)
2% x = moment_binotransinv(y)
3%
4% Inverse binomial transform of the sequence y_0,y_1,...,y_n,
5%
6% x_n = sum_{k=0}^{n} nchoosek(n,k) * y_k
7%
8% Input:
9% y: vector of length n+1 holding y_0,...,y_n, i.e. y(i) is the element of
10% order i-1
11%
12% Output:
13% x: vector of length n+1 holding x_0,...,x_n, with the same orientation
14% as y
15%
16% Reference:
17% A. Heindl and A. van de Liefvoort. Moment conversions for discrete
18% distributions. PMCCS, 2003, eq. (9).
19%
20% Example:
21% x = moment_binotransinv(moment_binotrans([1,2,5,15]))
22
23ycol = y(:);
24n = length(ycol)-1;
25x = zeros(n+1,1);
26for i = 0:n
27 for k = 0:i
28 x(i+1) = x(i+1) + nchoosek(i,k) * ycol(k+1);
29 end
30end
31if isrow(y)
32 x = x.';
33end
34end
Definition Station.m:245