Skip to content

non-continuity between the estimated and forecast growth rate credible intervals #710

@avallecam

Description

@avallecam

Summary:
CRAN version 1.4.0 and CRAN version 1.5.2 generate different figures from growth rate estimates.

Description:

image (4)

  • LEFT: the credible intervale in the orange "estimate based on partial data" range increases towards Apr 27, and then the Forecast extends this uncertainty in the same magnitude range.
  • RIGHT: the credible intervals in the same orange range have a higher range, but the Forecast does not seem to follow the uncertainty of the previous days.

This is currently visible in the tutorial episode but not in the reference manual.

Reproducible Steps:

With the code below, you can reproduce the figure.

library(EpiNow2)
library(cfr)
library(tidyverse)

withr::local_options(list(mc.cores = 4))

## generation time ------------------------------------------------

covid_serialinterval_epinow <- EpiNow2::LogNormal(
  meanlog = 1.39,
  sdlog = 0.57,
  max = 15
)

covid_serialinterval_epinow

# data 01 - 1:60 -----------------------------------------------------------------

data01_time02 <- EpiNow2::example_confirmed %>% 
  dplyr::slice(1:60)

## 00 delays -------------------------------------------------------

data01_time02_delays00 <- EpiNow2::epinow(
  # cases
  data = data01_time02,
  # delays
  generation_time = EpiNow2::generation_time_opts(covid_serialinterval_epinow),
  # stan 
  stan = EpiNow2::stan_opts(samples = 1000, chains = 2)
)

plot(data01_time02_delays00$plots$growth_rate) 

EpiNow2 Version:

packageVersion(pkg = "EpiNow2")
#> [1] '1.5.2'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions