LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
MomentsFromPH.m
1% moms = MomentsFromPH(alpha, A, K, prec)
2%
3% Returns the first K moments of a continuous phase-type
4% distribution.
5%
6% Parameters
7% ----------
8% alpha : vector, shape (1,M)
9% The initial probability vector of the phase-type
10% distribution.
11% A : matrix, shape (M,M)
12% The transient generator matrix of the phase-type
13% distribution.
14% K : int, optional
15% Number of moments to compute. If K=0, 2*M-1 moments
16% are computed. The default value is K=0.
17% prec : double, optional
18% Numerical precision for checking the input.
19% The default value is 1e-14.
20%
21% Returns
22% -------
23% moms : row vector of doubles
24% The vector of moments.
25
26function moms = MomentsFromPH (alpha, A, K)
27
28 global BuToolsCheckInput;
29 if isempty(BuToolsCheckInput)
30 BuToolsCheckInput = true;
31 end
32
33 if BuToolsCheckInput && ~CheckPHRepresentation(alpha, A)
34 error('MomentsFromPH: Input isn''t a valid PH representation!');
35 end
36
37 if ~exist('K','var')
38 K = 0;
39 end
40
41 moms = MomentsFromME (alpha, A, K);
42end