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