statsmodels.tsa.stattools.range_unit_root_test#
- statsmodels.tsa.stattools.range_unit_root_test(x, store=False, *, result_object=None)[source]#
Range unit-root test for stationarity
Computes the Range Unit-Root (RUR) test for the null hypothesis that x has a unit root, i.e. is not stationary. The null is rejected for small values of the statistic.
- Parameters:
- xarray_like, 1d
The data series to test.
- storebool,
optional If True, then a result instance is returned additionally to the RUR statistic (default is False).
- result_objectbool,
optional Flag indicating whether to return the results as a
RURResultinstead of a plain tuple. The legacy tuple (whose length depends on store) is returned by default and aFutureWarningis issued.Deprecated since version 0.15.0: In release 0.16.0 or after July 2027, whichever is later, the default will change to always return a
RURResult. Setresult_object=Trueto opt in now, orresult_object=Falseto silence the warning and keep the current return type.
- Returns:
RURResultIf
result_object=True, a result object with fieldsstatistic,pvalue,critical_values, andresstore(resstoreisNonewhen not computed). SeeRURResult.Otherwise(thedeprecateddefault),aplaintuplewhoselengthdependsonstore,madeupofasubsetof:- statistic
float The RUR test statistic.
- pvalue
float The p-value of the test. The p-value is the smallest probability level in Table 1 of Aparicio et al. (2006) whose critical value is larger than the statistic. The boundary value 0.01 is returned if the statistic is below the 1% critical value, and 0.95 if it is at or above the 95% critical value, that is, if the actual p-value is outside the interval (0.01, 0.95).
- crit
dict The critical values at 10%, 5%, 2.5% and 1%. Based on Aparicio et al. (2006).
- resstore(
optional)instanceofResultsStore An instance of a dummy class with results attached as attributes.
Notes
The critical values are interpolated in the number of observations from Table 1 of Aparicio et al. (2006). The p-value is the smallest tabulated probability level whose critical value is larger than the statistic. If the computed statistic is below the 1% critical value or at or above the 95% critical value, then an
InterpolationWarningis issued. In the first case the actual p-value is smaller than the reported 0.01 and in the second it is larger than the reported 0.95.Changed in version 0.15.1: The null hypothesis is documented correctly: the null is that x has a unit root, and it is rejected for small values of the statistic. The
InterpolationWarningpreviously reported the opposite direction, and was raised when the p-value was 0.95 or 0.01 rather than when the statistic was outside of the tabulated critical values. It is now raised when the statistic is below the 1% critical value (the actual p-value is smaller) or at or above the 95% critical value (the actual p-value is larger).Missing values are not handled.
References
[1]Aparicio, F., Escribano A., Sipols, A.E. (2006). Range Unit-Root (RUR) tests: robust against nonlinearities, error distributions, structural breaks and outliers. Journal of Time Series Analysis, 27 (4): 545-576.