1function d = map_dist(MAPA,MAPB,L,alA,alB)
2% d=map_dist(MAPA,MAPB,L,alA,alB) - Squared L2 distance between the
3% lag-L joint densities of two MAPs.
6% G. Horvath,
"Measuring the distance between MAPs and some
7% applications," in Proc. ASMTA 2015, LNCS 9081, pp. 95-109.
11% MAPA: first MAP in the form of {D0,D1}
12% MAPB: second MAP in the form of {D0,D1}
13% L: number of lags (L=1
for lag-1 joint density distance)
14% alA,alB: (optional) stationary vectors at arrival epochs
17% d: squared L2 distance
19if nargin<5, alB=map_pie(MAPB); end
20if nargin<4, alA=map_pie(MAPA); end
21d = map_exp_mul_int(MAPA,MAPA,L+1,alA,alA) ...
22 - 2*map_exp_mul_int(MAPA,MAPB,L+1,alA,alB) ...
23 + map_exp_mul_int(MAPB,MAPB,L+1,alB,alB);