LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
map_dist_lag1.m
1function d = map_dist_lag1(MAPA,MAPB,alA,alB)
2% d=map_dist_lag1(MAPA,MAPB,alA,alB) - Lag-1 joint density L2 distance
3% via Kronecker/Lyapunov formulation. Equivalent to map_dist(MAPA,MAPB,1).
4%
5% Reference:
6% G. Horvath, "Measuring the distance between MAPs and some
7% applications," in Proc. ASMTA 2015, LNCS 9081, pp. 95-109.
8% https://link.springer.com/chapter/10.1007/978-3-319-18579-8_8
9%
10% Input:
11% MAPA: first MAP in the form of {D0,D1}
12% MAPB: second MAP in the form of {D0,D1}
13% alA,alB: (optional) stationary vectors at arrival epochs
14%
15% Output:
16% d: squared L2 distance of lag-1 joint densities
17
18A0=MAPA{1}; A1=MAPA{2};
19B0=MAPB{1}; B1=MAPB{2};
20if nargin<4, alB=map_pie(MAPB); end
21if nargin<3, alA=map_pie(MAPA); end
22
23a = sum(-A0,2);
24b = sum(-B0,2);
25
26Z_AB = lyap(A0', B0, alA'*alB);
27Z_AA = lyap(A0', A0, alA'*alA);
28Z_BB = lyap(B0', B0, alB'*alB);
29
30X_AB = lyap(A0, B0', a*b');
31X_AA = lyap(A0, A0', a*a');
32X_BB = lyap(B0, B0', b*b');
33
34vA1 = reshape(A1, numel(A1), 1);
35vB1 = reshape(B1, numel(B1), 1);
36
37d = vB1'*kron(X_BB,Z_BB)*vB1 + vA1'*kron(X_AA,Z_AA)*vA1 ...
38 - 2*vA1'*kron(X_AB,Z_AB)*vB1;
39end