LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
MarginalMomentsFromRAP.m
1% moms = MarginalMomentsFromRAP(H0, H1, K, precision)
2%
3% Returns the moments of the marginal distribution of a
4% rational arrival process.
5%
6% Parameters
7% ----------
8% H0 : matrix, shape (M,M)
9% The H0 matrix of the rational arrival process
10% H1 : matrix, shape (M,M)
11% The H1 matrix of the rational 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 = MarginalMomentsFromRAP (H0, H1, K)
25
26 if ~exist('K','var') || K==0
27 K = 2*size(H0,1)-1;
28 end
29
30 global BuToolsCheckInput;
31 if isempty(BuToolsCheckInput)
32 BuToolsCheckInput = true;
33 end
34
35 if BuToolsCheckInput && ~CheckRAPRepresentation(H0,H1)
36 error('MarginalMomentsFromRAP: Input isn''t a valid RAP representation!');
37 end
38
39 [alpha,A] = MarginalDistributionFromRAP(H0,H1);
40 moms = MomentsFromME(alpha,A,K);
41end
42