LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
DPH3From5Moments.m
1% [alpha, A] = DPH3From5Moments(moms, prec)
2%
3% Returns an order-3 discrete phase-type distribution
4% which has the same 5 moments as given.
5%
6% Parameters
7% ----------
8% moms : vector of doubles, length(5)
9% The moments to match
10% prec : double, optional
11% Numerical precision, default value is 1e-14
12%
13% Returns
14% -------
15% alpha : matrix, shape (1,3)
16% The initial probability vector of the DPH(3)
17% A : matrix, shape (3,3)
18% Transition probability matrix of the DPH(3)
19%
20% Notes
21% -----
22% Raises an error if the moments are not feasible with
23% a DPH(3).
24%
25% This procedure first calls 'MGFromMoments', then transforms
26% it to DPH(3) by 'CanonicalFromDPH3'.
27
28function [alpha, A] = DPH3From5Moments (moms, prec)
29
30 if ~exist('prec','var')
31 prec = 1e-14;
32 end
33
34 [beta, B] = MGFromMoments(moms(1:5));
35 [alpha,A] = CanonicalFromDPH3(beta,B,prec);
36end