A common assumption for a few of the time series models is that data has to be stationary. Let's look at what stationarity means regarding time series.
A stationary process is one for which the mean, variance, and autocorrelation structure doesn't change over time. What this means is that the data doesn't have a trend (increasing or decreasing).
We can describe this by using the following formulas:
E(xt)= μ, for all t
E(xt2)= σ2, for all t
cov(xt,xk)= cov(xt+s, xk+s), for all t, k, and s
There are multiple methods that can help us in figuring out whether the data is stationary, listed as follows:
- Plotting the data: Having a plot of the data with respect to the time variable can help us to see whether it has got a trend. We know from the definition of stationarity that a trend in the data means that there is no constant mean and variance. Let's do this in Python. For this example, we are using international airline passenger data.
First, let's load all the required...