| 1 |
skip_if_not_installed("modeltests") |
| 2 |
suppressPackageStartupMessages(library(modeltests)) |
| 3 |
|
| 4 |
suppressMessages(skip_if_not_installed("tseries")) |
| 5 |
suppressPackageStartupMessages(library(tseries)) |
| 6 |
|
| 7 |
dax <- diff(log(EuStockMarkets))[, "DAX"] |
| 8 |
fit <- garch(dax, control = garch.control(trace = FALSE)) |
| 9 |
|
| 10 |
test_that("tseries tidier arguments", { |
| 11 |
check_arguments(tidy.garch) |
| 12 |
check_arguments(glance.garch) |
| 13 |
}) |
| 14 |
|
| 15 |
test_that("tidy.garch", { |
| 16 |
td <- tidy(fit) |
| 17 |
check_tidy_output(td) |
| 18 |
check_dims(td, 3) |
| 19 |
|
| 20 |
td <- tidy(fit, conf.int = TRUE, conf.level = .99) |
| 21 |
check_tidy_output(td) |
| 22 |
check_dims(td, 3, 7) |
| 23 |
}) |
| 24 |
|
| 25 |
test_that("glance.garch", { |
| 26 |
gl <- glance(fit) |
| 27 |
check_glance_outputs(gl) |
| 28 |
check_dims(gl, 1, 8) |
| 29 |
}) |