tests/testthat/test-enw_add_latest_obs_to_nowcast.R

test_that("enw_add_latest_obs_to_nowcast can link nowcasts with more recent observations", { # nolint: line_length_linter.
  fit <- enw_example("nowcast")
  obs <- enw_example("obs")
  nowcast <- summary(fit, type = "nowcast", probs = c(0.05, 0.5, 0.95))
  nowcast <- enw_add_latest_obs_to_nowcast(nowcast, obs)
  expect_snapshot(
    round_numerics(nowcast[, c("rhat", "ess_bulk", "ess_tail") := NULL])
  )
})
epiforecasts/epinowcast documentation built on Feb. 3, 2025, 4:17 p.m.