What would you expect from this feature's output?
Issue with this series is that it drops to zero after 12 observations.
#> Loading required package: fabletools
#> #> Attaching package: 'dplyr'#> The following objects are masked from 'package:stats':#> #> filter, lag#> The following objects are masked from 'package:base':#> #> intersect, setdiff, setequal, unionPBS %>%
filter(ATC2=="D04", Concession=="General", Type=="Co-payments") %>%
#> Warning in summary.lm(fit): essentially perfect fit: summary may be unreliable#> # A tibble: 1 x 5#> Concession Type ATC1 ATC2 stat_arch_lm#> <chr> <chr> <chr> <chr> <dbl>#> 1 General Co-payments D D04 NaN
I also noticed that the condition is length(x) <= 13, shouldn't this be lag+1? This is something copied over from tsfeatures.
Further, do you think a better handling of default lags would be useful for small sample sizes?
Yes, that it should be lags+1. I'm not familiar with this test (and I didn't write the code) so I'm not sure what is recommended for small sample sizes. I'm also not sure where the default of 12 came from. The original paper is Engle (1982) [https://www.jstor.org/stable/1912773].