About this question

Newey-West HAC Standard Errors

Hard · statistical_analysis · Quant Researcher interview question · newey-west, hac, ols, autocorrelation, standard-errors, time-series-regression

When regressing strategy returns on risk factors, OLS standard errors are often underestimated in the presence of autocorrelated residuals—a common condition in time-series alpha research. The Newey-West heteroskedasticity-and-autocorrelation-consistent (HAC) covariance estimator corrects for this using a Bartlett kernel. This produces valid t-statistics for significance testing of regression coefficients like alpha and beta. Task Implement the function solution(y: list, x_matrix: list, max_lag