alg_EG: Exponential Gradient Algorithm (UP)

Description Usage Arguments Value Note References Examples

Description

computes the Exponential Gradient Algorithm by Helmbold et al., 1998

Usage

1
alg_EG(returns, eta)

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).

eta

learning rate

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

Helmbold, D. P.; Schapire, R. E.; Singer, Y. & Warmuth, M. K., On-Line Portfolio Selection Using Multiplicative Updates, Mathematical Finance, Blackwell Publishers Inc, 1998, 8, 325-347

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# load data
data(NYSE)
# select stocks
returns = cbind(kinar=NYSE$kinar, iroqu=NYSE$iroqu)

# compute Exponential Gradient algorithm
EG = alg_EG(returns, eta=0.05)

# plot portfolio wealth
plot(EG)
# plot portfolio weights of kinar
plot(EG$Weights[,1], type="l")

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