1% pmf = PmfFromMG(alpha, A, x, prec)
3% Returns the probability mass function of a matrix-
4% geometric distribution.
8% alpha : vector, shape (1,M)
9% The initial vector of the matrix-geometric
10% distribution. The sum of the entries of pi0
is less
12% A : matrix, shape (M,M)
13% The matrix parameter of the matrix-geometric
15% x : vector of non-negative integers
16% The density function will be computed at these points
17% prec : double, optional
18% Numerical precision to check
if the input MG
19% distribution
is valid. The
default value
is 1e-14.
23% pmf : column vector of doubles
24% The probabilities that the matrix-geometrically
25% distributed random variable takes the corresponding
"x"
29function pmf = PmfFromMG (alpha, A, x)
31 global BuToolsCheckInput;
32 if isempty(BuToolsCheckInput)
33 BuToolsCheckInput =
true;
36 if BuToolsCheckInput && ~CheckMGRepresentation(alpha, A)
37 error(
'PmfFromMG: Input isn''t a valid MG distribution!');
41 pmf = zeros(1,length(x));
44 pmf(i) = 1.0 - sum(alpha);
46 pmf(i) = sum(alpha*(A^(x(i)-1))*a);