About this question
Medium · time_series · Quant Researcher interview question · cross_correlation, lead_lag, time_series, pairs_trading, signal_detection
Cross-correlation analysis identifies timing asymmetries between related return series, revealing which asset leads or lags another. In statistical arbitrage, detecting stable lead-lag relationships enables alpha generation by anticipating moves in the lagging asset from signals in the leading one. Task Implement lead_lag_xcorr(x, y, max_lag) that computes the Pearson cross-correlation between two return series x and y for integer lags from -max_lag to +max_lag. At lag k, the cross-correlation