plot_simobs_beta: Visualize observational data, simulated epidemic and...

View source: R/plot.R

plot_simobs_betaR Documentation

Visualize observational data, simulated epidemic and transmission rate.

Description

Plot the observed data and the simulated epidemic generated from the initial parameter values. Also plot the time-varying transmission rate. This function is typically used to check an initial guess for priors (e.g., transmission rate (beta), wastewater scaling factor (ww.scale)) before launching the procedure that fits selected model parameters to data.

Usage

plot_simobs_beta(
  data,
  prm,
  include.cases = TRUE,
  include.ww = TRUE,
  include.hosp = FALSE,
  log.scale = FALSE,
  time.range = NULL
)

Arguments

data

Data object (list) as returned by wem::build_data()

prm

List of all parameter values.

include.cases

Logical. Display observations of reported cases?

include.ww

Logical. Display observed viral concentration in wastewater?

include.hosp

Logical. display hospital observations?

log.scale

Logical. Use log scale?

time.range

Numerical vector. Minimum and maximum values for the x axis.

Value

A ggplot2 object.

Examples

# Load data sets examples from `wem` package:
data('cases')
data('hosp')
data('wwviralconc')

# Build the data object:
dat = build_data(cases = cases, 
                 hosp = hosp, 
                 ww = wwviralconc, 
                 hosp.type = 'hosp.adm', 
                 case.date.type = 'report')

# Load example of model parameters
prm = model_prm_example()

# Plot data, simulation and 
# time-dependent transmission rate (beta)
g = plot_simobs_beta(data          = dat,
                     prm           = prm,
                     include.cases = TRUE,
                     include.ww    = TRUE,
                     include.hosp  = FALSE,
                     log.scale     = FALSE,
                     time.range    = NULL)
plot(g)


phac-nml-phrsd/wem documentation built on June 6, 2024, 11:06 p.m.