1%{ @file qbd_depproc_jointmom.m
2 % @brief Computes joint moments of consecutive inter-departure times
4 % @author LINE Development Team
8 % @brief Computes joint moments E[X_0^i * X_1^j] of consecutive inter-departure times
11 % Given arrival and service MAPs
for a MAP/MAP/1 queue,
this function
12 % computes joint moments of consecutive inter-departure times
using the
13 % QBD structure. The initial vector
is constructed from the stationary
14 % distribution at departure epochs via ETAQA.
16 % The departure SCV and lag-1 ACF can be obtained as:
17 % E1 = qbd_depproc_jointmom(MAPa, MAPs, [1,0]) % E[X]
18 % E2 = qbd_depproc_jointmom(MAPa, MAPs, [2,0]) % E[X^2]
19 % E11 = qbd_depproc_jointmom(MAPa, MAPs, [1,1]) % E[X_0*X_1]
20 % SCV = (E2 - E1^2) / E1^2
21 % ACF = (E11 - E1^2) / (E2 - E1^2)
25 % JM = qbd_depproc_jointmom(MAPa, MAPs, iset)
30 % <tr><th>Name<th>Description
31 % <tr><td>MAPa<td>Arrival process in MAP format {D0, D1}
32 % <tr><td>MAPs<td>Service process in MAP format {D0, D1}
33 % <tr><td>iset<td>Matrix of moment orders [i1,j1; i2,j2; ...] where each
34 % row specifies the exponents
for E[X_0^i * X_1^j]
39 % <tr><th>Name<th>Description
40 % <tr><td>JM<td>Vector of joint moments, one per row of iset
43function [JM]=qbd_depproc_jointmom(MAPa,MAPs,iset)
49F = kron(MAPa{2},eye(ns));
50L = krons(MAPa{1},MAPs{1});
51B = kron(eye(na),MAPs{2});
52L0 = kron(MAPa{1},eye(ns));
55[~,R,~] = QBD_CR(B,L,F);
59lambdaS = map_lambda(MAPs);
60v0D = 1/lambdaS*v0 *R * F;
61v1D = 1/lambdaS*v0 *R^2 * F;
62v2Dp = 1/lambdaS*v0 * R^3*inv(eye(size(R))-R)*F;
64z = z / sum(z); % normalize to probability distribution
66M0 = [L0,F,Z; Z,L,F; Z,Z,L+F];
67M1 = [Z,Z,Z; B,Z,Z; Z,B,Z];
70 JM(k) = z * factorial(iset(k,1)) * (-M0)^(-iset(k,1)-1) * M1 * factorial(iset(k,2)) * (-M0)^(-iset(k,2)) * ones(length(M0),1);