[R-SIG-Finance] Parma / MAxReward Portfolio

Kads Bennurkar blinkychinky at yahoo.com
Thu Jul 9 03:03:47 CEST 2015


That worked! Thank you so much Alexios. 
I had tried risktype="minrisk" and I had also tried parmafrontier(spec, n.points = 100) but it kept giving me errors. But it ran this time. 
Thank you again for your prompt response! This is very helpful. 
Best, Kads 


     On Wednesday, July 8, 2015 4:32 PM, alexios <alexios at 4dscape.com> wrote:
   

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



  
	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list