Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

to.period.contributions

Aggregate contributions through time


Description

Higher frequency contributions provided as a time series are converted to a lower frequency for a specified calendar period.

Usage

to.period.contributions(
  Contributions,
  period = c("years", "quarters", "months", "weeks", "all")
)

Arguments

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".

Details

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.

Author(s)

Peter Carl, with thanks to Paolo Cavatore

References

See Also

Examples

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")
to.yearly.contributions(res_qtr_rebal$contribution)

PerformanceAnalytics

Econometric Tools for Performance and Risk Analysis

v2.0.4
GPL-2 | GPL-3
Authors
Brian G. Peterson [cre, aut, cph], Peter Carl [aut, cph], Kris Boudt [ctb, cph], Ross Bennett [ctb], Joshua Ulrich [ctb], Eric Zivot [ctb], Dries Cornilly [ctb], Eric Hung [ctb], Matthieu Lestel [ctb], Kyle Balkissoon [ctb], Diethelm Wuertz [ctb], Anthony Alexander Christidis [ctb], R. Douglas Martin [ctb], Zeheng 'Zenith' Zhou [ctb], Justin M. Shea [ctb]
Initial release
2020-02-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.