-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chanegd kpss default lag selection to match urca and tseries
- Loading branch information
1 parent
3341689
commit 6c86c63
Showing
2 changed files
with
2 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6c86c63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Mitchell, interesting change. Was this done for compatibility or were studies done that showed improved performance?
6c86c63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi David,
The change has been made to match the truncation lag parameter from the original KPSS formulae. The package originally used
tseries::kpss.test
to perform the test, which had the default lag set totrunc(3*sqrt(length(x))/13)
. When we converted the tests to useurca::ur.kpss
, it used a different default lag oftrunc(4 * (n/100)^0.25)
. For consistency with previous versions of the package, we retained the default lag of thetseries
package.Recently (18-11-2018) the
tseries
package changed their default lag parameter totrunc(4 * (n/100)^0.25)
. So other than consistency across forecast package versions, there is no reason to keep the old (and incorrect) truncation lag parameter.6c86c63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6c86c63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - incorrect is a bit strong. I meant incorrect in reproducing the original KPSS formulae.
6c86c63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for clarifying! Reasonable to stick with the original paper.
6c86c63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mitchell, I remember now why this default is problematic. If you run the Log AirPassengers you get:
(2,0,0) (0,1,1) instead of the textbook (0,1,1) (0,1,1).
It’s only one data set but it’s a very important dataset, so you might want to discuss with Rob. Maybe an easy way to switch?