1function [D1B,d] = dmap_optim_dist_acf(DMAPA,alA,D0B,alB)
2% [D1B,d]=dmap_optim_dist_acf(DMAPA,alA,D0B,alB) - Find D1B minimizing the
3% autocorrelation function distance, given fixed D0B.
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.
10% Discrete-time extension by QORE Lab (https:
13% DMAPA: reference D-MAP in the form of {D0,D1}
14% alA: stationary vector at arrivals for DMAPA
15% D0B: D0 matrix of the approximating D-MAP (fixed)
16% alB: stationary vector at arrivals for the approximating D-MAP
19% D1B: optimal D1 matrix
20% d: minimum distance achieved
25Aeq = [kron(eye(NB),alB*inv(IB-D0B)) ; kron(ones(1,NB),eye(NB))];
28 function di = myfun(x)
29 D1Bx = reshape(x, NB, NB);
30 di = dmap_dist_acf(DMAPA,{D0B,D1Bx},alA,alB);
34options = optimset('Display
','off
');
35[vD1B, d] = fmincon(@myfun, rand(NB*NB,1), [], [], Aeq, beq, 1e-6*ones(NB*NB,1), [], [], options);
36D1B = reshape(vD1B, NB, NB);
38d = dmap_dist_acf(DMAPA,{D0B,D1B},alA,alB);