Use a unit root function to determine the minimum number of differences necessary to obtain a stationary time series.
A vector to be tested for the unit root.
The level of the test.
A function (or lambda) that provides a p-value for a unit root test.
The possible differences to consider.
Additional arguments passed to the
The period of the seasonality.
A numeric corresponding to the minimum required differences for stationarity.
Note that the default 'unit root function' for
unitroot_nsdiffs() is based
on the seasonal strength of an STL decomposition. This is not a test for the
presence of a seasonal unit root, but generally works reasonably well in
identifying the presence of seasonality and the need for a seasonal