1% [beta, B] = CanonicalFromPH2(alpha, A, prec)
3% Returns the canonical form of an order-2 phase-type
8% alpha : matrix, shape (1,2)
9% Initial vector of the phase-type distribution
10% A : matrix, shape (2,2)
11% Transient generator of the phase-type distribution
12% prec : double, optional
13% Numerical precision,
default value
is 1e-14
17% beta : matrix, shape (1,2)
18% The initial probability vector of the canonical form
19% B : matrix, shape (2,2)
20% Transient generator matrix of the canonical form
24% This procedure calculates 3 moments of the input and
25% calls
'PH2From3Moments'.
27function [beta, B] = CanonicalFromPH2 (alpha, A, prec)
29 if ~exist(
'prec',
'var')
33 global BuToolsCheckInput;
34 if isempty(BuToolsCheckInput)
35 BuToolsCheckInput = true;
38 if BuToolsCheckInput && ~CheckMERepresentation(alpha,A)
39 error('CanonicalFromPH2: Input isn''t a valid ME distribution!');
43 error('CanonicalFromPH2: Dimension
is not 2!');
46 [beta, B] = PH2From3Moments (MomentsFromME(alpha, A, 3), prec);