[GSoC-PortA] RP issue?
Ross Bennett
rossbennett34 at gmail.com
Mon Sep 23 08:37:20 CEST 2013
Peter,
See comments in line
On Sun, Sep 22, 2013 at 7:18 PM, Peter Carl <peter at braverock.com> wrote:
> Ok, I'm now up to revision 3170.
>
> ### Construct BUOY 5: Constrained Equal Variance Contribution Portfolio -
> using RP
> EqSD.portf <- add.objective(portfolio=init.portf,
> type="risk_budget",
> name="StdDev",
> enabled=TRUE,
> min_concentration=TRUE,
> arguments = list(p=(1-1/12), clean=clean)
> )
> # Without a sub-objective, we get a somewhat undefined result, since there
> are (potentially) many Equal SD contribution portfolios.
> EqSD.portf <- add.objective(portfolio=EqSD.portf,
> type="risk",
> name="StdDev"
> )
> EqSD.portf$constraints[[1]]$min_sum = 0.99 # set to speed up RP
> EqSD.portf$constraints[[1]]$max_sum = 1.01
>
>
> Now I'm evaluating it:
> > EqSD.RND<-optimize.portfolio(R=R,
> + portfolio=EqSD.portf,
> + optimize_method='random',
> + search_size=1000, trace=TRUE
> + )
> Warning message:
> In constrained_objective(w = min_objective_weights, R = R, portfolio =
> portfolio, :
> some arguments stored for StdDev do not match
>
> I'm not sure why I'd get that warning... or maybe I'm not understanding
> the meaning of the message.
>
I believe you are getting that warning because p is not a formal argument
for StdDev.
>
> > plot(EqSD.RND, risk.col="StdDev", return.col="mean", rp=permutations,
> chart.assets=TRUE, main="Equal Volatility Contribution Portfolio")
> There were 13 warnings (use warnings() to see them)
> > warnings()
> Warning messages:
> 1: In chart.Scatter.RP(object = RP, risk.col = risk.col, ... :
> mean or StdDev do not match extractStats output of $objective_measures
> slot
>
You are getting this message because mean is not an objective, so we are
calculating mean to plot in mean-StdDev space.
>
> That's probably a repeat of the above message.
>
> Then this chart broke:
>
> > chart.RiskBudget(EqSD.RND)
> Error in contrib[[idx[ii]]] : attempt to select less than one element
>
I ran the script and noticed that EqSD.RND does not have the component
StdDev in the $objective_measures slot. I'm not sure why this is, but I'll
look into it tomorrow.
>
> Thanks,
>
> pcc
> --
> Peter Carl
> http://www.braverock.com/peter
>
>
> _______________________________________________
> GSoC-PortA mailing list
> GSoC-PortA at lists.r-forge.r-project.org
> http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/gsoc-porta
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/gsoc-porta/attachments/20130922/b9f9616a/attachment.html>
More information about the GSoC-PortA
mailing list