LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
MarginalMomentsFromDMMAP.m
1% moms = MarginalMomentsFromDMMAP(D, K, precision)
2%
3% Returns the moments of the marginal distribution of a
4% discrete marked Markovian arrival process.
5%
6% Parameters
7% ----------
8% D : list/cell of matrices of shape(M,M), length(N)
9% The D0...DN matrices of the DMMAP
10% K : int, optional
11% Number of moments to compute. If K=0, 2*M-1 moments
12% are computed. The default value is K=0.
13% precision : double, optional
14% Numerical precision for checking if the input is valid.
15% The default value is 1e-14
16%
17% Returns
18% -------
19% moms : row vector of doubles, length K
20% The vector of moments.
21
22function moms = MarginalMomentsFromDMMAP (D,K)
23
24 if ~exist('K','var') || K==0
25 K = 2*size(D{1},1)-1;
26 end
27
28 global BuToolsCheckInput;
29 if isempty(BuToolsCheckInput)
30 BuToolsCheckInput = true;
31 end
32
33 if BuToolsCheckInput && ~CheckDMMAPRepresentation(D)
34 error('MarginalMomentsFromDMMAP: Input isn''t a valid DMMAP representation');
35 end
36
37 [alpha,A] = MarginalDistributionFromDMMAP(D);
38 moms = MomentsFromDPH(alpha,A,K);
39end