new_infection: Generate Infections

Description Usage Arguments Value

View source: R/ABM_funcs.R

Description

Generate new infections given contact matrix and indices of people who are infectious. Restricts the contact matrix ('contact.mat') to include only those columns corresponding to infectious people based on 'inf.ind' Then goes through each row and performs a bernoulli trial based on the transmission probability in each cell Equivalent to a chance of infection for every contact if contact exists (else the cell is 0)Returns a vector of row indicies corresponding to new infections to enter the E compartment Infection multiplier allows alteration of the infection probability, e.g. if contacts are with asymptomatics and want to model reduced infectiousness

Usage

1
new_infection(contact.mat, inf.ind, inf.multiplier)

Arguments

contact.mat

matrix representing contact network where entries are transmission probabilities

inf.ind

indices of individuals who are infectious. Matrix will be subset to these columns to simulate infectious contacts

inf.multiplier

multiplier to apply to the infection probabilities in the matrix e.g. to simulate reduction in infectiousness among asymptomatic individuals

Value

vector of indicies of new infections (e.g. people who have moved from S to E)


cmhoove14/matrixbasedABM documentation built on July 22, 2021, 3:08 p.m.