LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
ReducedMomsFromMoms.m
1% rm = ReducedMomsFromMoms(m)
2%
3% Returns the reduced moments given the raw 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% m : vector of doubles
12% The list of raw moments (starting with the first
13% moment)
14%
15% Returns
16% -------
17% rm : vector of doubles
18% The list of reduced moments
19
20function rm=ReducedMomsFromMoms(m)
21
22 rm = m;
23 f = 1.0;
24 for i=1:length(m)
25 f = f / i;
26 rm(i) = rm(i) * f;
27 end
28end