# Is my Data stationary? KPSS, ADF Tests and ACF

I already differenced my Data by 1 and i am not sure whether my Data is now stationary or not. I perfomed an KPSS and ADF test in order to help me decide if it is. I think it is stationary but im not quite sure. I would really appreciate any help.

Here is the Result of my ADF Test:

ADF Statistic: -10.036066
p-value: 0.000000
Critical Values:
1%: -3.438
5%: -2.865
10%: -2.569


Here is the result of my KPSS Test:

Results of KPSS Test:
Test Statistic            0.010833
p-value                   0.100000
Lags Used                21.000000
Critical Value (10%)      0.347000
Critical Value (5%)       0.463000
Critical Value (2.5%)     0.574000
Critical Value (1%)       0.739000


I read some controversion things about this test but i think if the p-value is higher than 0,05 --> no differencing required? "Consequently, small p-values (e.g., less than 0.05) suggest that differencing is required" (https://otexts.com/fpp2/stationarity.html)

Test Statistic < Critical Values means that it is stationary?

KPSS-Test --> Data is stationary

ACF PLOT of first 50 lags:

Is the ACF-Plot stationary? It rapidly declines like a stationary one should do but not really to zero.

It would be awesome if you guys could guide my way through this problem.

Best Regards

A time series can be said to be stationary when the mean , standard deviation and auto-correlation is the same for all sub-intervals of time. If you have Pulses,Seasonal Pulses, Level Shifts or Local Time Trends this would be a violation of the stationarity of the mean. If the standard deviation changes over time for example dependent on the mean then this would be a violation of the assumption of a constant standard deviation. If the auto-correlation function changes over time then this might be an indication of time varying parameters BUT it could have other causes.

One form of adjustment to make a series stationary is to de-mean the data ie. adjust for a changing mean

Another form is to adjust for pulses and seasonal pulses

Another form is to difference the data either regularly or seasonally or both

Another form is to transform the data based upon a box-cox analysis

Another form is to apply weights to standardize (make common) the error variance over time

Only your data knows for sure . Ask your data which transform is appropriate for your data i.e. test for the appropriate stationarity transform

EDITED AFTER RECEIPT OF YOUR DATA:

Expanding on the @davo note that a time series with seasonality OR level/step shifts OR monthly effects OR daily effects OR local time trends OR time-varying parameters or time-varying error variance cannot be stationary. Indeed, as stationarity means that that the properties of a series are independent of time, and because a time series with one or more of these features by its very nature depends on time, thus they are ipso facto non-stationary.

Your 894 daily values are here (starting 1/1/2013)

A useful model was found that has two step/level shifts down (9/6/2013 & 2/23/2015) , 5 monthly indicators (seasonal factors : March & November + ; June, July & Aug -) , 2 day of-the-week factors (sluggish sales on the weekends) and two holiday effects around Thanksgiving and German Unification Day and a few unusual values (pulses).

The Actual/Fit and Forecast graph is here with forecasts here for the next 365 days

The Actuals and Cleansed Graph is here

Note that the data has a weekly( day-of-the-week) seasonality BUT it is not memory driven as @davo suggested needing sarima (stochastic structure) BUT one driven by exceptional repetitive/consistent/deterministic/repetitive activity on Saturday & Sunday. Thus since Saturday is always high because it is a Saturday this falsely suggests that the previous Saturday is important. Same for Sunday . Five days of the week have no predictable information.

Following is the plot of the model residuals

The data has spoken and I have listened ! ... Your data is non-stationary

With respect to the tests you were trying ..You need to know what hypothesis is being tested and what the alternative hypothesis is for each test. You need to know the exact assumptions under which these(any) tests are valid.

Differencing your data is totally unnecessary and is the "rong fix" for your data . See Seasonality after 1st differencing

• Hello, thanks for your answer first of all. As im quite new to Data Analytics a quick question. Did i understand u the right way that with the information provided above my data is not stationary? Is there an example dataset of clearly stationary data i can use to compare specific forecasting algorithms to? Im very interested in this topic and want to do such a comparison for college. It is just important that the data is stationary because the algorithms require it. Im quite lost at the moment. Jul 22, 2019 at 20:02
• post your data or send it to me offline and I will try and answer your question. Jul 22, 2019 at 20:05
• This is the Dataset: transfernow.net/791mt8d110fs - I hope the Link is appropriate ? Jul 22, 2019 at 20:26
• Wow this is a very detailed answer, thank you very much :) Jul 23, 2019 at 23:50

If you look carefully into your ACF, you will notice that there is a spike at lag 14 and another at lag 28. These are tell-tale signs that your underlying series are seasonal. Perhaps, you can see that more clearly on the ACF of the first (regular) difference of the series.

Having observed that, please refer to the first two sentences of https://otexts.com/fpp2/stationarity.html, to note that a time series with seasonality cannot be stationary. Indeed, as stationarity means that that the properties of a series are independent of time, and because a seasonal time series by its very nature depends on time, thus seasonal time series are non-stationary.

• Hello Dave, thanks for your answer. So this would indicate that i have to make another difference for 14 ? Jul 22, 2019 at 23:48
• And to add a question: I am looking for an stationary time series to test algorithms on. Are there samples around i could use? I didnt find a lot of helpful information about this. Jul 22, 2019 at 23:53
• A seasonal spike does not necessarily imply the need for seasonal difference (i.e. what you refer to as "difference for lag 14". All that a seasonal spike tells you is that it is likely that you are dealing with a seasonal series. Jul 23, 2019 at 0:48
• With regards to your question on examples of stationary time series - yes, somewhat of a "classical" time series dataset that comes to mind is the Box-Jenkins "series J" on methane gas (x) and CO2 (y). The input (x) is modeled as an AR(3) process (stationary). A friendly introduction to that work can be found in Bisgaard, S., & Kulahci, M. (2006). Quality Quandaries: Studying input-output relationships, part I. Quality Engineering, 18(2), 273-281. Jul 23, 2019 at 0:48
• Here is the link to Box-Jenkins series J data: stat.purdue.edu/~chong/stat520/bjr-data/gas-furnace Jul 23, 2019 at 0:52