x <- diff(log(EuStockMarkets)) # stock returns
s <- colMeans(x) # it could be any signal
##################
### Simple EPO ###
##################
# Traditional Mean-Variance Analysis
epo(x = x, signal = s, lambda = 10, method = "simple", w = 0)
# 100% Shrinkage
epo(x = x, signal = s, lambda = 10, method = "simple", w = 1)
# 50% Classical MVO and 50% Shrinkage
epo(x = x, signal = s, lambda = 10, method = "simple", w = 0.5)
####################
### Anchored EPO ###
####################
benchmark <- rep(0.25, 4) # 1/N Portfolio
# Traditional Mean-Variance Analysis
epo(x = x, signal = s, lambda = 10, method = "anchored", w = 0.0, anchor = benchmark)
# 100% on the Anchor portfolio
epo(x = x, signal = s, lambda = 10, method = "anchored", w = 1.0, anchor = benchmark)
# Somewhere between the two worlds
epo(x = x, signal = s, lambda = 10, method = "anchored", w = 0.5, anchor = benchmark)
Run the code above in your browser using DataLab