Define the p-Value, Then Explain How to Test Two Price Series for Cointegration
Company: Jain Global
Role: Data Scientist
Category: Statistics & Math
Difficulty: easy
Interview Round: Technical Screen
The same 30-minute first-round screen with a systematic trading team also asked two statistics questions. They check whether a candidate can state hypothesis-testing concepts precisely and apply them to financial time series, where several standard intuitions break down.
### Clarifying Questions
- For the p-value, should the answer cover both one-sided and two-sided tests?
- For cointegration, are we testing two series or a basket of several, and should the test use prices or log prices?
- Is the hedge ratio between the series known in advance, or must it be estimated from the data?
### Part 1 — Define the p-value
Give a precise definition of a p-value, explain how it is used to make a decision, and say what it does **not** mean.
```hint Condition on the right thing
Be explicit about which hypothesis the probability is computed under, and exactly which event it is the probability of.
```
#### What This Part Should Cover
- A precise definition in terms of a test statistic and the null hypothesis
- Common misinterpretations, and why each is wrong
- How p-values feed decisions, including what happens when many tests are run
### Part 2 — Test two price series for cointegration
What is cointegration, and how do you test whether two price series are cointegrated? Describe the procedure step by step, state the hypotheses, and explain how to interpret the result.
```hint Why not just use correlation?
Think about what a regression of one random walk on another, unrelated random walk looks like, and what property the residual of a genuine long-run relationship should have.
```
#### What This Part Should Cover
- The definition of cointegration in terms of the order of integration and a stationary linear combination
- A concrete testing procedure with its null hypothesis, and why its critical values differ from those of a standard unit-root test
- An alternative for more than two series, and practical pitfalls when the result is used for trading
### What a Strong Answer Covers
- Definitions stated precisely, with the conditioning on the null hypothesis made explicit
- The distinction between correlation and cointegration, and between stationary and non-stationary series
- A step-by-step test with hypotheses, a test statistic and a decision rule
- Awareness of multiple testing, data snooping and look-ahead bias when screening many pairs
- A small worked example or simulation that makes the ideas concrete
### Follow-up Questions
- You screen 1,000 candidate pairs at a 5 percent significance level and 60 of them come out as cointegrated. How many would you expect by chance alone, and what do you do next?
- Why can the result of the two-step residual-based test depend on which series is used as the dependent variable, and which test avoids that?
- How would you turn a cointegrated pair into a trading signal, and how would you estimate how quickly the spread reverts to its mean?
- A pair that was cointegrated in your estimation window stops behaving that way out of sample. What might have happened?
Overview: Two statistics questions from a systematic trading screen: give a precise definition of the p-value and its common misreadings, then explain what cointegration is and how to test two price series for it. It tests hypothesis-testing rigor, stationarity, the difference between correlation and cointegration, and multiple-testing pitfalls.