-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathalg_CWMR.Rd
68 lines (63 loc) · 2.4 KB
/
alg_CWMR.Rd
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
67
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/alg_CWMR.R
\name{alg_CWMR}
\alias{alg_CWMR}
\title{Confidence Weighted Mean Reversion Algorithm (CWMR)}
\usage{
alg_CWMR(returns, phi, epsilon)
}
\arguments{
\item{returns}{Matrix of price relatives, i.e. the ratio of the closing
(opening) price today and the day before (use function
\code{get_price_relatives} to calculate from asset prices).}
\item{phi}{confidence parameter (typical values are 1.28, 1.64, 1.95, 2.57
corresponding to a confidence level of 80\%, 90\%, 95\%, 99\%)}
\item{epsilon}{sensitivity parameter (typically \eqn{\in [0,1]})}
}
\value{
Object of class OLP containing
\item{Alg}{Name of the Algorithm}
\item{Names}{vector of asset names in the portfolio}
\item{Weights}{calculated portfolio weights as a vector}
\item{Wealth}{wealth achieved by the portfolio as a vector}
\item{mu}{exponential growth rate}
\item{APY}{annual percantage yield (252 trading days)}
\item{sigma}{standard deviation of exponential growth rate}
\item{ASTDV}{annualized standard deviation (252 trading days)}
\item{MDD}{maximum draw down (downside risk)}
\item{SR}{Sharpe ratio}
\item{CR}{Calmar ratio}
see also \code{\link{print.OLP}}, \code{\link{plot.OLP}}
}
\description{
computes the Confidence Weighted Mean Reversion algorithm
by Li et al. 2013
}
\details{
Li et al. provide different versions of their CWMR algorithm. The
implemented version is \code{deterministic CWMR-Var}. Also CWMR requires a
normalization step to ensure that the portfolio weights satisfy the
assumptions of on-line portfolio selection (no negative weights). It is
implemented as a simplex projection according to Duchi et al. 2008
(see also \code{\link{projsplx}}).
}
\note{
The print method for \code{OLP} objects prints only a short summary.
}
\examples{
# load data
data(NYSE)
# select stocks
x = cbind(kinar=NYSE$kinar, iroqu=NYSE$iroqu)
# calculate CWMR algorithm
CWMR = alg_CWMR(x, phi=1.96, epsilon=0.5); CWMR
plot(CWMR)
}
\references{
Li, B.; Hoi, S. C. H.; Zhao, P. & Gopalkrishnan, V.
Confidence Weighted Mean Reversion Strategy for Online Portfolio Selection,
ACM, 2013
Duchi, J.; Shalev-Shwartz, S.; Singer, Y. & Chandra, T.
Efficient projections onto the l 1-ball for learning in high dimensions,
Proceedings of the 25th international conference on Machine learning, 2008
}