[R-SIG-Finance] Parma / MAxReward Portfolio
alexios
alexios at 4dscape.com
Wed Jul 8 23:32:26 CEST 2015
Why don't you use riskType="minrisk"? They are equivalent!
And parma in any case only uses the minrisk.
...but, when in doubt:
library(xts)
data("etfdata")
R = etfdata/lag(etfdata)-1
R = na.omit(R)
S = cov(coredata(R))
LB = rep(0, 15)
UB = rep(1, 15)
fmu = colMeans(coredata(R))
spec = parmaspec(S = S, forecast = fmu, target = NULL, LB = LB, UB = UB,
risk = "EV", riskType = "minrisk", targetType = "equality",budget = 1)
frontqp = parmafrontier(spec, n.points = 100)
riskB = sqrt(frontqp[,"EV"])
rewardQP = frontqp[,"reward"]
rewardSOCP = rep(0, 100)
control=list(abs.tol = 1e-8, rel.tol = 1e-8, Nu=4, max.iter=1250,
BigM.K = 4, BigM.iter = 15)
for(i in 1:100){
spec = parmaspec(S = S, forecast = fmu, target = NULL, LB = LB, UB = UB,
riskB = riskB[i], risk = "EV", riskType = "maxReward", targetType =
"equality",budget = 1)
tmp<-parmasolve(spec, solver="SOCP",solver.control=control)
rewardSOCP[i]=parmareward(tmp)
}
par(mfrow=c(2,1))
plot(rewardQP)
lines(rewardSOCP, col=2)
plot(riskB, rewardQP)
lines(riskB, rewardSOCP, col=2)
-Alexios
On 08/07/2015 21:47, Kads Bennurkar via R-SIG-Finance wrote:
> Hi,
> I'm trying to generate an efficient frontier for a MaxReward portfolio and get the weights of the portfolios lying on the efficient frontier.
> So far I have been able to get a maxReward portfolio using Parma package. However, I keep getting error while trying to generate an Efficient Frontier.
> codes:data(etfdata)R = ROC(etfdata, na.pad=FALSE)riskB = (15^2)/12spec <- parmaspec(S = as.matrix(cov(R1)), riskB=riskB,risk="EV",riskType="maxreward", LB = rep(0.05,15), UB = rep(0.35,15), budget=1, forecast=as.numeric(colMeans(R1)))port <- parmasolve(spec, solver="SOCP"); port
>
> Issue: parmafrontier(spec, n.points = 100, solver="SOCP")
>
>
> Thanks!
>
> [[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.
>
More information about the R-SIG-Finance
mailing list