1% [x,y] = IntervalPdfFromPH(alpha, A, intBounds, prec)
3% Returns the approximate probability density function of a
4% continuous phase-type distribution, based on the
5% probability of falling into intervals.
9% alpha : vector, shape (1,M)
10% The initial probability vector of the phase-type
12% A : matrix, shape (M,M)
13% The transient generator matrix of the phase-type
15% intBounds : vector, shape (K)
16% The array of interval boundaries. The pdf
is the
17% probability of falling into an interval divided by
19% If the size of intBounds
is K, the size of the result
is K-1.
20% prec : double, optional
21% Numerical precision to check
if the input
is a valid
22% phase-type distribution. The
default value
is 1e-14
26% x : matrix of doubles, shape(K-1,1)
27% The points at which the pdf
is computed. It holds the center of the
28% intervals defined by intBounds.
29% y : matrix of doubles, shape(K-1,1)
30% The values of the density function at the corresponding
"x" values
34% This method
is more suitable
for comparisons with empirical
35% density functions than the exact one (given by PdfFromPH).
37function [x, y] = IntervalPdfFromPH (alpha, A, intBounds)
39 global BuToolsCheckInput;
40 if isempty(BuToolsCheckInput)
41 BuToolsCheckInput =
true;
44 if BuToolsCheckInput && ~CheckPHRepresentation(alpha, A)
45 error(
'IntervalPdfFromPH: Input isn''t a valid PH distribution!');
48 K = length(intBounds);
49 x = reshape ((intBounds(2:end) + intBounds(1:end-1)) / 2, K-1,1);
52 y(i) = (sum(alpha*expm(A*intBounds(i))) - sum(alpha*expm(A*intBounds(i+1))))/(intBounds(i+1)-intBounds(i));