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?


1 Answer 1


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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.