LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
CanonicalFromPH3.m
1% [beta, B] = CanonicalFromPH3(alpha, A, prec)
2%
3% Returns the canonical form of an order-3 phase-type
4% distribution.
5%
6% Parameters
7% ----------
8% alpha : matrix, shape (1,3)
9% Initial vector of the phase-type distribution
10% A : matrix, shape (3,3)
11% Transient generator of the phase-type distribution
12% prec : double, optional
13% Numerical precision, default value is 1e-14
14%
15% Returns
16% -------
17% beta : matrix, shape (1,3)
18% The initial probability vector of the canonical form
19% B : matrix, shape (3,3)
20% Transient generator matrix of the canonical form
21%
22% Notes
23% -----
24% This procedure calculates 5 moments of the input and
25% calls 'PH3From5Moments'.
26
27function [beta, B] = CanonicalFromPH3 (alpha, A, prec)
28
29 if ~exist('prec','var')
30 prec = 1e-10;
31 end
32
33 global BuToolsCheckInput;
34 if isempty(BuToolsCheckInput)
35 BuToolsCheckInput = true;
36 end
37
38 if BuToolsCheckInput && ~CheckMERepresentation(alpha,A)
39 error('CanonicalFromPH3: Input isn''t a valid ME distribution!');
40 end
41
42 if size(A,1)~=3
43 error('CanonicalFromPH3: Dimension is not 3!');
44 end
45
46 [beta, B] = PH3From5Moments (MomentsFromME(alpha, A, 5), prec);
47end
48