1% moms = MomentsFromDPH(alpha, A, K, prec)
3% Returns the first K moments of a discrete phase-type
8% alpha : vector, shape (1,M)
9% The initial probability vector of the discrete phase-
10% type distribution. The sum of the entries of pi0
is
12% A : matrix, shape (M,M)
13% The transient generator matrix of the discrete phase-
16% Number of moments to compute. If K=0, 2*M-1 moments
17% are computed. The
default value
is 0.
18% prec : double, optional
19% Numerical precision
for checking the input.
20% The
default value
is 1e-14.
24% moms : row vector of doubles
25% The vector of moments.
28function moms = MomentsFromDPH (alpha, A, K)
30 global BuToolsCheckInput;
31 if isempty(BuToolsCheckInput)
32 BuToolsCheckInput =
true;
35 if BuToolsCheckInput && ~CheckDPHRepresentation(alpha, A)
36 error(
'MomentsFromDPH: Input isn''t a valid PH representation!');
43 moms = MomentsFromMG (alpha, A, K);