1% [alpha, A] = DPH2From3Moments(moms, prec)
3% Returns an order-2 discrete phase-type distribution
4% which has the same 3 moments as given.
8% moms : vector of doubles, length(3)
10% prec : double, optional
11% Numerical precision,
default value
is 1e-14
15% alpha : matrix, shape (1,2)
16% The initial probability vector of the DPH(2)
17% A : matrix, shape (2,2)
18% Transition probability matrix of the DPH(2)
22% Raises an error
if the moments are not feasible with
25% This procedure first calls
'MGFromMoments', then transforms
26% it to DPH(2) by 'CanonicalFromDPH2'.
28function [alpha, A] = DPH2From3Moments (moms)
30 [beta, B] = MGFromMoments(moms(1:3));
31 [alpha,A] = CanonicalFromDPH2(beta,B);