<div dir="ltr">All,<div><br></div><div>PortfolioAnalytics is not building on R-forge and part of the error message is shown below.</div><div><pre style="margin-top:0px;padding:0px;line-height:11px;color:rgb(68,68,68)">Error: processing vignette ‘risk_budget_optimization.Rnw’ failed with diagnostics:
subscript out of bounds
Execution halted
Run time: 437.89 seconds.</pre></div><div>However, when I run R CMD Check, the R code in the vignettes runs successfully so I am not sure how to address this error or if there is something else I am missing. I also tried building the vignette in Rstudio with the 'compile pdf' button and it compiled successfully. For your reference, I am attaching the 00check.log file.</div>
<div><br></div><div>Ross</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 20, 2014 at 10:48 AM, Doug Martin <span dir="ltr"><<a href="mailto:martinrd@comcast.net" target="_blank">martinrd@comcast.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Got it and will take a look tomorrow or on the weekend.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Doug<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:gsoc-porta-bounces@lists.r-forge.r-project.org" target="_blank">gsoc-porta-bounces@lists.r-forge.r-project.org</a> [mailto:<a href="mailto:gsoc-porta-bounces@lists.r-forge.r-project.org" target="_blank">gsoc-porta-bounces@lists.r-forge.r-project.org</a>] <b>On Behalf Of </b>Ross Bennett<br>
<b>Sent:</b> Thursday, February 20, 2014 11:27 AM<br><b>To:</b> PortfolioAnalytics<br><b>Subject:</b> Re: [GSoC-PortA] Finishing Touches to PortfolioAnalytics<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal">
<u></u> <u></u></p><div><p class="MsoNormal">All,<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I am working on adding functionality to accept a list of portfolio objects for optimize.portfolio and optimize.portfolio.rebalancing.<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I added a block of code at the beginning of optimize.portfolio and optimize.portfolio.rebalancing to detect a list of portfolio objects and then loop through each portfolio in the list of portfolios and recursively call optimize.portfolio or optimize.portfolio.rebalancing. I have a return statement at the end of that block of code. Some frown upon multiple return statements in a function, is it ok that I do this here or is there a different approach I should follow.<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I also added <span style="font-size:8.5pt;font-family:"Menlo","serif"">demo/multiple_portfolio_optimization.R</span> so you can test out the functionality.<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I just committed my changes with r3318.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">
Ross<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p><div><p class="MsoNormal">On Wed, Feb 5, 2014 at 6:54 AM, Ross Bennett <<a href="mailto:rossbennett34@gmail.com" target="_blank">rossbennett34@gmail.com</a>> wrote:<u></u><u></u></p>
<div><p class="MsoNormal">Makes a lot more sense from that perspective to avoid making optimize.portfolio and optimize.portfolio.rebalancing S3 generic methods. I'll proceed as you have outlined.<u></u><u></u></p><div>
<p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thanks for the clarification and guidance.<u></u><u></u></p></div><div><p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p></div>
<div><p class="MsoNormal"><span style="color:#888888">Ross<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p></div></div><div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt">
<u></u> <u></u></p><div><p class="MsoNormal">On Tue, Feb 4, 2014 at 11:29 PM, Brian G. Peterson <<a href="mailto:brian@braverock.com" target="_blank">brian@braverock.com</a>> wrote:<u></u><u></u></p><div><p class="MsoNormal">
On 02/02/2014 10:25 PM, Ross Bennett wrote:<u></u><u></u></p></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><p class="MsoNormal"> Enhance the print and summary methods for<br>
optimize.portfolio.rebalancing. Currently, a list of<u></u><u></u></p></div><p class="MsoNormal"> optimize.portfolio objects at each rebalance period is returned.____<br><br> */[Doug] So does that imply one can now input a list of portfolio<u></u><u></u></p>
<div><p class="MsoNormal"><br> optimization strategy objects to “optimize.portfolio.rebalancing”,<br> e.g., each with different constraints and different objectives?<u></u><u></u></p></div><p class="MsoNormal"> (this would be very useful)/*<u></u><u></u></p>
<div><p class="MsoNormal"><br><br><br>No, that is currently not possible, but should not be too hard to<br>implement. I could do this for optimize.portfolio as well. I think the<br>most robust way to implement this would be to make optimize.portfolio()<br>
and optimize.portfolio.rebalancing() generic methods.<br><br>This would require a few minor design changes and I don't think it would<br>break backwards compatibility. We would have to change the order of<br>arguments for optimize.portfolio() and optimize.portfolio.rebalancing()<br>
so that 'portfolio' is the first argument, currently 'R' is the first<br>argument.<u></u><u></u></p></div></blockquote><p class="MsoNormal"><br>I think the desired functionality (take a list of portfolio objects) is a good idea.<br>
<br>I don't think relying on S3 dispatch and making optimize.portfolio.* into S3 generics makes sense though.<br><br>I say this because there's far too much shared code. The sub-functions for the different optimizer methods and special cases are far less code than the wrapper/framework function. I wouldn't want to duplicate all that code, or add a bunch of extra function calls in code that's called lots and lots of times.<br>
<br>Also, I *really* hate breaking backwards compatibility by rearranging arguments unless there's a compelling reason. For R generics like print/plot/summary, using S3 dispatch is the obvious and only answer, but for optimize.portfolio.*, I'd say leaving the arguments list alone makes the most sense.<br>
<br>I think you could add the loop over portfolio specification list elements (if it is a list) and collection of the results into a list of optimization results into the optimize.portfolio.* functions without too much work, and without breaking existing code.<br>
<br>Regards,<br><br>Brian<span style="color:#888888"><br><br>-- <br>Brian G. Peterson<br><a href="http://braverock.com/brian/" target="_blank">http://braverock.com/brian/</a><br>Ph: <a href="tel:773-459-4973" target="_blank">773-459-4973</a><br>
IM: bgpbraverock</span><u></u><u></u></p><div><div><p class="MsoNormal"><br>_______________________________________________<br>GSoC-PortA mailing list<br><a href="mailto:GSoC-PortA@lists.r-forge.r-project.org" target="_blank">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><u></u><u></u></p></div></div></div><p class="MsoNormal">
<u></u> <u></u></p></div></div></div></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div><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>
<br></blockquote></div><br></div>