pad_inf_chain: Pad infection history chain

View source: R/helpers.R

pad_inf_chainR Documentation

Pad infection history chain

Description

Given that the MCMC sampler only stores present infections (ie. there are no entries for 0s from the infection history matrix), for some summaries we need to add these 0s back in to avoid bias.

Usage

pad_inf_chain(inf_chain, pad_by_group = FALSE, times = NULL, indivs = NULL)

Arguments

inf_chain

the data table with infection history samples from serosolver

pad_by_group

if TRUE, accounts for population group when expanding

times

if not NULL, uses this as a vector of times to replace j when expanding to all combinations

indivs

if not NULL, uses this as a vector of individuals to replace i when expanding to all combinations

Value

the same inf_chain that was passed in, but with 0s for missing i/j/samp_no combinations


adamkucharski/serosolver documentation built on June 12, 2025, 9:08 a.m.