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

Why the specific lags used in kpss unit root test in **ndiffs**? #959

Closed
pgg1309 opened this issue May 13, 2024 · 2 comments
Closed

Why the specific lags used in kpss unit root test in **ndiffs**? #959

pgg1309 opened this issue May 13, 2024 · 2 comments

Comments

@pgg1309
Copy link

pgg1309 commented May 13, 2024

Hi,
The function ndiffs uses a specific number of lags for the ur.kpss test

use.lag = trunc(3 * sqrt(length(x)) / 13)

Questions:
(a) why is this lag used ? would it make sense regardless of the periodicity of the series ?
(b) why not pick lags for the other two tests ? (ur.df and ur.pp)

Thanks!

@robjhyndman
Copy link
Owner

See https://stats.stackexchange.com/a/350363/159
Periodicity is irrelevant -- this is a unit root test, not a seasonality test.

We use the default lags for the other tests. This was purely about backwards compatibility.

@pgg1309
Copy link
Author

pgg1309 commented May 14, 2024

Thanks!

@pgg1309 pgg1309 closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants