Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KPSS test for stationary processes #1269

Closed
dfrusdn opened this issue Dec 26, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@dfrusdn
Copy link

commented Dec 26, 2013

The KPSS test is used to test if a time series with a trend is stationary. I would recommend it as a feature.

It can be used on time-series where the HP filter can be applied

Here it is from matlab

http://www.mathworks.com/help/econ/kpsstest.html

@dengemann

This comment has been minimized.

Copy link
Contributor

commented Dec 26, 2013

Btw. unit root tests for non-stationarity e.g. ADF are already available in Python, e.g. in statsmodels.

@dfrusdn

This comment has been minimized.

Copy link
Author

commented Dec 26, 2013

I know but it is specifically used for time series with a trend. Also Breusch Godfrey test and Durbin Watson test for stationary roots.

@dengemann

This comment has been minimized.

Copy link
Contributor

commented Dec 26, 2013

not necessarily. It's
also valid to use it with detrended data. It's commonly used in combination with ICA on EEG or MEG data after filtering.
I think the main point that KPSS is rather confirmatory in testing the hypothesis of stationarity. From roughly scanning literature and websites. it seems ADF is often the preferred test. Also it's the one already implemented in statsmodels.Of course there is pros and cons and all depends on your data and so on.

I think what's more important in this context is whether such a statistical function should go into sklearn. Probably statsmodels or scipy would be more appropriate.

@josef-pkt

This comment has been minimized.

Copy link
Member

commented Dec 26, 2013

There are a large number of unit root tests and many of them don't have great performance. AFAIR, adf is the best one. IIRC, the interesting parts about KPSS or another one (?) is that it has the null and alternative hypothesis reversed compared to adf.

I think we would like to have more unit root tests, also against breaks in trend and panel unit root tests. However, since we have adf, I don't think it has very high priority.

PR welcome

@dfrusdn

This comment has been minimized.

Copy link
Author

commented Dec 27, 2013

I think another unit root test can be use to cross validate. Other than that I do not think it is a high priority

@dfrusdn dfrusdn closed this Dec 30, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.