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

ndiffs returns maximal or minimal differencing order? #586

Open
j-adamczyk opened this issue Nov 5, 2024 · 0 comments
Open

ndiffs returns maximal or minimal differencing order? #586

j-adamczyk opened this issue Nov 5, 2024 · 0 comments

Comments

@j-adamczyk
Copy link

Describe the question you have

As far as I understand, we want to avoid over-differencing, i.e. don't difference if we don't have to. Looking at ndiffs functions docs, it states:

Will select the maximum value of ``d`` for which the time series is judged stationary by the statistical test.

Shouldn't this be "minimal" value instead? If it's maximal, if a time series is already stationary at d=0, and is stationary after differencing d=1, maximal means that we differentiate when we don't have to.

Looking at the code, I'm also not sure if this returns maximal order: https://github.com/alkaline-ml/pmdarima/blob/15919ef6/pmdarima/arima/utils.py#L196. The while loop will break when dodiff is False, which is true when p-value is lower than alpha. KPSS test decides whether the series needs further differencing. So if I understand correctly, this will break as soon as the series does not need further differencing (i.e. is already stationary), so it would choose the minimal d value.

Versions (if necessary)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant