LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
MEOrderFromMoments.m
1% order = MEOrderFromMoments(moms, prec)
2%
3% Returns the order of ME distribution that can realize
4% the given moments.
5%
6% Parameters
7% ----------
8% moms : list of doubles
9% The list of moments
10% prec : double, optional
11% Precision used to detect if the determinant of the
12% Hankel matrix is zero. The default value is 1e-12.
13%
14% Returns
15% -------
16% order : int
17% The order of ME distribution that can realize the
18% given moments
19%
20% References
21% ----------
22% .. [1] L. Bodrog, A. Horvath, M. Telek, "Moment
23% characterization of matrix exponential and Markovian
24% arrival processes," Annals of Operations Research,
25% vol. 160, pp. 51-68, 2008.
26
27function order = MEOrderFromMoments (moms, prec)
28
29 if ~exist('prec','var')
30 prec = 1e-12;
31 end
32
33 sizem = floor((length(moms)+1)/2);
34 rmoms = [1 ReducedMomsFromMoms(moms)];
35
36 for k=1:sizem
37 hankel = zeros(k);
38 for i=1:k
39 for j=1:k
40 hankel(i,j) = rmoms(i+j-1);
41 end
42 end
43 if abs(det(hankel)) < prec
44 order = k-1;
45 return;
46 end
47 end
48 order = sizem;
49end