LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
QBDStationaryDistr.m
1% pi = QBDStationaryDistr (pi0, R, K)
2%
3% Returns the stationary distribution of a QBD up to a
4% given level K.
5%
6% Parameters
7% ----------
8% pi0 : matrix, shape (1,N)
9% The stationary probability vector of level zero
10% R : matrix, shape (N,N)
11% The matrix parameter of the matrix geometrical
12% distribution of the QBD
13% K : integer
14% The stationary distribution is returned up to
15% this level.
16%
17% Returns
18% -------
19% pi : array, length (K+1)*N
20% The stationary probability vector up to level K
21
22function pi = QBDStationaryDistr (pi0, R, K)
23
24 m = size(R,1);
25 pi = zeros(1,(K+1)*m);
26 pi(1:m) = pi0;
27 pix = pi0;
28 for k=1:K
29 pix = pix * R;
30 pi(k*m+1:(k+1)*m) = pix;
31 end
32end