PortfolioAnalytics question re: showing results
On Mon, 2016-03-21 at 07:42 -0500, matt at considine.net wrote:
In running the chart.RiskReward code, the "Optimal" portfolio is being plotted in the middle of the feasible portfolio set. Why would that be happening? Or is it because I am using customized risk/return calcs and the corresponding values for the optimal portfolio are not being scaled?
If the optimal portfolio was calculated with the objectives that agree with your axes, it should be on the outer hull of the feasible space. If, however, the optimal portfolio was calculated with different objectives or constraints, then it may indeed be inside the overall feasible space. The addition or constraints or additional objectives will shrink the feasible space. This is why comparing the efficient frontiers of portfolios built with different objectives and constraints will alway sweep out a smaller area for the more constrained portfolios. It is also why if you plot a mean-ES objective against a mean-var set of axes that your optimal portfolio may show up inside the feasible cloud.
I tried to get at the underlying plotting code, but the View function returns "uses method chart.RiskReward". Is there an easy way to see and edit that underlying code? Apologies if the answer to this is incredibly straightforward, but the answer will also help me create versions of the *.EfficientFrontier functions to use with customized risk/return functions
The changes to do what you want to do may be rather simple. chart.EfficientFrontier should be modified to take a risk.col and a return.col argument. The same should happen to the extractEfficientFrontier function and its methods. Most of the underlying code lives in a non-exported function called extract.efficient.frontier All of these functions live in file extract.efficient.frontier.R It would be simplest to work from the original source file from svn, since that is commented. the code you look at from inside R will have the comments stripped out. If you don't make any progress on this, it is now on our list to improve based on your questions, but I don't know when we'll get to it. Regards, Brian.
Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock