LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
MomsFromReducedMoms.m
1% m = MomsFromReducedMoms(rm)
2%
3% Returns the raw moments given the reduced moments.
4%
5% The raw moments are: `m_i=E(\mathcal{X}^i)`
6%
7% The reduced moments are: `\displaystyle r_i=\frac{m_i}{i!}`
8%
9% Parameters
10% ----------
11% rm : vector of doubles
12% The list of reduced moments (starting with the first
13% moment)
14%
15% Returns
16% -------
17% m : vector of doubles
18% The list of raw moments
19
20function m=MomsFromReducedMoms(rm)
21
22 m = rm;
23 f = 1.0;
24 for i=1:length(m)
25 f = f * i;
26 m(i) = m(i) * f;
27 end
28end