<div dir="ltr">Peter,<div><br></div><div style>See comments in line</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Sep 22, 2013 at 7:18 PM, Peter Carl <span dir="ltr"><<a href="mailto:peter@braverock.com" target="_blank">peter@braverock.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, I'm now up to revision 3170.<br>
<br>
### Construct BUOY 5: Constrained Equal Variance Contribution Portfolio -<br>
using RP<br>
EqSD.portf <- add.objective(portfolio=init.portf,<br>
type="risk_budget",<br>
name="StdDev",<br>
enabled=TRUE,<br>
min_concentration=TRUE,<br>
arguments = list(p=(1-1/12), clean=clean)<br>
)<br>
# Without a sub-objective, we get a somewhat undefined result, since there<br>
are (potentially) many Equal SD contribution portfolios.<br>
EqSD.portf <- add.objective(portfolio=EqSD.portf,<br>
type="risk",<br>
name="StdDev"<br>
)<br>
EqSD.portf$constraints[[1]]$min_sum = 0.99 # set to speed up RP<br>
EqSD.portf$constraints[[1]]$max_sum = 1.01<br>
<br>
<br>
Now I'm evaluating it:<br>
> EqSD.RND<-optimize.portfolio(R=R,<br>
+ portfolio=EqSD.portf,<br>
+ optimize_method='random',<br>
+ search_size=1000, trace=TRUE<br>
+ )<br>
Warning message:<br>
In constrained_objective(w = min_objective_weights, R = R, portfolio =<br>
portfolio, :<br>
some arguments stored for StdDev do not match<br>
<br>
I'm not sure why I'd get that warning... or maybe I'm not understanding<br>
the meaning of the message.<br></blockquote><div><br></div><div style>I believe you are getting that warning because p is not a formal argument for StdDev.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> plot(EqSD.RND, risk.col="StdDev", return.col="mean", rp=permutations,<br>
chart.assets=TRUE, main="Equal Volatility Contribution Portfolio")<br>
There were 13 warnings (use warnings() to see them)<br>
> warnings()<br>
Warning messages:<br>
1: In chart.Scatter.RP(object = RP, risk.col = risk.col, ... :<br>
mean or StdDev do not match extractStats output of $objective_measures<br>
slot<br></blockquote><div><br></div><div style>You are getting this message because mean is not an objective, so we are calculating mean to plot in mean-StdDev space.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
That's probably a repeat of the above message.<br>
<br>
Then this chart broke:<br>
<br>
> chart.RiskBudget(EqSD.RND)<br>
Error in contrib[[idx[ii]]] : attempt to select less than one element<br></blockquote><div><br></div><div style>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.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
<br>
pcc<br>
<span class="HOEnZb"><font color="#888888">--<br>
Peter Carl<br>
<a href="http://www.braverock.com/peter" target="_blank">http://www.braverock.com/peter</a><br>
<br>
<br>
_______________________________________________<br>
GSoC-PortA mailing list<br>
<a href="mailto:GSoC-PortA@lists.r-forge.r-project.org">GSoC-PortA@lists.r-forge.r-project.org</a><br>
<a href="http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/gsoc-porta" target="_blank">http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/gsoc-porta</a><br>
</font></span></blockquote></div><br></div></div>