LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
CheckMEPositiveDensity.m
1% r = CheckMEPositiveDensity(alpha, A, maxSize, prec)
2%
3% Checks if the given matrix-exponential distribution has
4% positive density.
5%
6% Parameters
7% ----------
8% alpha : matrix, shape (1,M)
9% Initial vector of the matrix-exponential distribution
10% to check
11% A : matrix, shape (M,M)
12% Matrix parameter of the matrix-exponential distribution
13% to check
14% maxSize : int, optional
15% The procedure tries to transform the ME distribution
16% to phase-type up to order maxSize. The default value
17% is 100.
18% prec : double, optional
19% Numerical precision. The default value is 1e-14.
20%
21% Returns
22% -------
23% r : bool
24% True, if the given matrix-exponential distribution has
25% a positive density
26%
27% Notes
28% -----
29% This procedure calls MonocyclicPHFromME, and can be time
30% consuming.
31
32function r = CheckMEPositiveDensity (alpha, A, maxSize, prec)
33
34 global BuToolsCheckPrecision;
35 if isempty(BuToolsCheckPrecision)
36 BuToolsCheckPrecision = 1e-12;
37 end
38
39 if ~exist('prec','var')
40 prec = BuToolsCheckPrecision;
41 end
42
43 if ~exist('maxSize','var')
44 maxSize = 100;
45 end
46
47 try
48 [beta, B] = MonocyclicPHFromME (alpha, A, maxSize, prec);
49 r = CheckMERepresentation (beta, B, prec);
50 catch err
51 r = false;
52 end
53end
54