PerformanceAnalytics (version 1.1.0)

Return.rebalancing: Calculates weighted returns for a portfolio of assets

Description

Calculates weighted returns for a portfolio of assets. If you have a single weighting vector, or want the equal weighted portfolio, use Return.portfolio. If you have a portfolio that is periodically rebalanced, and multiple time periods with different weights, use Return.rebalancing. Both functions will subset the return series to only include returns for assets for which weight is provided.

Usage

Return.rebalancing(R, weights, ...)

Return.portfolio(R, weights = NULL, wealth.index = FALSE, contribution = FALSE, geometric = TRUE, ...)

Arguments

R
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
weights
a time series or single-row matrix/vector containing asset weights, as percentages
wealth.index
TRUE/FALSE whether to return a wealth index, default FALSE
contribution
if contribution is TRUE, add the weighted return contributed by the asset in this period
geometric
utilize geometric chaining (TRUE) or simple/arithmetic chaining (FALSE) to aggregate returns, default TRUE
...
any other passthru parameters

Value

  • returns a time series of returns weighted by the weights parameter, possibly including contribution for each period

Details

Return.rebalancing uses the date in the weights time series or matrix for xts-style subsetting of rebalancing periods. Rebalancing periods can be thought of as taking effect immediately after the close of the bar. So, a March 31 rebalancing date will actually be in effect for April 1. A December 31 rebalancing date will be in effect on Jan 1, and so forth. This convention was chosen because it fits with common usage, and because it simplifies xts Date subsetting via endpoints.

Return.rebalancing will rebalance only on daily or lower frequencies. If you are rebalancing intraday, you should be using a trading/prices framework, not a weights-based return framework.

References

Bacon, C. Practical Portfolio Performance Measurement and Attribution. Wiley. 2004. Chapter 2

See Also

Return.calculate

Examples

Run this code
data(edhec)
data(weights)

# calculate an equal weighted portfolio return
round(Return.portfolio(edhec),4)

# now return the contribution too
round(Return.portfolio(edhec,contribution=TRUE),4)

# calculate a portfolio return with rebalancing
round(Return.rebalancing(edhec,weights),4)

Run the code above in your browser using DataLab