CVaR and Penalty Augmented objective function
Hi Marco, Can you put together a minimal reproducible example [1,2] so that it's easier for others to answer your question? For this problem, I'd recommend using the edhec data distributed with PerformanceAnalytics. Thanks, Michael [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [2] http://adv-r.had.co.nz/Reproducibility.html On Tue, Oct 11, 2016 at 11:46 AM, Marco Mastrangeli
<marco.mastrangeli at gmail.com> wrote:
I have a question about the use of the "mu" parameter in the functions StdDev, VaR e CVaR. As reference data we can use data in the paper "Vignette: Portfolio Optimization with CVaR budgets in PortfolioAnalytics". If we use the default parameters for "mu" and "sigma", there is a match between
constrained_objective( w = rep(1/4,4) , R = indexes, portfolio = ObjSpec)
[,1] ES 0.1253199 and
out<-ES(indexes, weights = rep(1/4,4),p=0.95, portfolio_method="component") out$MES
[,1] [1,] 0.1253199 as explained by the authors. If I insert a user-defined sigma matrix for the "sigma" parameter, the match is still there between this two exspressions. If I insert a user-defined vector for the "mu" parameter (for example "mu=rep(0.01, 4)", the result of the two exspressions is the same only for portafolio with risk objective function StdDev and VaR, not for CVaR. VaR case:
ObjSpec = add.objective(portfolio=Wcons, type="risk", name="VaR",
arguments=list(p=0.95, mu=rep(0.01,4)), enabled=TRUE)
constrained_objective(w=rep(1/4,4), R=indexes, portfolio=ObjSpec)
[,1] VaR 0.04638622
out<-VaR(indexes, weights=rep(1/4,4), p=0.95, mu=rep(0.01,4),
portfolio_method="component")
out
$MVaR
[,1]
[1,] 0.04638622
CVaR case:
ObjSpec = add.objective(portfolio=Wcons, type="risk", name="CVaR",
arguments=list(p=0.95, mu=rep(0.01,4)), enabled=TRUE)
constrained_objective(w=rep(1/4,4), R=indexes, portfolio=ObjSpec)
[,1] ES 0.1217594
out<-ES(indexes, weights=rep(1/4,4), p=0.95, mu=rep(0.01,4),
portfolio_method="component")
out
$MES
[,1]
[1,] 0.1235878
I can't find the explanation for this thing. Thanks a lot for your
attention.
Marco
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.