LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
MGFromMoments.m
1% [alpha, A] = MGFromMoments(moms)
2%
3% Creates a matrix-geometric distribution that has the
4% same moments as given.
5%
6% Parameters
7% ----------
8% moms : vector of doubles
9% The list of moments. The order of the resulting
10% matrix-geometric distribution is
11% determined based on the number of moments given. To
12% obtain a matrix-geometric distribution of order M,
13% 2*M-1 moments are required.
14%
15% Returns
16% -------
17% alpha : vector, shape (1,M)
18% The initial vector of the matrix-geometric
19% distribution.
20% A : matrix, shape (M,M)
21% The matrix parameter of the matrix-geometric
22% distribution.
23%
24% References
25% ----------
26% .. [1] A. van de Liefvoort. The moment problem for
27% continuous distributions. Technical report,
28% University of Missouri, WP-CM-1990-02, Kansas City,
29% 1990.
30
31function [alpha,A] = MGFromMoments(moms)
32
33 rfmoms = ReducedMomsFromMoms (FactorialMomsFromMoms(moms));
34 rfmoms = [1,rfmoms];
35
36 vlist = zeros(1,length(moms));
37 tmpVec=zeros(1,length(moms)+1);
38 k=1;
39 tmpVec(1)=rfmoms(1);
40
41 for i=1:length(moms)
42 tmpVec(i+1)=(-1)^i*rfmoms(i+1);
43 k=k*i;
44 vlist(i)=k*sum(tmpVec);
45 end
46
47 [alpha,C]=MEFromMoments(vlist);
48 iC=inv(C);
49 A=iC*inv(iC+eye(length(iC)));
50end