butools.map.LagkJointMomentsFromMMAP¶
-
butools.map.
LagkJointMomentsFromMMAP
()¶ Matlab: Nm = LagkJointMomentsFromMMAP(D, K, L, prec)
Mathematica: Nm = LagkJointMomentsFromMMAP[D, K, L, prec]
Python/Numpy: Nm = LagkJointMomentsFromMMAP(D, K, L, prec)
Returns the lag-L joint moments of a marked Markovian arrival process.
Parameters: D : list/cell of matrices of shape(M,M), length(N)
The D0...DN matrices of the MMAP to check
K : int, optional
The dimension of the matrix of joint moments to compute. If K=0, the MxM joint moments will be computed. The default value is 0
L : int, optional
The lag at which the joint moments are computed. The default value is 1
prec : double, optional
Numerical precision to check if the input is valid. The default value is 1e-14
Returns: Nm : list/cell of matrices of shape(K+1,K+1), length(L)
The matrices containing the lag-L joint moments, starting from moment 0.
Examples
For Matlab:
>>> D0 = [-1.78, 0.29; 0.07, -0.92]; >>> D1 = [0.15, 0.49; 0.23, 0.36]; >>> D2 = [0.11, 0.2; 0.01, 0]; >>> D3 = [0.14, 0.4; 0.11, 0.14]; >>> Nm = LagkJointMomentsFromMMAP({D0, D1, D2, D3}, 3, 1); >>> disp(Nm{1}); 0.60207 0.60501 1.2755 4.1438 0.62913 0.62913 1.3226 4.2901 1.3561 1.3524 2.8387 9.1998 4.4576 4.4395 9.3105 30.16 >>> disp(Nm{2}); 0.080053 0.078372 0.16268 0.52401 0.06033 0.058276 0.11997 0.38467 0.10244 0.097662 0.1994 0.63637 0.28923 0.27293 0.5536 1.7601 >>> disp(Nm{3}); 0.31788 0.31729 0.66629 2.1599 0.31121 0.30821 0.64424 2.0831 0.646 0.63672 1.3271 4.2844 2.0808 2.0455 4.2565 13.73
For Mathematica:
>>> D0 = {{-1.78, 0.29},{0.07, -0.92}}; >>> D1 = {{0.15, 0.49},{0.23, 0.36}}; >>> D2 = {{0.11, 0.2},{0.01, 0}}; >>> D3 = {{0.14, 0.4},{0.11, 0.14}}; >>> Nm = LagkJointMomentsFromMMAP[{D0, D1, D2, D3}, 3, 1]; >>> Print[Nm[[1]]]; {{0.6020680453635756, 0.6050097826919547, 1.2755312779381711, 4.143785726301525}, {0.6291277595686432, 0.6291324346751083, 1.3226115303952872, 4.29008766966622}, {1.356058746641639, 1.3524365188039793, 2.8387063057306685, 9.199840452355494}, {4.457620287136224, 4.439461568207248, 9.310487784608107, 30.160255763360027}} >>> Print[Nm[[2]]]; {{0.08005336891260842, 0.07837208152164925, 0.16268008556958458, 0.5240068039224259}, {0.06033000338608641, 0.058276456272008365, 0.11997332411839014, 0.3846690086730414}, {0.10243942401511769, 0.09766196798710611, 0.19940380826076648, 0.6363686631976577}, {0.289234720958347, 0.2729259896515855, 0.5535960565150979, 1.7600767451077592}} >>> Print[Nm[[3]]]; {{0.3178785857238159, 0.31728524719400103, 0.66628526766832, 2.1598956192106504}, {0.3112093484528753, 0.30821203977350414, 0.6442381239542273, 2.0831364406036084}, {0.6459984605193192, 0.6367244916768195, 1.327097838382605, 4.28439098549322}, {2.0808331413400314, 2.045505561084037, 4.256516259923166, 13.72951730592557}}
For Python/Numpy:
>>> D0 = ml.matrix([[-1.78, 0.29],[0.07, -0.92]]) >>> D1 = ml.matrix([[0.15, 0.49],[0.23, 0.36]]) >>> D2 = ml.matrix([[0.11, 0.2],[0.01, 0]]) >>> D3 = ml.matrix([[0.14, 0.4],[0.11, 0.14]]) >>> Nm = LagkJointMomentsFromMMAP([D0, D1, D2, D3], 3, 1) >>> print(Nm[0]) [[ 0.60207 0.60501 1.27553 4.14379] [ 0.62913 0.62913 1.32261 4.29009] [ 1.35606 1.35244 2.83871 9.19984] [ 4.45762 4.43946 9.31049 30.16026]] >>> print(Nm[1]) [[ 0.08005 0.07837 0.16268 0.52401] [ 0.06033 0.05828 0.11997 0.38467] [ 0.10244 0.09766 0.1994 0.63637] [ 0.28923 0.27293 0.5536 1.76008]] >>> print(Nm[2]) [[ 0.31788 0.31729 0.66629 2.1599 ] [ 0.31121 0.30821 0.64424 2.08314] [ 0.646 0.63672 1.3271 4.28439] [ 2.08083 2.04551 4.25652 13.72952]]