LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
dmap_optim_dist_acf.m
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.
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: 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
17%
18% Output:
19% D1B: optimal D1 matrix
20% d: minimum distance achieved
21
22NB = size(D0B,1);
23IB = eye(NB);
24b = sum(IB-D0B, 2);
25Aeq = [kron(eye(NB),alB*inv(IB-D0B)) ; kron(ones(1,NB),eye(NB))];
26beq = [alB';b];
27
28 function di = myfun(x)
29 D1Bx = reshape(x, NB, NB);
30 di = dmap_dist_acf(DMAPA,{D0B,D1Bx},alA,alB);
31 end
32
33warning off;
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);
37warning on;
38d = dmap_dist_acf(DMAPA,{D0B,D1B},alA,alB);
39end