[R-SIG-Finance] Return.rebalancing contemporaneous calculation

Ross Bennett rossbennett34 at gmail.com
Wed Oct 15 03:09:20 CEST 2014


Charles,

Thank you for the minimal reproducible example. It appears there is an
issue with the date indexing based on an assumption I made. I will fix and
push to R-Forge by the end of the week.

Regards,
Ross


On Tue, Oct 14, 2014 at 4:09 PM, Charles Duranceau <cduranceau at nial.ky>
wrote:

> Hello Brian,
> Thank you for your feedback.
>
> Version Info:
> platform       x86_64-w64-mingw32
> arch           x86_64
> os             mingw32
> system         x86_64, mingw32
> status
> major          3
> minor          1.0
> year           2014
> month          04
> day            10
> svn rev        65387
> language       R
> version.string R version 3.1.0 (2014-04-10)
> nickname       Spring Dance
>
> Package:
>  "PerformanceAnalytics" VERSION 1.4.3541 from CRAN   ----
> project.org/bin/windows/contrib/3.1/PerformanceAnalytics_1.4.3541.zip
>
> Here's a detailed example:
>
> # Define Returns
>
> mret=data.frame(ra=c(0.1,0.11,0.09),rb=c(0.25,0.2,-0.4),rc=c(0.15,0.12,0.02))
> time_index<-seq(as.Date("2003/05/01"), by = "month", length.out = 3)-1
>          # last day of the month
> mret<-as.xts(mret,time_index)
> weight_constant<-c(0.5,0.2,0.3)
> ret_pfolio<-Return.portfolio(mret,weight_constant,geometric = FALSE)
>
>
> weight_reb<-t(matrix(weight_constant,3,3))
> weight_reb<-as.xts(weight_reb,time_index)
>                                 # fixed for the analysis
> ret_rebal<-Return.rebalancing(mret,weight_reb,geometric = FALSE)
>
> cbind(ret_pfolio,ret_rebal)
>
>
>
> Thank you
> Best Regards
>
> -----Original Message-----
> From: r-sig-finance-bounces at r-project.org [mailto:
> r-sig-finance-bounces at r-project.org] On Behalf Of Brian G. Peterson
> Sent: Wednesday, October 08, 2014 3:33 PM
> To: r-sig-finance at r-project.org
> Subject: Re: [R-SIG-Finance] Return.rebalancing contemporaneous calculation
>
> On 10/08/2014 03:24 PM, Charles Duranceau wrote:
> > Hi,
> > I'm working with "PerformanceAnalytics" for calculating portfolio
> returns using the function Return.rebalancing. I don't understand why the
> results - portfolio returns - are lagged by 1 period when compared to
> Return.portfolio (assuming weight are time invariant).
> >
> > I read the definition that explain the rebalancing is taken place in the
> next period but since the input are returns (like in  Return.portfolio)
> they should be consolidated on same period.
> > Is there a way not losing the first input?
> >
> > Here few lines to illustrate my question
> >
> > pfmf2003<-Return.rebalancing(mfr2003,wghts1)
> > pfstat<-Return.portfolio(mfr2003,c(1,0))
> > ** wghts1 = 1 for the period
> >
> > Results
> >                          portfolio.Rebal       portfolio.returns.
> > 2003-05-31      0.0087336245         0.203679369
> > 2003-06-30      0.1093073593         0.008733624
> > 2003-07-31     -0.0351219512         0.109307359
> > 2003-08-31     -0.0404448938        -0.035121951
> > 2003-09-30     -0.0063224447        -0.040444894
>
> Return.portfolio and Return.rebalancing are the same function in current
> CRAN version, and have been in the R-Forge version for quite a while.
>
> Can you give us your sessionInfo, and a fully reproducible example?
>
> Brian
>
> --
> Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list