Simpson's Paradox in Time Series Correlation

Reported in interviews at Squarepoint Capital

Problem statement

Suppose you have two time series $X_t$ and $Y_t$ with the following structure:

$$X_t = aM + bR, \quad Y_t = cM + dR$$

where $M \in \{1, \ldots, 12\}$ is the month index and $R \in \{1, \ldots, 30\}$ is the day-within-month index. The parameters satisfy $a = -c$, $b = d$, and $|a|$ is large relative to $|b|$.

Explain how it is possible that the correlation between $X_t$ and $Y_t$ is positive within every individual month, yet negative when computed over the full year.

Show hint

What happens to the terms involving $M$ when you compute a correlation using only the days of one fixed month?

Relevant roles: Data Scientist, Applied Scientist and Research Scientist.

Related free problems