About this question

Sample Autocorrelation Function

Medium · time_series · Quant Researcher interview question · autocorrelation, acf, time_series_diagnostics, model_identification, time_series

The autocorrelation function (ACF) is a core diagnostic for time series analysis in systematic trading. It helps identify model structure, validate residuals for unexploited serial dependence, and inform look-back window selection. This problem focuses on calculating the sample ACF, a fundamental building block for these quantitative techniques. Task Implement the function sample_acf(y, max_lag) that computes the sample autocorrelation for a time series y at lags 1, 2, ..., max_lag. The functio