attach_t_agg: Attach time index (number of days) column. Exclude first day...

View source: R/agg_to_daily.R

attach_t_aggR Documentation

Attach time index (number of days) column. Exclude first day since we don't necessarily know over which period of time that data was aggregated

Description

Attach time index (number of days) column. Exclude first day since we don't necessarily know over which period of time that data was aggregated

Usage

attach_t_agg(cl.data, prm.daily = NULL, silent = FALSE)

Arguments

cl.data

Data frame. Must have variables:

  • date: calendar date of report

  • value: count of reported cases

prm.daily

List. Parameters for daily report inference via MCMC. Elements include:

  • method: String. Method name to infer the daily incidence reports from aggregated ones. Either linear or renewal is currently implemented. The linear method simply performs a linear interpolation that matches the aggregated values. The renewal method fits a SIR-like model using a renewal equation to infer the daily incidence. In this case, the fitting algorithm is a Markov Chain Monte Carlo (MCMC) implemented in JAGS and needs the parameters below (e.g., burn,iter,chains,...). The renewal method is more adapted for short single wave epidemics as this models i) naturally fits a single wave and ii) has longer computing time. For longer time series, user may perfer the linear method.

  • popsize: Integer. Population size to use in MCMC simulation to infer daily observations from aggregated input data.

  • burn: Numeric. Length of burn-in period (number of days).

  • iter: Numeric. Number of iterations after burn-in period (number of days).

  • chains: Numeric. Number of chains to simulate.

  • prior_R0_shape: Shape of the (hyper-)parameter for the prior Gamma distribution for R0.

  • prior_R0_rate: Rate of the (hyper-)parameter for the prior Gamma distribution for R0.

  • prior_alpha_shape: Shape of the (hyper-)parameter for the prior Gamma distribution for alpha.

  • prior_alpha_rate: Rate of the (hyper-)parameter for the prior Gamma distribution for alpha.

  • first.agg.period: length of aggregation period for first aggregated observation (number of days); if NULL, assume same aggregation period as observed for second observation (gap between first and second observations)

silent

Logical. Flag to suppress all output messages, warnings, and progress bars.

Value

Data frame


ern documentation built on April 4, 2025, 2:13 a.m.