Plot a SEIR model projection

plot_projection(
  pred_dat,
  obs_dat,
  col = "#377EB8",
  value_column = "value",
  date_column = "day",
  ylab = "Reported cases",
  Rt = NULL
)

plot_residuals(
  pred_dat,
  obs_dat,
  obj,
  value_column = "value",
  date_column = "day",
  type = c("raw", "quantile"),
  ylab = if (type == "raw") "Residual" else "Quantile residual",
  date_function = lubridate::ymd,
  return_residuals = FALSE
)

Arguments

pred_dat

Output from tidy_seir().

obs_dat

A data frame of observed data. Should have a column of day and value that matches pred_dat. If using multiple data types, should also have data_type.

col

Colour for the line and ribbon.

value_column

Column in obs_dat that contains the reported cases.

date_column

Date or day column name. A column by this name must be in obs_dat and pred_dat. Note that tidy_seir() will return a data frame with day in it. If you want dates then you will need to add such a column.

ylab

Y axis label.

Rt

An optional vector of Rt values to colour the plot by.

obj

Outut from fit_seir().

type

Raw (observed - expected) or quantile residuals (covidseir:::qres_nbinom2)?

date_function

A function to translate the character representation of

return_residuals

Return residuals instead of plot?

Value

A ggplot object

Details

See project_seir() for an example.

Examples

# See ?project_seir