Skip to content
All library documents

Rolling-Window Portfolio Comparison Using Out-of-Sample Variance

Article Quant Q&A · Author: active

Summary

The document outlines a rolling-window procedure for comparing portfolios by out-of-sample variance. At each step, returns within a fixed estimation window are used to construct portfolios; the window then advances by one month, dropping the oldest observation. Repeating this process yields a sequence of portfolio weight vectors for each strategy, which can be evaluated over the remaining sample.

The example uses a 60-observation estimation window, described as five years of monthly data, and states that the procedure produces T minus t sets of weights. The accompanying answer points to rolling-window functions in the R package TTR, which builds on time-series packages. The discussion is brief: it does not give implementation details, explain how to calculate the out-of-sample variance comparison, or discuss estimation choices such as window length and transaction costs.

Key ideas

  • A rolling estimation window can generate sequential portfolio weights for out-of-sample comparison.
  • After each step, the window advances and its earliest return observation is removed.
  • The example uses 60 monthly observations, representing five years, for estimation.
  • The answer recommends R's TTR package for rolling-window algorithms, with time-series support from related packages.
  • The document does not specify the portfolio construction method or the variance evaluation procedure.

Tags

Full text
# out-of-sample variance using rolling window


# out-of-sample variance using rolling window












I am currently working on the comparison of the constructed portfolios using out-of-sample variance criteria. I am going to use rolling window procedure for the comparison. First, I choose a window over which to perform estimation. Length of estimation window let say `t` is smaller than `N`, where `N` is the total number of returns. I use estimation window of `t=60` data points which correspond to 5 years for monthly data. Second, using the return data over the estimation window, `t`, I compute various portfolios. I repeat this rolling window procedure for the next month and dropping the data for the earliest month. I continue this until the end of the dataset is reached. At the end of the this process, I will have generated `T-t` portfolio weight vectors for each strategy. Does anyone know which package I can use for rolling window algorithm in R or matlab? Thank you for any help.

## Answer by user25064 (score 2)

https://quant.stackexchange.com/a/17419

R package TTR has rolling window algorithms and understands day counting etc. It stands on the shoulders of xts (which extends zoo) and quantmod

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.