fit_jags_aggreg: Fit JAGS model to aggregated data

View source: R/agg_to_daily.R

fit_jags_aggregR Documentation

Fit JAGS model to aggregated data

Description

Fit JAGS model to aggregated data

Usage

fit_jags_aggreg(obs.times, Y, g, N, n.days = NULL, prm.daily, silent = FALSE)

Arguments

obs.times

Numeric. Vector of observation times.

Y

Numeric. Vector of aggregated counts.

g

Numeric. Vector of discretized generation interval density.

N

Numeric. Scalar population size.

n.days

Numeric. Total number of days. if NULL, use max(obs.times)

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.


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