Skip to content

Added KPSS test (1) - #2775

Merged
josef-pkt merged 2 commits into
statsmodels:masterfrom
N-Wouda:kpss
Jan 20, 2016
Merged

josef-pkt merged 2 commits into
statsmodels:masterfrom
N-Wouda:kpss

Conversation

@N-Wouda

@N-Wouda N-Wouda commented Jan 19, 2016

Copy link
Copy Markdown
Contributor

Full implementation of the KPSS test; with unit tests and description in the
docs. See #2749 for a lengthy discussion on the design choices.

Full implementation of the KPSS test, unit tests and description in the
docs.
@N-Wouda

N-Wouda commented Jan 19, 2016

Copy link
Copy Markdown
Contributor Author

@josef-pkt here's the 'new' PR, with everything bundled into a single commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out, since acf no longer takes a confint argument. This was in a MAINT note.

@josef-pkt

Copy link
Copy Markdown
Member

The branch looks good.

3 more comments with small issues (not strictly necessary)

@N-Wouda

N-Wouda commented Jan 19, 2016

Copy link
Copy Markdown
Contributor Author

@josef-pkt,

  • Would OutOfBoundsInterpolationWarning make sense? I think it's appropriate. If you agree, I'll add it in and use that instead of a generic UserWarning.
  • I'll switch to assert_.
  • I'll test for some attributes instead.

@josef-pkt

Copy link
Copy Markdown
Member

OutOfBoundsInterpolationWarning is too specific and there wouldn't be many use cases for it.
I thought we could use something more generic but I didn't come up with anything (yet). In the one or few other cases like this, we only write in the docstring that the pvalue is at the boundary point of the available table, but don't warn of flag.

IIRC, Kevin did some large scale simulations to create pvalues or critical values for unit root tests, so eventually we might be able to replace simple tables of critical values with fancier methods.

@N-Wouda

N-Wouda commented Jan 19, 2016

Copy link
Copy Markdown
Contributor Author

@josef-pkt we can always leave the issue of a suitable warning message as something for the future. I could mention it alongside automatic lag selection in the issue I will open for the KPSS test after merger (as discussed previously in #2749).

I'll push a single more commit to this branch to deal with the assert and testing for attributes in the unit test instead (that will probably be tomorrow), and then I think we may be good to go!

@josef-pkt

Copy link
Copy Markdown
Member

@N-Wouda
BTW: Are you aware that we have an almost finished (but stalled) PR for exponential smoothing? #1489

As per Josef's comments, using assert_equal for the attributes, rather
than testing with assert and isinstance.
@N-Wouda

N-Wouda commented Jan 20, 2016

Copy link
Copy Markdown
Contributor Author

@josef-pkt had not seen that before, no! I did see some feature requests for it, but did not realise someone was already on it. Is it based on statespace?

With regard to this PR, I think I pretty much got it now, besides the warning message. I'll leave that in an issue to be addressed in future PR's (together with lag selection).

Starting February, I'll probably get onto either bootstrapped CI, or exponential smoothing. I have several books laying around on the latter over here (including a couple by Hyndman), so that may be more convenient. Do you have any preferences on this, as in, what would you like to see first? :).

@josef-pkt

Copy link
Copy Markdown
Member

About ETS: I haven't looked much at the details. But the PR and code is older than the statespace models that Chad added over the last 1 to 2 years.
From reading or skimming some of Hyndman's writing, I think most versions have a linear statespace or ARMA representation, but I'm not sure all do. I don't know what the advantage would be of the current standalone version and a version written on top of the new tsa.statespace.
(My guess is that the special implementation would use less memory because it doesn't need to get the generic representation for long AR/seasonal components, and potentially faster if it doesn't use generic calculations that are redundant in this case. just guessing)

Do you have any preferences on this, as in, what would you like to see first?

Both are fine with me.
Based on user demand I would pitch for ETS. Based on the description in PR #1489, it is almost finished, needs some decisions on or options for initial conditions, and maybe examples and tests.
With not too much effort we would get a first version that covers many specifications.
(I don't know whether it would also be quick and easy to implement it on top of tsa.statespace. The framework that Chad built is pretty extensive already, so many things could be reused for new linear models.)

@N-Wouda

N-Wouda commented Jan 20, 2016

Copy link
Copy Markdown
Contributor Author

@josef-pkt I am willing to take a look at the ETS in #1489 sometime soon. I will probably bug Chad with it, since I may have some questions about tsa.statespace.

As to this PR, is it ready for a merge? I will move to an appropriate PR for the ETS discussion.

@josef-pkt

Copy link
Copy Markdown
Member

LGTM, merging

@N-Wouda Thank you

josef-pkt added a commit that referenced this pull request Jan 20, 2016
@josef-pkt
josef-pkt merged commit 3133576 into statsmodels:master Jan 20, 2016
@josef-pkt

Copy link
Copy Markdown
Member

@ChadFulton Thanks for reviewing, that made this a lot faster

@ChadFulton

Copy link
Copy Markdown
Member

No problem, I'm trying to get more involved when possible.

@josef-pkt josef-pkt mentioned this pull request Feb 9, 2016
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

Successfully merging this pull request may close these issues.

3 participants