LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
ldqbd.m
1%{ @file ldqbd.m
2 % @brief Solves level-dependent QBD processes using matrix continued fractions
3 %
4 % @author QORE Lab, Imperial College London (Algorithm by Phung-Duc et al.)
5%}
6
7%{
8 % @brief Solves level-dependent QBD processes using matrix continued fractions
9 %
10 % @details
11 % This function implements Algorithm 1 from "A Simple Algorithm for the Rate
12 % Matrices of Level-Dependent QBD Processes" by Phung-Duc, Masuyama, Kasahara,
13 % and Takahashi (2010), QTNA Conference.
14 %
15 % It computes the rate matrices R^(n) for an ergodic level-dependent QBD
16 % process with a finite number of levels, and optionally the stationary
17 % distribution.
18 %
19 % For a level-dependent QBD with levels 0, 1, ..., N, the infinitesimal
20 % generator has block-tridiagonal structure:
21 %
22 % Q^(0)_1 Q^(0)_0 O O ... O
23 % Q^(1)_2 Q^(1)_1 Q^(1)_0 O ... O
24 % O Q^(2)_2 Q^(2)_1 Q^(2)_0 ... O
25 % ... ... ... ... ... ...
26 % O O O ... Q^(N)_2 Q^(N)_1
27 %
28 % where Q_0^(n) are upward transitions (level n to n+1), Q_1^(n) are local
29 % transitions (within level n), and Q_2^(n) are downward transitions
30 % (level n to n-1).
31 %
32 % @par Syntax:
33 % @code
34 % [R, pi] = ldqbd(Q0, Q1, Q2)
35 % [R, pi] = ldqbd(Q0, Q1, Q2, options)
36 % @endcode
37 %
38 % @par Parameters:
39 % <table>
40 % <tr><th>Name<th>Description
41 % <tr><td>Q0<td>Cell array {Q0^(0), Q0^(1), ..., Q0^(N-1)} - upward transitions
42 % <tr><td>Q1<td>Cell array {Q1^(0), Q1^(1), ..., Q1^(N)} - local transitions
43 % <tr><td>Q2<td>Cell array {Q2^(1), Q2^(2), ..., Q2^(N)} - downward transitions
44 % <tr><td>options<td>Optional struct with fields: epsilon (default 1e-10),
45 % maxIter (default 1000), verbose (default false)
46 % </table>
47 %
48 % @par Returns:
49 % <table>
50 % <tr><th>Name<th>Description
51 % <tr><td>R<td>Cell array {R^(1), R^(2), ..., R^(N)} - rate matrices
52 % <tr><td>pi<td>Row vector [pi_0, pi_1, ..., pi_N] - stationary distribution
53 % </table>
54 %
55 % @par Reference:
56 % T. Phung-Duc, H. Masuyama, S. Kasahara, Y. Takahashi, "A Simple Algorithm
57 % for the Rate Matrices of Level-Dependent QBD Processes", QTNA 2010.
58 %
59 % @see ldqbd_R, ldqbd_pi
60%}
61function [R, pi] = ldqbd(Q0, Q1, Q2, varargin)
62
63% Parse options
64if nargin >= 4 && ~isempty(varargin{1})
65 options = varargin{1};
66else
67 options = struct();
68end
69
70if ~isfield(options, 'epsilon'), options.epsilon = 1e-10; end
71if ~isfield(options, 'maxIter'), options.maxIter = 1000; end
72if ~isfield(options, 'verbose'), options.verbose = false; end
73
74% Determine number of levels
75N = length(Q1) - 1; % Maximum level
76
77if options.verbose
78 fprintf('LD-QBD Solver: N=%d levels, epsilon=%.2e\n', N, options.epsilon);
79end
80
81% Compute all R matrices using ldqbd_R
82R = ldqbd_R(Q0, Q1, Q2, options);
83
84% Compute stationary distribution if requested using ldqbd_pi
85if nargout >= 2
86 pi = ldqbd_pi(R, Q0, Q1, Q2, options);
87end
88
89end