LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
dmap_dist_acf.m
1function d = dmap_dist_acf(DMAPA,DMAPB,alA,alB)
2% d=dmap_dist_acf(DMAPA,DMAPB,alA,alB) - Squared L2 distance between the
3% autocorrelation functions of two discrete-time MAPs.
4%
5% Reference (continuous-time formulation):
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% Discrete-time extension by QORE Lab (https://qore.doc.ic.ac.uk/)
11%
12% Input:
13% DMAPA: first D-MAP in the form of {D0,D1}
14% DMAPB: second D-MAP in the form of {D0,D1}
15% alA,alB: (optional) stationary vectors at arrival epochs
16%
17% Output:
18% d: squared L2 distance of autocorrelation functions
19
20D0A=DMAPA{1}; D0B=DMAPB{1};
21NA = size(D0A,1); NB = size(D0B,1);
22if nargin<4, alB=dtmc_solve(inv(eye(NB)-D0B)*DMAPB{2}); end
23if nargin<3, alA=dtmc_solve(inv(eye(NA)-D0A)*DMAPA{2}); end
24
25momA = dmap_moment(DMAPA, [1 2]);
26momB = dmap_moment(DMAPB, [1 2]);
27mA = momA(1); mB = momB(1);
28varA = momA(2)-mA^2;
29varB = momB(2)-mB^2;
30
31d = (dmap_geo_mul_sum(DMAPA,DMAPA,alA,alA) - momA(2)^2/4) / varA^2 ...
32 - 2*(dmap_geo_mul_sum(DMAPA,DMAPB,alA,alB) - momA(2)*momB(2)/4) / varA / varB ...
33 + (dmap_geo_mul_sum(DMAPB,DMAPB,alB,alB) - momB(2)^2/4) / varB^2;
34end