[GSoC-PortA] Finishing Touches to PortfolioAnalytics

Brian G. Peterson brian at braverock.com
Wed Feb 5 12:15:47 CET 2014


RE: summary method

On 02/02/2014 10:25 PM, Ross Bennett wrote:
>     I'd like to change this to also return the R object so that I can do
>     more with a summary method such as calculating the portfolio
>     rebalanced returns, annualized return, risk measures, etc.____
>
>     */[Doug] I guess there is the question of how much in the way of
>     performance analysis gets done with a summary method, as compared
>     with using PerformanceAnalytics on the result of
>     optimize.portfolio.rebalancing./*
>
>
> The idea is that I would use PerformanceAnalytics to calculate some of
> the metrics. Currently, optimize.portfolio.rebalancing returns a list of
> optimize.portfolio.* objects at each rebalance date. The user would have
> to do the following to calculate the portfolio returns.
>
> opt_backtest <- optimize.portfolio.rebalancing(R, portfolio, ...)
> portfolio_ret <- Return.rebalancing(R, extractWeights(opt_backtest))
>
> I think it would be useful to calculate the portfolio returns in the
> summary method so the user would just have to do something like
>
> summary(opt_backtest)$portfolio_returns
>
> At a minimum the summary method would return the following:
> - optimal weights at each rebalance date
> - objective measures at each rebalance date
> - portfolio returns
> - portfolio annualized returns

I generally like this idea.

In S, the summary method was supposed to return an object with 
standardized slots that other functions then knew how to manipulate.

In R, many package authors seems to confuse print and summary methods. 
In reality, in many cases, a print method should call the summary 
method, then display some of that information.  In other cases with 
particularly complex summary methods, I've seen print methods just for 
the summary objects.  In practice most of the time, I think the first 
approach makes more sense.

I don't think you really need to add standardized performance measures 
though.

The user will have things that they want, some measure of return, some 
measure of risk, etc.  If we collect these all in a standardized extract 
object, the user should be thrilled.  I don't really think the user will 
care about extras, or they could have included them, or can trivially 
calculate the ones they care about themselves via PerformanceAnalytics.

Regards,

Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock


More information about the GSoC-PortA mailing list