Theoretical background for epichains
Sebastian Funk and James Azam
Source:vignettes/theoretical_background.Rmd
theoretical_background.Rmd
epichains provides methods to analyse and simulate the size and length of branching processes with an arbitrary offspring distribution. In this vignette we lay out the mathematical concepts behind the functionality available in the package.
Branching processes
Branching processes are a class of models that are used to model the growth of populations. They assume that each member of the population produces a number of offspring, , that is a random variable with probability mass function , called the offspring distribution. Their use has a long history in epidemiology, where the population is interpreted as a pathogen, and the offspring as new hosts that it infects (Farrington, Kanaan, and Gay 2003). Below we will call these infected individuals cases but the methods could be applied in other contexts where branching processes are to be used.
Simulation
To simulate from a branching process, we start with a single case and proceed in discrete steps or generations, drawing from the offspring distribution to generate new cases from each case.
Given an infector and infectee , we can additionally assign them a distribution of times that approximates when the infection event occurred. If we define as a random variable with distribution we can assign each case a time which, if case has been affected by case is given by . If we identify the timing of cases by the time of their symptom onset this is the serial interval, but depending on case definitions this could be another interval.
Summary statistics
Branching process simulations end when they have gone extinct, that is, no more offspring are being produced, or because of some stopping criterion. To summarise the simulations, we either study the size or length of the resulting chain of cases. The size of a chain is the number of cases that have occurred over the course of the simulation including the initial case so that . The length of a chain is the number of generations that have been simulated including the initial case so that .
Inference
By characterising a chains of cases by their size of length we can conduct inference to learn about the underlying parameters from observation of chain sizes or chain lengths (Blumberg and Lloyd-Smith 2013). In general this is only possible for subcritical branching processes, i.e. ones where the mean number of offspring is less than 1, as otherwise the branching process could grow forever. However, we can expand the theory to supercritical branching processes, i.e. ones where the mean number of offspring is greater than 1, by defining a cut off of chain size or length beyond which we treat the chain as if it had infinite size or length, respectively.
Size and length distributions for some offspring distributions
We show the equations for the size and length distributions for some offspring distributions where they can be derived analytically: Poisson, negative binomial, geometric, and a gamma-Borel mixture.
Negative binomial and special cases
If the offspring distribution is a Poisson distribution, we can interpret its rate parameter as the basic reproduction number of the pathogen. In the more general case where the offspring definition can be overdispersed leading to superspreading we can use a negative binomial offspring distribution with mean and overdispersion Blumberg and Lloyd-Smith (2013). In that case, the mean parameter is interpreted as the basic reproduction number of the pathogen. The negative binomial distribution arises from a Poisson-gamma mixture and thus a branching process with negative binomial distributed offspring can be interpreted as one with Poisson distributed offspring where the basic reproduction number itself varies according to a gamma distribution. The amount of variation in is then interpreted as individual-level variation in transmission representing overdispersion or superspreading, and the degree to which this happens is given by the overdispersion parameter .
Size distributions
The probability of a chain of size given and in a branching process with negative binomial offspring distribution is given in Eq. 9 of Blumberg and Lloyd-Smith (2013)
where is the gamma function. In order to estimate from a given and we can define a likelihood function . The corresponding log-likelihood is
The log-likelihood for Poisson distributed offspring follows from this where tends to infinity (corresponding to Eq. 2.2 in Farrington, Kanaan, and Gay (2003))
In all cases the point estimate for the basic reproduction number is related to the mean chain size by
Length distributions
The cumulative mass function of observing a chain of length when offspring is Poisson distributed is given by Eq. (2.5) in Farrington, Kanaan, and Gay (2003) (there called “outbreak duration”):
where is the iterated exponential function, , .
For geometric distributed offspring (corresponding to a negative Binomial with ) this function is given by
In both cases denotes cumulative mass functions and therefore the probability of observing a chain of length is therefore .
Gamma-Borel mixture
The probability distribution of outbreak sizes from a branching process with a Poisson offspring distribution (Eq. 2.2 in Farrington, Kanaan, and Gay (2003)) is a special case of the Borel-Tanner distribution starting with 1 individual. An alternative to the negative binomial offspring distribution which represents a Poisson-gamma mixture is a Borel-gamma mixture. This could represent situations where the variation is not at the individual level but at the chain level, i.e. transmission chains is homogeneous but there is heterogeneity between chains. In that case, it can be shown that the resulting log-likelihood of chain sizes is
Numerical approximations of chain size and length distributions
When analytic likelihoods are not available a numerical approximation is used to derive the distributions. In order to do this, the simulation functionality is be used to generate simulated chains and the value of the cumulative mass function at the observed approximated by the empirical cumulative distribution function: where is the indicator function and the i-th observed chain size (or length, if the interest is in ). In order to improve this approximation a linear approximation is applied to the values of the empirical distribution function (at the expense of normalisation to 1).
The (unnormalised) probability of observing is then given by and a an equivalent relationship is used for .