-
Notifications
You must be signed in to change notification settings - Fork 1
/
D_objective.m
45 lines (33 loc) · 942 Bytes
/
D_objective.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function fD = D_objective(X, D, a, N, d)
sum_dist = 0;
for i = 1:N
for j= i+1:N
if D(i,j) == 1
d_ij = X(i,:) - X(j,:); % difference between 'i' and 'j'
dist_ij = distance1(a, d_ij);
sum_dist = sum_dist + dist_ij;
end
end
end
fD = gF2(sum_dist);
% __________cover function 1_________
function fD = gF1(sum_dist)
% gF1(y) = y
fD = sum_dist;
function fD = gF2(sum_dist)
% gF1(y) = log(y)
fD = log(sum_dist);
function dist_ij = distance1(a, d_ij)
% distance: distance(d) = L1
fudge = 0.000001;
dist_ij = sqrt((d_ij.^2)*a);
function dist_ij = distance2(a, d_ij)
% distance using distance2: distance(d) = sqrt(L1)
fudge = 0.000001;
dist_ij = ((d_ij.^2)*a)^(1/4);
function dist_ij = distance3(a, d_ij)
% distance using distance3: 1-exp(-\beta*L1)
fudge = 0.000001;
beta = 0.5;
L1 = sqrt((d_ij.^2)*a);
dist_ij = 1 - exp(-beta*L1);