| 1 |
skip_on_cran() |
| 2 |
|
| 3 |
skip_if_not_installed("modeltests") |
| 4 |
library(modeltests) |
| 5 |
|
| 6 |
fit1 <- arima(lh, order = c(1, 0, 0)) |
| 7 |
|
| 8 |
fit2 <- arima( |
| 9 |
USAccDeaths, |
| 10 |
order = c(0, 1, 1), |
| 11 |
seasonal = list(order = c(0, 1, 1)), |
| 12 |
method = "CSS" |
| 13 |
) |
| 14 |
|
| 15 |
test_that("Arima tidier arguments", { |
| 16 |
check_arguments(tidy.Arima) |
| 17 |
check_arguments(glance.Arima) |
| 18 |
}) |
| 19 |
|
| 20 |
test_that("tidy.Arima", { |
| 21 |
td1 <- tidy(fit1, conf.int = TRUE) |
| 22 |
force(td1) |
| 23 |
check_tidy_output(td1) |
| 24 |
check_dims(td1, 2, 5) |
| 25 |
|
| 26 |
td2 <- tidy(fit2) |
| 27 |
check_tidy_output(td2) |
| 28 |
check_dims(td2, 2, 3) |
| 29 |
}) |
| 30 |
|
| 31 |
test_that("glance.Arima", { |
| 32 |
gl1 <- glance(fit1) |
| 33 |
gl2 <- glance(fit2) |
| 34 |
|
| 35 |
check_glance_outputs(gl1, gl2, strict = FALSE) |
| 36 |
}) |