Processing math: 100%
Skip to contents

We want to derive a random variable describing the age of the youngest infection (AoY). The derivations are presented below:

We compute the distribution function first:

FY(a)1emτ(a)FA(α,a,τ)1emτ(a)=1emτ(a)FA(α,a,τ)pτ(a)

We differentiate to get a formula for the density function:

Yτ(a)fY(α;a,τ)=fA(α,a,τ)emτ(a)FA(α,a,τ)mτ(a)pτ(a)

The mean AoY is:

Yτ(a)=a0αfY(α,a,τ)dα

And the higher order moments for the AoY are:

Yτ(a)n=n0αnfy(α,a,τ)dα

AoY Density

aoy = dAoY(1:1825, 5*365, foiP3)
raoy = rAoY(10^5, 5*365, foiP3)
hist(raoy, breaks=c(0:(5*365)), right=F, plot=F)->daoy
plot(daoy$mids, daoy$density, type = "l")
lines(1:1825, aoy, type = "l", col = "red") 

Moments

aa = seq(5, 5*365, by = 5) 
moment1y = momentAoY(aa, foiP3)
moment2y = momentAoY(aa, foiP3, n=2)
moment3y = momentAoY(aa, foiP3, n=3)

The first three moments of the AoY plotted over time. In the top plot, we’ve also plotted the nth root of the nth moment.

par(mfrow = c(4,1), mar = c(0.5, 4, 0.5, 2))
plot(aa, moment1y, type = "l", xlab = "", ylab = expression(E(Y)), lwd=2, xaxt="n", ylim = range((moment3y)^(1/3)) ) 
lines(aa, sqrt(moment2y), col = "darkgreen")
lines(aa, (moment3y)^(1/3), col = "purple")
plot(aa, moment2y, type = "l", xlab = "", ylab = expression(E(Y^2)), lwd=2, xaxt="n", col = "darkgreen") 
plot(aa, moment3y, type = "l", xlab = "", ylab = expression(E(Y^2)), lwd=2, col = "purple") 
mtext("Age (in Days)", 1, 3)

Derivation

First, we note that the CDF for the minimum of n random values of AoI in some cohort is:

1(1FA(α,a,τ))n Using this, we can compute the CDF for the full distribution of AoY across the population:

FY(α,a,τ)=1pτ(a)ζ>0dpois(ζ,mτ(a))(1(1FA(α,a,τ))ζ)

or rewriting slightly:

FY(α,a,τ)pτ(a)=ζ>0mτ(a)ζζ!emτ(a)(1(1FA(α,a,τ))ζ)

pulling out emτ(a) and recombining terms, we get:

FY(α,a,τ)pτ(a)=pτ(a)emτ(a)ζ>0[mτ(a)(1FA(α,a,τ))]ζζ! if the sum were from ζ=0, the expression on the inside would be simple, but the sum is for M>0, so we add the term for M=0 into the sum, subtract it outside:

FY(α,a,τ)pτ(a)=pτ(a)emτ(a)(1+ζ>=0[mτ(a)(1FA(α,a))]ζζ!)

but emτ(a)=1pτ(a) and the infinite sum is simply an exponential, so:

FY(α,a,τ)pτ(a)=pτ(a)+1pτ(a)emτ(a)emτ(a)(1FA(α,a,τ)) so

FY(α,a,τ)pτ(a)=1emτ(a)Fa(α,a)

and

FY(α,a,τ)=1emτ(a)FA(α,a,τ)pτ(a).

The PDF for the AoY is found by taking the derivative of FY:

YfY(α,a,τ)=dFY(α,a,τ)dα=fA(α,a)emτ(a)FA(α,a,τ)mτ(a)pτ(a)