168 OLPS: A TOOLBOX FOR ONLINE PORTFOLIO SELECTION
• c: similarity threshold;
• λ ∈[0, 1): transaction cost rates; and
• opts: options for behavioral control.
Example Call the B
K
algorithm on the “NYSE (O)” dataset with default parameters
and a transaction cost rate of 0.
1: >> manager(’bk’, ’nyse-o’, {5, 10, 1, 0}, opts);
A.3.4.2 Nonparametric Nearest-Neighbor Log-Optimal Strategy
Description “Nonparametric nearest-neighbor-based sample selection” (B
NN
)
(Györfi et al. 2008) searches the price relatives whose preceding market windows
are within the nearest neighbor of latest market window in terms of Euclidean
distance:
C
N
(x
t
1
,w) ={w<i<t+1 : x
i−1
i−w
is among the NNs of x
t
t−w+1
},
where is a threshold parameter. Then, the strategy obtains an optimal portfolio via
solving Equation A.2.
Usage
bnn(fid, data, {K, L, λ}, opts)
• fid: file handle for writing log file;
• data: market sequence matrix;
• K: maximal window size;
• L: parameter to split the parameter space of each k;
• λ ∈[0, 1): transaction cost rates; and
• opts: options for behavioral control.
Example Call the B
NN
algorithm on the “NYSE (O)” dataset with default
parameters and a transaction cost rate of 0.
1: >> manager(’bnn’, ’nyse-o’, {5, 10, 0}, opts);
A.3.4.3 Correlation-Driven Nonparametric Learning Strategy
“Correlation-driven nonparametric sample selection” (CORN) (Li et al. 2011a)
identifies the similarity among two market windows via a correlation coefficient:
C
C
(x
t
1
,w) =
w<i<t+1 :
cov(x
i−1
i−w
, x
t
t−w+1
)
std(x
i−1
i−w
)std(x
t
t−w+1
)
≥ ρ
!
,
where ρ is a predefined threshold. Then, it obtains an optimal portfolio via solving
Equation A.2.
T&F Cat #K23731 — K23731_A001 — page 168 — 9/28/2015 — 20:46