generate_obs_noise: Generate observation noise

View source: R/simul.R

generate_obs_noiseR Documentation

Generate observation noise

Description

Generate observation noise on the reported values for clinical cases (variable 'report') and concentration in wastewater (variable 'WWreport'). The observations are generated by drawing samples from a negative binomial distribution with mean the value from the deterministic model and a variance parametrized using the coefficient of variation (std. dev / mean).

Usage

generate_obs_noise(df, prms = list(cv = 0.1, cv.ww = 0.1))

Arguments

df

Dataframe. The time series of the epidemiological variables generated by the function wem::simul(...)$ts.

prms

List of parameters. Must contain elements named cv and cv.ww to inform the desired coefficient of variation of the added noise for clinical reports and concentration in wastewater, respectively.

Value

The input dataframe with three additional variables, report.obs, hosp.admission.obs and WWreport.obs, representing the simulated observations of the variables report, hosp.admission and WWreport.

Examples

prm = model_prm_example() 
sim = simul(prm)
df = generate_obs_noise(sim$ts) 
plot(x=df$time, y=df$report.obs) ; lines(x=df$time, y=df$report)


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