# How to test for wide-sense stationarity with only one sample path of the process?

I have a univariate time series consisting of 70,000 observations (power consumption of a building) over equal time increments (15 minutes).

How do I check whether this realization is wide-sense stationary? Note that I don't know the formula of the underlying stochastic process, so I cannot calculate the mean function E[x(t)] or the autocovariance function E[(x(t1)-m(t1))(x(t2)-m(t2))]

(I'm aware of the definition of wide-sense/weak/covariance stationarity and I've read several threads on the topic here at Cross Validated, the closest one being this one.)

I'm arriving to the conclusion that checking a sample path for weak stationarity comes down to some heuristic tests.

The Engineering Statistics Handbook (which I like for its practical approach) states:

Stationarity can be defined in precise mathematical terms, but for our purpose we mean a flat looking series, without trend, constant variance over time, a constant autocorrelation structure over time and no periodic fluctuations.

If you agree with this practical approach, then my comments/questions are:

• We can easily do linear fitting to tell if there's a trend. We're good here.
• But how do we test for a constant autocorrelation structure over time?
• And how do we check for constant variance over time? Do we using moving windows, or non-overlapping windows? And what should the size of the window be?

I'm looking for some good rules of thumb to test with.

Thanks in advance for the help, and apologies for the long post. (First post here.)

• Before doing the "linear fitting" I strongly suspect you have 24-hour, 7-day and most probably a yearly seasonal trend. Energy consumption is highly periodic. Commented Apr 11, 2014 at 21:53
• If you suspect the time series in question is stationary around a deterministic trend: the KPSS-test is a reasonable first choice but be very careful as seasonality invalidates it. Commented Apr 11, 2014 at 22:10
• @usεr11852, the trend is almost non-existent in the 2-years' worth of data that I have. Extracting the seasonalities from the trace seems to be tricky. The ACF for the first 140+ lags (roughly ~ 37 hours) shows significant correlations throughout the entire range. (And single differencing results in this ACF. But I don't know if I'm derailing my own thread now.) Commented Apr 11, 2014 at 22:43
• @usεr11852 The KPSS-test can be used with data that exhibit seasonality -but most probably one should execute it "manually" because ready-made software commands won't know that the data exhibit seasonality, see this post stats.stackexchange.com/questions/78254/… Commented Apr 11, 2014 at 23:49
• @Kostas: Sorry, which trend are you talking about? I guess "the linear one", because if you mean the seasonal trend you need to have a building that its energy requirements are the same in winter and summer time; unless the building is in the tropics or the poles I somehow doubt that... Additionally even from your first plot it is evident that you have "something" taking part between 90-100 lags (which is obviously your daily cycle). Unless you account for potential periodic trends in your series you will have "stationary issues". Commented Apr 11, 2014 at 23:55

Agreed with user11582 that w/o even looking at any data it is clear that energy consumption is not wide sense stationary ( due to multiple seasonalities in human behavior, hourly, daily, weekly, monthly, annually ).

To your specific question on how to test not time varying autocorrelation: Goerg (2012) provides an extension of standard white noise tests to distinguish locally stationary processes from actual white noise. This in combination with the work by Ferreira, Olea, and Palma (2013) gives you the tools to establish/test what you need.

Any test focuses on only 1-2 aspects of stationarity (e.g. unit root tests). In addition to the ideas suggested in other threads, you can do the following.

1] Regress $$Y_t$$ on predictors $$\{g_1(t),...,g_p(t)\}$$, where $$g_1(),...,g_p()$$ are some (non-)linear deterministic functions. Check joint statistical significance of the coefficients.

2] Back out residuals $$\varepsilon_t$$.

3] Regress $$\varepsilon_t^2$$ on predictors $$\{g_1(t),...,g_p(t)\}$$. Check joint statistical significance of the coefficients.

4] Regress $$\varepsilon_t\varepsilon_{t-1}$$ on predictors $$\{g_1(t),...,g_p(t)\}$$. Check joint statistical significance of the coefficients.

• This answer does not differentiate between tests that provide evidence for stationarity (e.g., ADF), versus tests which provide evidence for unit root (e.g., KPSS). Commented Nov 1, 2021 at 17:17

Empirically, to check if the process is stationary, you biggest enemies are trend and unit roots.

Checking for trend is relatively easier. A trend over time can be checked by regression you series over time.

Checking for unit roots is generally harder. There are tests that let you do it such as the Dickey Fuller test, but such tests generally suffer from low statistical power.

If the process has neither trend nor unit roots, it is common practice in empirical studies to assume it is wide-sense stationary.

• Ducky-Fuller has a null that a time series contains a unit root, and provides or fails or provide evidence to falsify that. It does not provide evidence that a time series contains a unit root. Contrast with the KPSS test. Commented Nov 1, 2021 at 17:15