Processing math: 80%
Skip to contents

We have developed a hybrid model that we can use to compute the mean and higher order moments for the age of infection (AoI). In a related vignette (AoI), we define the AoI as a random variable and develop functions to compute its moments. Here, we develop a notation for the moments:

Let x=A; x is the first moment of the AoI in a cohort at age a, conditioned on a history of exposure, given by a function h. In longer form: xτ(a;h)=Aτ(a;h)=0αzτ(α,a;hτ(a))mτ(a;hτ(a)) Here, we show that:

dxda=1hmx

Similarly, we let x[n]=An denote the higher order moments of the random variable A. In longer form: xn(a,τ;h)=0αnzτ(α,a;hτ(a))mτ(a;hτ(a)) We show that higher order moments can be computed recursively:

dx[n]da=nx[n1]hmx[n]

In the following, we first demonstrate that the hybrid equations give the same answers as direct computation of the moments.

Hybrid Model

The function solve_dAoI computes the first three moments of the AoI by default. Here we plot the nth root of the first three moments.

par(mar = c(7, 4, 2, 2))
solve_dAoI(5/365, foiP3) -> mt 
plot(mt$time, mt$xn1, type = "l", xlab = "Age (in Days)", ylab = expression(list(x, sqrt(x[paste("[2]")]), sqrt(x[paste("[3]")], 3))), ylim = range(mt$xn3^(1/3))) 
lines(mt$time, mt$xn2^(1/2), col = "purple")
lines(mt$time, mt$xn3^(1/3), col = "darkgreen") 

## Numerical Verification

aa = seq(1, 5*365, by = 5) 
moment1 = momentAoI(aa, foiP3)
moment2 = momentAoI(aa, foiP3, n=2)
moment3 = momentAoI(aa, foiP3, n=3)
  1. By solving a hybrid model with variables that track the moments, using the equations that we derived above:
solve_dAoI(5/365, foiP3, Tmax = 5*365, dt=5) -> mt 
par(mfrow = c(2,2), mar = c(7, 4, 2, 2))
# Top Left
plot(mt$time, mt$xn1, type = "l", xlab = "Age (in Days)", ylab = expression(x), lwd=3) 
lines(aa, moment1, col = "yellow", lwd=2, lty=2) 
# Top Right 
plot(mt$time, mt$xn2, type = "l", xlab = "Age (in Days)", ylab = expression(x[paste("[2]")]), lwd=3, col = "purple") 
lines(aa, moment2, col = "yellow", lwd=2, lty=2)
plot(mt$time, mt$xn3, type = "l", lwd=3, col = "darkgreen",
     xlab = "Age (in Days)", ylab = expression(x[paste("[3]")]))
lines(aa, moment3, col = "yellow", lwd=2, lty=2)
par(mar = c(7, 4, 2, 2))
solve_dAoI(5/365, foiP3) -> mt 
plot(mt$time, mt$xn1, type = "l", xlab = "Age (in Days)", ylab = expression(list(x, sqrt(x[paste("[2]")]), sqrt(x[paste("[3]")], 3))), lwd=3, ylim = range(mt$xn3^(1/3))) 
lines(mt$time, mt$xn2^(1/2), col = "purple", lwd=3)
lines(mt$time, mt$xn3^(1/3), col = "darkgreen", lwd=3) 
lines(aa, moment1, col = "yellow", lwd=2, lty=2)
lines(aa, moment2^(1/2), col = "yellow", lwd=2, lty=2)
lines(aa, moment3^(1/3), col = "yellow", lwd=2, lty=2)

Derivation for dx/da

In Dynamics, we present an equation for zτ(α,a), the density function for infections of age α in a host cohort of age a born on day τ. The dynamics of z(α,a) are described by the following:

za+zα=rz

with the boundary condition:

zτ(0,a)=hτ(a)

and its solutions are:

zτ(α,a)=hτ(aα)erα

In MoI, we defined the distribution function for the MoI:

Mτ(a)fM(ζ;a,τ)=Pois(mτ(a))

and we showed that the mean MoI, mτ(a) is:

mτ(a)=a0zτ(α,a)dα

In AoI, we defined a probability density function for the AoI:

Aτ(a)fA(α;a,τ)=zτ(α,a)mτ(a)

Here, we derive an equation for dxda=dAda

We start by multiplying Eq. 1 by α and integrating with respect to α:

a0αz(α,a)adα+a0αz(α,a)αdα=ra0αz(α,a)dα,

By its definition,

a0αz(α,a)dα=Am

So we can simplify a bit:

Amadα+a0αz=rAm

On the RHS of Eq. 2, the first term can be rewritten:

Ama=mAa+Ama

On the RHS of Eq. 2, the second term can be rewritten by integrating by parts:

a0αz=αz(a,α)|α=aαz(a,α)|α=0a0zdα

which simplifies to:

a0αz=ahd(0)eram

Substituting, we get:

mAa+Ama+ahd(0)eram=rAm

We divide through by m and rearrange to get:

Aa=Ammaamhd(0)era+1rA

We substitute dm/da=hrm and simplify:

Aa=Am(hrm)amhd(0)era+1rA

and after rearranging terms and cancelling:

Aa=1hAmamhd(0)era

or since we are letting x=A dxda=1hmxamhd(0)era

I can’t remember why that last term goes away

Noting that: lim

Derivation for dx_n/da

To derive a tracking equation for \left<A^n \right>, we start as before but multiply by \alpha^n to get:

\begin{equation} \int_0^a \alpha^n \frac{\partial z}{\partial a} \partial \alpha + \int_0^a \alpha^n \frac{\partial z}{\partial \alpha} \partial \alpha = \int_0^a - r \alpha^n z \partial \alpha \end{equation} which we can rewrite as: \begin{equation} \frac{\partial \left<A^n \right> m}{\partial a} + \int_0^a \alpha^n \partial x = - r \left<A^n\right> m \end{equation}

Integrating the middle term by parts,

\begin{equation} \int_0^a \alpha^n \partial z = \alpha^n z(a,\alpha) \big|_{\alpha = 0}^{a} - n \int_0^a \alpha^{n-1} z d\alpha \end{equation}

so we can rearrange this to get Eq.~\ref{dAnda}. Once again, we are concerned with the limits as m becomes small:

\begin{equation} \lim_{m\rightarrow 0} \frac{A}{m} = \lim_{m\rightarrow 0} \frac{a}{m} = 1 \end{equation}