-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAthens_2.m
47 lines (35 loc) · 1007 Bytes
/
Athens_2.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
46
47
%% Exercise 1
d_all = [];
lambda_all = [];
for i = 3:6
[lambda, d, snr] = Athens_exercise2_1(10 ^ (-1 * i), .9, 6);
d_all = [d_all; [d]];
lambda_all = [lambda_all; [lambda]];
fprintf('%1.4f\t%1.4f\t%1.4f\n', lambda, d, snr)
end
%% Exercise 2
for i = 3:6
C = [0, 3; 2, 0];
Risk = Athens_exercise2_2(.2, .8, .9, 10 ^ (-1 * i), C);
fprintf('%1.4f\n', Risk)
end
%% Exercise 3
for i = 1:numel(d_all)
C = [0, 3; 2, 0];
[gamma, Pd, Pf, Risk] = Athens_exercise2_3(d_all(i), P0, P1, C);
fprintf('%1.4f\t%1.4f\t%1.4f\t%1.4f\n', gamma, Pd, Pf, Risk)
end
%% Exercise 4
for i = 1:numel(d_all)
C = [0, 3; 2, 0];
[P0, P1] = Athens_exercise2_4(lambda_all(i), d_all(i), C);
fprintf('%1.4f\t%1.4f\n', P1, P0)
end
%% Exercise 5
P0s = [.9874, .9985, .9998, 1];
P1s = 1 - P0s;
for i = 1:numel(d_all)
C = [0, 3; 2, 0];
[gamma, Pd, Pf, Risk] = Athens_exercise2_3(d_all(i), P0s(i), P1s(i), C);
fprintf('%1.4f\t%1.4f\t%1.4f\t%1.4f\n', gamma, Pd, Pf, Risk)
end