tidyverts / feasts

Feature Extraction And Statistics for Time Series
https://feasts.tidyverts.org/
292 stars 23 forks source link

ndiffs inconsistency with forecast #40

Closed mitchelloharawild closed 5 years ago

mitchelloharawild commented 5 years ago
library(feasts)
#> 
#> Attaching package: 'feasts'
#> The following object is masked from 'package:grDevices':
#> 
#>     X11
as_tsibble(WWWusage) %>% 
  features(value, unitroot_ndiffs)
#> # A tibble: 1 x 1
#>   value_ndiffs
#>          <int>
#> 1            0
forecast::ndiffs(WWWusage)
#> [1] 1

Created on 2019-04-29 by the reprex package (v0.2.1)

mitchelloharawild commented 5 years ago

@robjhyndman This is due to the default lag choice in urca::ur.kpss().

forecast uses the old tseries default of trunc(3*sqrt(length(x))/13), and fable uses the current urca default of trunc(4 * (n/100)^0.25).

Relevant discussions:

robjhyndman commented 5 years ago

Hmm. Another example where the urca defaults lead to a clearly incorrect result.