Rebalancing a Portfolio with Periodic Time Series Weights in R
Summary
The document discusses using the PerformanceAnalytics Return.portfolio function to apply a time series of portfolio weights to daily asset returns. The author observes that specifying different rebalance_on frequencies appears to produce identical portfolio results when the weights are supplied at daily frequency. The accepted answer offers a practical adjustment: first reduce the weight series to the intended rebalance dates, such as by keeping the last observation each week, then pass those periodic weights to the function while retaining daily returns.
This approach illustrates that the weight data’s frequency affects the rebalancing behavior, even when a frequency option is supplied. The answer reports that weekly conversion worked for the respondent, but provides no general validation across all frequencies, datasets, or package versions. Users should confirm the package’s handling of weight dates and rebalance timing for their own data.
Key ideas
- Daily return data can be paired with weights sampled at the desired rebalancing frequency.
- The accepted answer recommends aggregating the weight series to rebalance dates, such as weekly endpoints.
- Passing periodic weights can avoid treating daily weight observations as daily rebalancing instructions.
- The reported fix is not tested across all frequencies, datasets, or package versions.
Tags
Full text
# Return.portfolio function for re-balancing with time series of weights # Return.portfolio function for re-balancing with time series of weights I am using the Return.portfolio function from the PerformanceAnalytics R package in order to re-balance the portfolio based on different frequencies (i.e. daily, weekly monthly, etc.) using a time series of weights. The function works fine when using a static weight-vector such as `c(0.6, 0.2, 0.2)` but when using the time series weight matrix the function produces the same result for all re-balancing frequencies, i.e. `r.p.dynRP.d = Return.portfolio(ret["1997-01-30/2018-01-05"], weights=weight_matrix, rebalance_on="days")` yields the same result as `r.p.dynRP.y = Return.portfolio(ret["1997-01-30/2018-01-05"], weights=weight_matrix, rebalance_on="years")` `ret` and `weight_matrix` are both xts objects with the same dimensions and the same `indexclass=date`. I think the function re-balances daily for all frequencies. Any idea why this is case? Is there perhaps a better way for the calculation of periodic re-balancing based on changing portfolio weights? ## Answer by Falko Genzel (score 1) https://quant.stackexchange.com/a/37900 It actually works if you convert the (time series) weight matrix to the frequency you want to use for re-balancing using, e.g. `apply.weekly(weight_matrix)`. The return matrix should still be daily data. I.e. the following code worked for me: ``` weight_matrix.w=apply.weekly(weight_matrix, last) r.p.dynRP.w = Return.portfolio(ret, weights=weight_matrix.w) ```
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.