1function [B1,d] = map_optim_dist_acf(MAPA,alA,B0,alB)
2% [B1,d]=map_optim_dist_acf(MAPA,alA,B0,alB) - Find B1 minimizing the
3% autocorrelation function distance, given fixed B0.
6% G. Horvath,
"Measuring the distance between MAPs and some
7% applications," in Proc. ASMTA 2015, LNCS 9081, pp. 95-109.
11% MAPA: reference MAP in the form of {D0,D1}
12% alA: stationary vector at arrivals
for MAPA
13% B0: D0 matrix of the approximating MAP (fixed)
14% alB: stationary vector at arrivals
for the approximating MAP
17% B1: optimal D1 matrix
18% d: minimum distance achieved
22Aeq = [kron(eye(NB),alB*inv(-B0)) ; kron(ones(1,NB),eye(NB))];
25 function di = myfun(x)
26 B1x = reshape(x, NB, NB);
27 di = map_dist_acf(MAPA,{B0,B1x},alA,alB);
31options = optimset('Display
','off
');
32[vB1, d] = fmincon(@myfun, rand(NB*NB,1), [], [], Aeq, beq, 1e-6*ones(NB*NB,1), [], [], options);
33B1 = reshape(vB1, NB, NB);
35d = map_dist_acf(MAPA,{B0,B1},alA,alB);