简体   繁体   中英

time series data kpss test result

I have a simple time series with expenses for each month over 4 years.

first I tried to see the components of the time series 在此处输入图片说明

Then I used the kpss test to see whether the series is stationary (I assume it's not since there is a trend). But I'm confused about how to read the kpss test result.

So statsmodels.tsa.stattools.kpss(x, regression='c', lags=None, store=False) I can specify regression='c' (stationary around a mean) or regression='ct' (stationary around a trend). My (1) question is which one "mean" or "trend" should I use here?

if I use the default value for lags, I got the following results(truncated at lag 11), which means the series is not stationary

kpss(df1['Expense'],regression='ct')

(0.5363718304676898,
 0.03347481295772753,
 11,
{'1%': 0.739, '10%': 0.347, '2.5%': 0.574, '5%': 0.463})

But if I specify the lag number, for example: kpss(df1['Expense'],regression='ct', lags=5) I got

 (0.04352483391586768,
  0.1,
  5,
 {'1%': 0.216, '10%': 0.119, '2.5%': 0.176, '5%': 0.146})

What does the lags in the kpss result mean (eg, lag 11 in the above output) ? does it have anything to do with number of differencing for the ARIMA model?

Thanks a lot!!!

In general the lag size affects the KPSS test. Both lag sizes (default size of 11 in your case which depends on the total number of observations and second example size of 5) indicate the series is non-stationary since the p-values (0.0334 , 0.1) are less than their respective alpha values (5%).

The lag size do not indicate any level on differencing that you need to apply on non-stationary series. So, you need to do a first level differencing (d =1 ) and check if the resultant series is stationary. If not you have to repeat the differencing. You may want to refer for a good introduction on stationarity checking.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM