LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
QBDSolve.m
1% [pi0, R] = QBDSolve (B, L, F, L0, prec)
2%
3% Returns the parameters of the matrix-geometrically
4% distributed stationary distribution of a QBD.
5%
6% Using vector pi0 and matrix R provided by this function
7% the stationary solution can be obtained by
8%
9% .. math::
10% \pi_k=\pi_0 R^k.
11%
12% Parameters
13% ----------
14% B : matrix, shape (N,N)
15% The matrix corresponding to backward transitions
16% L : matrix, shape (N,N)
17% The matrix corresponding to local transitions
18% F : matrix, shape (N,N)
19% The matrix corresponding to forward transitions
20% L0 : matrix, shape (N,N)
21% The matrix corresponding to local transitions at
22% level zero
23% precision : double, optional
24% The fundamental matrix R is computed up to this
25% precision. The default value is 1e-14
26%
27% Returns
28% -------
29% pi0 : matrix, shape (1,N)
30% The stationary probability vector of level zero
31% R : matrix, shape (N,N)
32% The matrix parameter of the matrix geometrical
33% distribution of the QBD
34
35function [pi0, R] = QBDSolve (B, L, F, L0, prec)
36
37 if ~exist('prec','var')
38 prec = 1e-14;
39 end
40
41 m = size(L0,1);
42 I = eye(m);
43
44 R = QBDFundamentalMatrices (B, L, F, 'R', prec);
45
46 % Convert to discrete time problem, if needed
47 if sum(diag(L0)) < 0 % continues time
48 lamb = max(-diag(L0));
49 B = B / lamb;
50 L0 = L0 / lamb + I;
51 end
52
53 pi0 = DTMCSolve(L0+R*B);
54 nr = sum(pi0*inv(I-R));
55 pi0 = pi0 / nr;
56end