1% M = QBDFundamentalMatrices(B, L, F, matrices, precision, maxNumIt, method)
3% Returns the fundamental matrices corresponding to the
4% given QBD. Matrices R, G and U can be returned
5% depending on the
"matrices" parameter.
7% The implementation
is based on [1]_, please cite it
if
12% B : matrix, shape (N,N)
13% The matrix corresponding to backward transitions
14% L : matrix, shape (N,N)
15% The matrix corresponding to local transitions
16% F : matrix, shape (N,N)
17% The matrix corresponding to forward transitions
19% Specifies which matrices are required.
'R' means
20% that only matrix
'R' is needed.
'UG' means that
21% matrices U and G are needed. Any combinations of
22%
'R',
'G' and
'U' are allowed, in any order.
23% precision : double, optional
24% The matrices are computed iteratively up to
this
25% precision. The
default value
is 1e-14
26% maxNumIt : int, optional
27% The maximal number of iterations. The
default value
29% method : {
"CR",
"LR",
"NI",
"FI",
"IS"}, optional
30% The method used to solve the matrix-quadratic
31% equation (CR: cyclic reduction, LR: logarithmic
32% reduction, NI: Newton iteration, FI: functional
33% iteration, IS: invariant subspace method). The
34% default
is "CR".
"CR" is the only supported
35% method in the Mathematica and Python implementation.
40% The list of calculated matrices in the order as
41% requested in the
'matrices' parameter.
45% Discrete and continuous QBDs are both supported, the
46% procedure auto-detects it based on the diagonal entries
51% .. [1] Bini, D. A., Meini, B., Steffé, S., Van Houdt,
52% B. (2006, October). Structured Markov chains
53% solver: software tools. In Proceeding from the
54% 2006 workshop on Tools for solving structured
55% Markov chains (p. 14). ACM.
57function varargout = QBDFundamentalMatrices (B, L, F, matrices, precision, maxNumIt, method)
59 if ~exist(
'precision',
'var')
63 if ~exist(
'maxNumIt',
'var')
67 if ~exist('method','var')
71 if strcmp(method,'CR')
73 elseif strcmp(method,'LR')
75 elseif strcmp(method,'NI')
77 elseif strcmp(method,'IS')
79 elseif strcmp(method,'FI')
83 global BuToolsVerbose;
85 if strfind(matrices,'R')
86 [G,R] = feval (fun, B, L, F, 'MaxNumIt', maxNumIt, 'Verbose', BuToolsVerbose);
88 G = feval (fun, B, L, F, 'MaxNumIt', maxNumIt, 'Verbose', BuToolsVerbose);
91 ret = cell(1,length(matrices));
92 for i=1:length(matrices)
95 elseif matrices(i)==
'R'
97 elseif matrices(i)==
'U'
98 % we did not let smctools calculate U since there
is a bug:
99 % QBD_EG does not convert matrix U back to continuous