Higher frequency contributions provided as a time series are converted to a lower frequency for a specified calendar period.
to.period.contributions(Contributions, period = c("years", "quarters", "months", "weeks", "all"))
Contributions | a time series of the per period contribution to portfolio return of each asset |
---|---|
period | period to convert to. See details. "weeks", "months", "quarters", "years", or "all". |
From the portfolio contributions of individual assets, such as those of a particular asset class or manager, the multiperiod contribution is neither summable from nor the geometric compounding of single-period contributions. Because the weights of the individual assets change through time as transactions occur, the capital base for the asset changes.
Instead, the asset's multiperiod contribution is the sum of the asset's dollar contributions from each period, as calculated from the wealth index of the total portfolio. Once contributions are expressed in cumulative terms, asset contributions then sum to the returns of the total portfolio for the period.
Valid period character strings for period include: "weeks", "months", "quarters", "years", or "all".
These are calculated internally via endpoints
. See that function's help page for further details.
For the special period "all", the contribution is calculated over all rows, giving a single contribution across all observations.
Morningstar, Total Portfolio Performance Attribution Methodology, p.36. Available at http://corporate.morningstar.com/US/documents/MethodologyDocuments/MethodologyPapers/TotalPortfolioPerformanceAttributionMethodology.pdf
Return.portfolio
endpoints
data(managers, package="PerformanceAnalytics") res_qtr_rebal = Return.portfolio( managers["2002::",1:5] , weights=c(.05,.1,.3,.4,.15) , rebalance_on = "quarters" , verbose=TRUE) to.period.contributions(res_qtr_rebal$contribution, period="years")#> HAM1 HAM2 HAM3 HAM4 HAM5 #> 2002-12-31 -0.004045348 -0.012800051 -0.060038137 -0.02103051 -0.01650314 #> 2003-12-31 0.012493183 0.011940516 0.079079298 0.22039789 0.03175587 #> 2004-12-31 0.007188399 0.012866800 0.005786203 0.05651752 0.01053252 #> 2005-12-31 0.004033565 0.006166386 0.044503812 0.04027608 0.01033577 #> 2006-12-31 0.009985784 0.004586611 0.042558683 0.05289248 0.02315896 #> Portfolio Return #> 2002-12-31 -0.11441719 #> 2003-12-31 0.35566675 #> 2004-12-31 0.09289143 #> 2005-12-31 0.10531560 #> 2006-12-31 0.13318252to.yearly.contributions(res_qtr_rebal$contribution)#> HAM1 HAM2 HAM3 HAM4 HAM5 #> 2002-12-31 -0.004045348 -0.012800051 -0.060038137 -0.02103051 -0.01650314 #> 2003-12-31 0.012493183 0.011940516 0.079079298 0.22039789 0.03175587 #> 2004-12-31 0.007188399 0.012866800 0.005786203 0.05651752 0.01053252 #> 2005-12-31 0.004033565 0.006166386 0.044503812 0.04027608 0.01033577 #> 2006-12-31 0.009985784 0.004586611 0.042558683 0.05289248 0.02315896 #> Portfolio Return #> 2002-12-31 -0.11441719 #> 2003-12-31 0.35566675 #> 2004-12-31 0.09289143 #> 2005-12-31 0.10531560 #> 2006-12-31 0.13318252