15
$\begingroup$

I have a time series that I am trying to model with Python's statsmodels ARIMA api. When I apply the following:

from statsmodels.tsa.arima_model import ARIMA
model = ARIMA(data['Sales difference'].dropna(), order=(2, 1, 2))
results_AR = model.fit(disp=-1)

I get the following error:

ValueError: The computed initial AR coefficients are not stationary
You should induce stationarity, choose a different model order, or you can
pass your own start_params.

But I have already differenced the data:

data['Sales'] = data['Sales'] - data['Sales'].shift() 

What more can I do to induce stationarity?

And what test is the ARIMA api running to determine that the data is not stationary?

My original time series looks like: enter image description here

The differenced time series looks like: enter image description here

And my ACF plot looks like: enter image description here

$\endgroup$
2
  • $\begingroup$ The premise is wrong. Differencing in the ARIMA family allows for polynomial trends to be removed a therefore allowing some nonstationary models to be converted to stationary. The ARMA family does not allow differencing and do not include non-stationary models. $\endgroup$ Dec 14, 2016 at 3:49
  • 2
    $\begingroup$ @MichaelChernick but I am calling the ARIMA api, not the ARMA one. Am I missing something? $\endgroup$
    – Skander H.
    Dec 14, 2016 at 4:25

4 Answers 4

6
$\begingroup$

You asked "What more can I do to induce stationarity?" If a series exhibits a level shift (symptom) then this is an example of non-stationarity. The correct remedy is to "de-mean" the data not to difference it. Additionally a series may exhibit a change in deterministic trend or a seasonal pulse which can be rectified by Intervention Detection schemes. If the series has a change in parameters over time (symptom) the correct remedy is to find the break points via a Chow Test and to use the most recent set or some form of threshold model (TAR). If a series has a change in error variance over time (symptom) the correct remedy might be WLS a form of GLS or some form of power transform or failing those relatively simple remedies some form of GARCH model.

If you post your original data I might be able to help more.

$\endgroup$
2
$\begingroup$

Read carefully: it doesn't say that the time series is not stationary. It says that the initial coefficients are not stationary (which I presume means they don't describe a stationary process).

You could try putting in your own guess for starting values, as it suggests. But I suspect that it's choosing bad starting values in the first place because the model is mis-specified. If you already differenced the time series, you probably don't also want to specify integration order 1. You probably mean order=(2, 0, 2), not order=(2, 1, 2).

$\endgroup$
0
$\begingroup$

In a time series signal, stationarity can be introduced by using windowing. You can break your single time series signal into smaller signals using good window technique with overlap. Windowing is required to avoid spurious peaks in the frequency domain and overlap is required to conserve signal energy. Typically a speech signal (8KHz sampling frequency) has 30 msec frames giving 240 samples per frame. This is convoluted using a hamming window with 50% overlap.

$\endgroup$
0
$\begingroup$

The differenced time series is not stationary since it does not have a constant variance. You could try a logarithmic differentiation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.