pyhctsa.operations.stationarity.pp_test

pyhctsa.operations.stationarity.pp_test(y, lags=None, model='ar', test_statistic='t1')

Phillips-Perron unit root test.

The null hypothesis is that the series contains a unit root (i.e., is a random walk, possibly with drift); the alternative is that it is stationary about the specified deterministic trend.

The test statistic is a non-parametric correction of the Dickey-Fuller statistic, using a Newey-West estimate of the long-run variance in place of the augmenting lagged differences.

References

Parameters:
y : array-like

The input time series.

lags : int or list of int, optional

The number of autocovariance lags to include in the Newey-West estimator of the long-run variance. A list runs one test per lag and returns summary statistics across them. Default is range(0, 6).

model : {'ar', 'ard', 'ts'}, optional

The regression model: ‘ar’ (autoregressive, no deterministic terms), ‘ard’ (autoregressive with drift) or ‘ts’ (trend stationary). Default is ‘ar’.

test_statistic : {'t1', 't2'}, optional

‘t1’ is the standard t-statistic; ‘t2’ is a lag-adjusted, ‘unStudentized’ statistic. Default is ‘t1’.

Returns:

For a single lag: the p-value, statistic, first regression coefficient and regression fit statistics. For multiple lags: summary statistics on the p-values, statistics and regression fit statistics across lags.

Return type:

dict