-
Notifications
You must be signed in to change notification settings - Fork 0
/
CDFtests.m
64 lines (53 loc) · 2.44 KB
/
CDFtests.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
sqn = sqrt(length(SCCgrid));
for i=18:23,
diff = JointCDF(:,1)-JointCDF(:,i);
ffid = JointCDF(:,i)-JointCDF(:,1);
KS(i-17) = kolmcdf(sqn*max(abs(diff)));
K(i-17) = kolmcdf(sqn*(max(diff)+max(ffid))/2);
end
%% Filter 18-23 are periods, 1 = null, regardless of discount rate
res = [5,10,20,50,100];
for j=1:5,
for i=18:23,
[ks KC(i-17,j)] = ksdtest(JointCDF(:,i),JointCDF(:,1),res(j));
end
end
columnLabels = {'5', '10', '20','50', '100'};
rowLabels = {'1982-1995','1996-2001','2002-2006','2007-2013','2014-2017','2018-2021'};
matrix2latex(KC, 'ks.tex', 'rowLabels', rowLabels, 'columnLabels', columnLabels, 'alignment', 'c', 'format', '%-6.4f', 'size', 'normal');
% Filter 24-29 are periods, PRTP = 3, 2 = null
for j=1:5,
for i=24:29,
[ks KC3(i-23,j)] = ksdtest(JointCDF(:,i),JointCDF(:,2),res(j));
end
end
columnLabels = {'5', '10', '20','50', '100'};
rowLabels = {'1982-1995','1996-2001','2002-2006','2007-2013','2014-2017','2018-2021'};
matrix2latex(KC3, 'ks3.tex', 'rowLabels', rowLabels, 'columnLabels', columnLabels, 'alignment', 'c', 'format', '%-6.4f', 'size', 'normal');
% Filter 30-35 are periods, PRTP = 2, 3 = null
for j=1:5,
for i=30:35,
[ks KC2(i-29,j)] = ksdtest(JointCDF(:,i),JointCDF(:,3),res(j));
end
end
columnLabels = {'5', '10', '20','50', '100'};
rowLabels = {'1982-1995','1996-2001','2002-2006','2007-2013','2014-2017','2018-2021'};
matrix2latex(KC2, 'ks2.tex', 'rowLabels', rowLabels, 'columnLabels', columnLabels, 'alignment', 'c', 'format', '%-6.4f', 'size', 'normal');
% Filter 36-41 are periods, PRTP = 1, 5 = null
for j=1:5,
for i=36:41,
[ks KC1(i-35,j)] = ksdtest(JointCDF(:,i),JointCDF(:,5),res(j));
end
end
columnLabels = {'5', '10', '20','50', '100'};
rowLabels = {'1982-1995','1996-2001','2002-2006','2007-2013','2014-2017','2018-2021'};
matrix2latex(KC1, 'ks1.tex', 'rowLabels', rowLabels, 'columnLabels', columnLabels, 'alignment', 'c', 'format', '%-6.4f', 'size', 'normal');
% Filter 42-47 are periods, PRTP = 0, 7 = null
for j=1:5,
for i=42:47,
[ks KC0(i-41,j)] = ksdtest(JointCDF(:,i),JointCDF(:,7),res(j));
end
end
columnLabels = {'5', '10', '20','50', '100'};
rowLabels = {'1982-1995','1996-2001','2002-2006','2007-2013','2014-2017','2018-2021'};
matrix2latex(KC0, 'ks0.tex', 'rowLabels', rowLabels, 'columnLabels', columnLabels, 'alignment', 'c', 'format', '%-6.4f', 'size', 'normal');