About this question

Rolling OLS Beta

Medium · backtesting · Quant Researcher interview question · factor-models, ols, rolling-window, backtesting, statistics

Rolling Ordinary Least Squares (OLS) is a fundamental technique for estimating time-varying relationships between financial time series. It is widely used in dynamic factor risk models to capture regime shifts in an asset's systematic risk (beta) and to implement time-varying hedging strategies. This approach balances estimation precision with responsiveness to structural breaks in market dynamics. Task Implement the function solution(y: list, x: list, w: int) -> list to calculate the rolling O