The Pettitt Test is used to identify abrupt changes in the mean of a time series.
- Null hypothesis: There are no abrupt changes in the time series mean.
- Alternative hypothesis: There is one abrupt change in the time series mean.
Define $\text{sign} (x)$ to be $1$ if $x > 0$, $0$ if $x = 0$, and $-1$ otherwise.
Given a time series $y_{1}, \dots, y_{n}$, compute the following test statistic:
$$
U_{t} = \sum_{i=1}^{t} \sum_{j=t+1}^{n} \text{sign} (y_{j} - y_{i}), \quad K = \max_{t}|U_{t}|
$$
The value of $t$ such that $U_{t} = K$ is a potential change point. The p-value of the potential change point can be approximated using the following formula for a one-sided test:
$$
p \approx \exp \left(-\frac{6K^2}{n^3 + n^2}\right)
$$
If the p-value is less than the significance level $\alpha$, we reject the null hypothesis and conclude that there is evidence for an abrupt change in the mean at the potential change point.