1% cdf = CdfFromMG(alpha, A, x, prec)
3% Returns the cummulative distribution function of a
4% matrix-geometric distribution.
8% alpha : matrix, shape (1,M)
9% The initial vector of the matrix-geometric distribution.
10% A : matrix, shape (M,M)
11% The matrix parameter of the matrix-geometric
13% x : vector of non-negative integers
14% The density function will be computed at these points
15% prec : double, optional
16% Numerical precision to check
if the input MG
17% distribution
is valid. The
default value
is 1e-14.
21% cdf : column vector of doubles
22% The probabilities that the matrix-geometrically
23% distributed random variable
is less or equal to
24% the corresponding
"x" values
27function cdf = CdfFromMG (alpha, A, x)
29 global BuToolsCheckInput;
30 if isempty(BuToolsCheckInput)
31 BuToolsCheckInput =
true;
34 if BuToolsCheckInput && ~CheckMGRepresentation(alpha, A)
35 error(
'CdfFromMG: Input isn''t a valid MG distribution!');
38 cdf = zeros(1,length(x));
40 cdf(i) = 1.0 - sum (alpha*(A^x(i)));