-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_SR_Arman.m
66 lines (47 loc) · 2.22 KB
/
prepare_SR_Arman.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
65
66
function prepare_SR_Arman(outperf_SR,underperf_SR,pi_aplus,pi_aminus)
% INPUT PARAMETERS:
if nargin<1
outperf_SR = 4;
underperf_SR = -3;
pi_aplus = .2;
pi_aminus = .3;
end
%%%%%%%%%%%%%%%%%
load('MCSAMPLE_Arman.mat')
AA = MCRET;
nbstrats = size(MCRET,2); %21195
nbdays = size(MCRET,1); %130
nboutperf = round(nbstrats * pi_aplus);
nbunderperf = round(nbstrats * pi_aminus);
idx = 1:600;
[AA_os, nb_outperf_os, nb_underperf_os, nb_null_os] = preparadata_auxfun_SR(AA(:, idx), ...
outperf_SR, underperf_SR, pi_aplus, pi_aminus);
idx = 601:3435;
[AA_fr, nb_outperf_fr, nb_underperf_fr, nb_null_fr] = preparadata_auxfun_SR(AA(:, idx), ...
outperf_SR, underperf_SR, pi_aplus, pi_aminus);
idx = 3436:16305;
[AA_ma, nb_outperf_ma, nb_underperf_ma, nb_null_ma] = preparadata_auxfun_SR(AA(:, idx), ...
outperf_SR, underperf_SR, pi_aplus, pi_aminus);
idx = 16306:18195;
[AA_sr, nb_outperf_sr, nb_underperf_sr, nb_null_sr] = preparadata_auxfun_SR(AA(:, idx), ...
outperf_SR, underperf_SR, pi_aplus, pi_aminus);
idx = 18196:21195;
[AA_cb, nb_outperf_cb, nb_underperf_cb, nb_null_cb] = preparadata_auxfun_SR(AA(:, idx), ...
outperf_SR, underperf_SR, pi_aplus, pi_aminus);
AA_final = [AA_os(:, 1:nb_outperf_os)...
AA_fr(:, 1:nb_outperf_fr)...
AA_sr(:, 1:nb_outperf_sr) ...
AA_cb(:, 1:nb_outperf_cb)...
AA_ma(:, 1:nb_outperf_ma) ...
AA_os(:, (nb_outperf_os + 1):(nb_outperf_os + nb_underperf_os))...
AA_fr(:, (nb_outperf_fr + 1):(nb_outperf_fr + nb_underperf_fr))...
AA_ma(:, (nb_outperf_ma + 1):(nb_outperf_ma + nb_underperf_ma)) ...
AA_sr(:, (nb_outperf_sr + 1):(nb_outperf_sr + nb_underperf_sr)) ...
AA_cb(:, (nb_outperf_cb + 1):(nb_outperf_cb + nb_underperf_cb))...
AA_os(:, (nb_outperf_os + nb_underperf_os + 1):end)...
AA_fr(:, (nb_outperf_fr + nb_underperf_fr + 1):end)...
AA_ma(:, (nb_outperf_ma + nb_underperf_ma + 1):end)...
AA_sr(:, (nb_outperf_sr + nb_underperf_sr + 1):end)...
AA_cb(:, (nb_outperf_cb + nb_underperf_cb + 1):end)];
save(['AA_final_' num2str(100*pi_aplus) '_' num2str(100*pi_aminus) '_SR_'...
num2str(100*outperf_SR) '_' num2str(100*(-underperf_SR)) '.mat'], 'AA_final')