LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
CdfFromME.m
1% cdf = CdfFromME(alpha, A, x)
2%
3% Returns the cummulative distribution function of a
4% matrix-exponential distribution.
5%
6% Parameters
7% ----------
8% alpha : matrix, shape (1,M)
9% The initial vector of the matrix-exponential
10% distribution.
11% A : matrix, shape (M,M)
12% The matrix parameter of the matrix-exponential
13% distribution.
14% x : vector of doubles
15% The cdf will be computed at these points
16%
17% Returns
18% -------
19% cdf : column vector of doubles
20% The values of the cdf at the corresponding "x" values
21
22function cdf = CdfFromME (alpha, A, x)
23
24 global BuToolsCheckInput;
25 if isempty(BuToolsCheckInput)
26 BuToolsCheckInput = true;
27 end
28
29 if BuToolsCheckInput && ~CheckMERepresentation(alpha, A)
30 error('CdfFromME: Input isn''t a valid ME distribution!');
31 end
32
33 cdf = zeros(1,length(x));
34 for i=1:length(x)
35 cdf(i) = 1.0 - sum(alpha*expm(A*x(i)));
36 end
37end
38