LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
map_optim_dist_acf.m
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.
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: 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
15%
16% Output:
17% B1: optimal D1 matrix
18% d: minimum distance achieved
19
20NB = size(B0,1);
21b = sum(-B0,2);
22Aeq = [kron(eye(NB),alB*inv(-B0)) ; kron(ones(1,NB),eye(NB))];
23beq = [alB';b];
24
25 function di = myfun(x)
26 B1x = reshape(x, NB, NB);
27 di = map_dist_acf(MAPA,{B0,B1x},alA,alB);
28 end
29
30warning off;
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);
34warning on;
35d = map_dist_acf(MAPA,{B0,B1},alA,alB);
36end