LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
FactorialMomsFromMoms.m
1% fm = FactorialMomsFromMoms(m)
2%
3% Returns the factorial moments given the raw moments.
4%
5% The raw moments are: `m_i=E(\mathcal{X}^i)`
6%
7% The factorial moments are: `f_i=E(\mathcal{X}(\mathcal{X}-1)\cdots(\mathcal{X}-i+1))`
8%
9% Parameters
10% ----------
11% m : vector of doubles
12% The list of raw moments (starting with the first
13% moment)
14%
15% Returns
16% -------
17% fm : vector of doubles
18% The list of factorial moments
19%
20% References
21% ----------
22% http://en.wikipedia.org/wiki/Factorial_moment
23
24function fm=FactorialMomsFromMoms(m)
25
26 n=length(m);
27 fm=zeros(size(m));
28 m = reshape(m, 1, n);
29 for i=1:n
30 eh=poly(0:i-1);
31 eh=eh(end-1:-1:1);
32 fm(i)=eh*(m(1:i))';
33 end
34end