alg_CWMR: Confidence Weighted Mean Reversion Algorithm (CWMR)

Description Usage Arguments Details Value Note References Examples

Description

computes the Confidence Weighted Mean Reversion algorithm by Li et al. 2013

Usage

1
alg_CWMR(returns, phi, epsilon)

Arguments

returns

Matrix of price relatives, i.e. the ratio of the closing (opening) price today and the day before (use function get_price_relatives to calculate from asset prices).

phi

confidence parameter (typical values are 1.28, 1.64, 1.95, 2.57 corresponding to a confidence level of 80%, 90%, 95%, 99%)

epsilon

sensitivity parameter (typically \in [0,1])

Details

Li et al. provide different versions of their CWMR algorithm. The implemented version is 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 projsplx).

Value

Object of class OLP containing

Alg

Name of the Algorithm

Names

vector of asset names in the portfolio

Weights

calculated portfolio weights as a vector

Wealth

wealth achieved by the portfolio as a vector

mu

exponential growth rate

APY

annual percantage yield (252 trading days)

sigma

standard deviation of exponential growth rate

ASTDV

annualized standard deviation (252 trading days)

MDD

maximum draw down (downside risk)

SR

Sharpe ratio

CR

Calmar ratio

see also print.OLP, plot.OLP

Note

The print method for OLP objects prints only a short summary.

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

Examples

1
2
3
4
5
6
7
8
# 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)

ngloe/olpsR documentation built on May 23, 2019, 4:42 p.m.