Description Usage Arguments Value Examples
View source: R/OSminimax_one.R
Adjust the optimal Markowitz Portfolio rule according to model 1.2.2 of Garlappi, Uppal & Wang (2008, RFS) According tom the model, we use the minimax rule of Gilboa & Schmeidler (1989) to use the worst (min/inf) of all possible priors for the calculation of the optimal portfolio rule. Uncertainty about expected returns estimated jointly for all assets This coefficient explains how much to move out of the provided factor towards the risk-free rate or (if using the model without the risk-free rate) towards the global Minimum-Variance portfolio The measure of current uncertainty is based on Stöckl (2019, WP)
1 2 3 4 5 6 7 8 9 10 11 |
X |
the dataset X in xts format (if not, the program will try to convert it to xts) |
weights |
optional, can either be a vector (in which case it will be used for each row and must match ncol(X)) or a matrix with the same dimension as X if weights=NULL (the default), equal weights will be generated based on the number of columns (CHECK no of non NA entries per row) |
method |
optional, if a robust mean/covariance estimator should be used c("cov", "mve", "mcd", "MCD", "OGK", "nnve", "shrink", "bagged") |
s.k |
optional, lookback window for current observations that are related to the long-term mean |
imp |
optional, should missing values be imputed? (standard: FALSE) |
rf |
optional, should the case with (default) or without a risk-free rate be used (the latter case is not implemented) |
rolling |
optional, Should moments be calculated based on a rolling window? |
roll.obs |
optional, rolling=TRUE: Length of rolling window; rolling=FALSE: Initial estimation window size |
NOUT |
optional, if the epsilons are needed as input for a multi-uncertainty portfolio, supply the number of assets per uncertainty group here |
xts/vector - sturb: how much should be invested in the provided index, given its Sharpe-ratio, turbulence (paremeter uncertainty) and investors risk-aversion - epsilon: Level of parameter uncertainty
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | require(xts)
data(X)
sturb1 <- OSminimax_one(X, s.k=1, rolling=TRUE, roll.obs=36)$sturb
sturb2 <- OSminimax_one(X,s.k=12, rolling=TRUE, roll.obs=36)$sturb
sturb3 <- OSminimax_one(X,s.k=12, rolling=FALSE, roll.obs=36)$sturb
plot(sturb1, lwd=2, main="Portfolio Adjustment coefficient with risk-free rate",ylim=c(-0.1,1))
lines(sturb2,lwd=2,col="red", main="Portfolio Adjustment coefficient based on turbulence with 12 month lookback period",on=NA,ylim=c(-0.1,1))
lines(sturb3,lwd=2,col="blue", main="Portfolio Adjustment coefficient based on turbulence with 12 month lookback period and robust MCD estimator",on=NA,ylim=c(-0.1,1))
# relation between in-sample and out-of-sample
isturb <- ISminimax_one(X, s.k=12)
osturb <- OSminimax_one(X, s.k=12, rolling=FALSE, roll.obs=100)
plot(cbind(isturb$sturb,osturb$sturb),col=c("black","red"),main="In-sample and out-of-sample turbulence")
lines(cbind(isturb$epsilon,osturb$epsilon),col=c("black","red"),main="In-sample and out-of-sample epsilon",on=NA)
isturb1 <- ISminimax_one(Y, s.k=12)
osturb1 <- OSminimax_one(Y, s.k=12, rolling=FALSE, roll.obs=100)
plot(cbind(isturb$sturb,isturb1$sturb),col=c("black","red"),main="In-sample turbulence for X and Y")
lines(cbind(osturb$sturb,osturb1$sturb),col=c("black","red"),main="Out-of-sample turbulence for X and Y",on=NA,ylim=c(-0.05,1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.