Herd Immunity

"If we imagine the action of a vaccine not just in terms of how it affects a single body, but also in terms of how it affects the collective body of a community, it is fair to think of vaccination as a kind of banking of immunity. Contributions to this bank are donations to those who cannot or will not be protected by their own immunity. This is the principle of herd immunity, and it is through herd immunity that mass vaccination becomes far more effective than individual vaccination."
― Eula Biss, On Immunity: An Inoculation
As every kid in elementary school, me and my brother, we both had to go to the pharmacy to get vaccinated for flu every September. I remember the time very clearly, because it was the most clear sign of the end of nice, warm summer, and the beginning of the new school semester. I also remember that we had this interesting lady living next door, who believed that people don't need drugs to get better or fight with diseases (still don't know if this is true or not, maybe she has a point). As a result, she never got her kids vaccinated. Every year, me and my brother, with approximately every kid in the neighbourhood, went through a horrible week after vaccination, but the kids next door, didn't. And they also never caught the flu. So I don't know if their mother was right, or if it is related to the concept that I wanna to talk about in this post, herd immunity. Although I am still not sure, I will begin with the option that I know better :)

Before I introduce the concept of herd immunity, I would like to start with how to model an epidemic, like flu, including vaccination. There is a very detailed article on Wikipedia, which discusses the compartmental models in epidemiology, so if you're interested in different kind of models as well, this might be a good start.

Back to the matter at hand, how would you model an epidemic? Although this is a very hard question to address, and there are hundreds of different ways to approach it, let us begin with the basics. In case of a flu epidemic, how would you categorize people in a population? Basically you would observe two types of people : sick or not. But notice that a person might be healty because she has a mother like I have, which means she got vaccinated, or she has a mother like my neigbours had, which means she basically recovered by herself. Or she may not even caught the flu at all! So if we take a closer look, there are actually three types of people that seem healthy,

º Susceptibles (\(S\)): These individuals are not infected yet, but not immune to the disease either.

º Recovered individuals (\(R\)): These indivuals are recovered from the disease without vaccination, therefore they're immune to the disease, but they can also lose immunity.

º Vaccinated individuals (\(V\)): These indivuals are recovered from the disease by vaccination, they're immune to the disease, but they can lose immunity as well.

What about the sick ones? If you think about it, you have only one class of sick people, which we will call the Infecteds, denoted by \(I\). To be honest, vaccines are not perfect as well, so you may get infected although you got vaccinated, but we will discuss this later.

As a result, we have four compartments to work with : \(S\), \(I\), \(R\), and \(V\). The diagram of this model is given in Figure 1.

Generally, a simple model with only \(S\), \(I\), and \(R\) compartments is called and SIR Model, but since we consider the loss of immunity, i.e., the chance of going back to \(S\) compartment from \(R\), the model becomes an SIRS Model. Finally adding the vaccination component, our model will be called an SIRS model with vaccination. Model parameters and their descriptions are given in Table 1.

parameter description parameter description
\(\Lambda\) Influx rate of susceptibles
(birth or immigration)
\(\delta_{S}\) Death rate of susceptibles
(same for vaccinated individuals)
\(\beta\) Transmission rate
of infection
\(\delta_{I}\) Death rate of
infected individuals
\(r\) Rate of recovery \(\delta_{R}\) Death rate of
recovered individuals
\(q\) Rate of loosing immunity
for recovered individuals
\(v\) Rate of vaccination
\(q_{v}\) Rate of loosing immunity
for vaccinated individuals
Table 1 : Parameters and their descriptions for the SIRS model with vaccination.


Mathematically, we can represent Figure 1 as an ODE system which can be written as follows, \begin{align*} dS / dt &= \Lambda -\beta S I - \delta_{S} S + q_{v} V -v S + q R, \nonumber \\ dI / dt &= \beta S I - \delta_{I}I -r I, \nonumber \\ dR / dt &= r I - \delta_{I}I - q R, \nonumber \\ dV / dt &= v S - \delta_{S} V - q_{v} V, \nonumber \end{align*}
which give us information about how the densities (not absolute numbers\(^{1}\)) in each compartment changes over time.

At this point, one needs to recall that this is a model which includes infected and recovered individuals, whom can only appear in case of an epidemic. But birth, death, immigration, emmigration, and also vaccination, are all present before the epidemic kicks in. So before further derivation, we will assume that the system is initially at its steady state (which makes sense because of the time difference between epidemics) in the absence of a disease, which is called disease free equilibrium (It's actually a quite nice equilibrium because there is an analytical solution!)

At the disease free equilibrium, we will only have vaccinated and susceptible individuals, and their densities will not change over time (because it's an equilibrium). Mathematically speaking, we will have \begin{align} dS_{f} / dt & = 0, \label{eq:f1} \\ dV_{f} / dt & = 0, \label{eq:f2} \\ I_{f} &=0, \label{eq:f3} \\ R_{f} &=0. \label{eq:f4} \end{align} where the subscript \(f\) denotes the densities at the disease free equilibrium. All we need to do now is to calculate \(S_{f}\) and \(V_{f}\) using Equations \eqref{eq:f1} - \eqref{eq:f4}. I leave you the derivations, which I am sure you will do, and quickly come to the conclusion, which is \begin{align} S_{f} & = \frac{\Lambda}{\delta_{S}} \frac{\delta_{S} + q_{v}}{\delta_{S}+v+q_{v}}, \label{eq:sf} \\ V_{f} & = \frac{v}{\delta_{S}+q_{v}}S_{f}. \nonumber \end{align} Now let's go back to the original question : Why all the kids at school, even though some of them (like my neighbours) are not vaccinated, recover from flu at some point? Why the epidemic dies out?

In order to say that an epidemic died out, we shouldn't have any infected people when the ODE system converges to an equilibrium again, after the infection has started. So we need a decrease in the density of \(I\) through time, i.e., \(dI / dt < 0\). Which yields to, \begin{align} dI / dt < 0, \nonumber \\ \beta S_{f} I - \delta_{I}I -r I < 0, \nonumber \\ I (\beta S_{f} - \delta_{I} -r ) < 0. \label{eq:didt} \end{align} Now imagine the very beginning of an epidemic. The number of infected individuals will be arbitrarily small, but greater than zero as well. Which means \(I\) can't be lower than zero in Equation \eqref{eq:didt}. As a result, \(\beta S - \delta_{I} -r \) must be lower than zero for Equation \eqref{eq:didt} to hold. This means that for an epidemic to die out, \(S_{f}\) must be lower than \(\frac{\delta_{I}+r}{\beta}\), which allows us to calculate the critical number of susceptibles, \begin{align} S_{crit} = \frac{\delta_{I}+r}{\beta}. \label{eq:sc1} \end{align} Thus, Equation \eqref{eq:sc1} tells us that vaccination needs to recude the number of susceptibles below a critical value, which is \(S_{crit}\). Note that we only have significant amount of susceptible and vaccinated individuals (number of infected individuals are arbitrarily small) at this point, which means the whole population is consisted of \(S\) and \(V\). As a result, if the overall population density in the absence of infection is given by \(N\), the minimum number of individuals that must be vaccinated is equal to \(V_{crit} = N - S_{crit}\).

By using Equation \eqref{eq:sc1}, we can also calculate the minimum proportion of individuals we should vaccinate at the beginning of the epidemic, which is, \begin{align} p_{crit} =\frac{V_{crit}}{N} = \frac{N-S_{crit}}{N} = 1-\frac{S_{crit}}{N} = 1-\frac{1}{R_{0}}, \label{eq:pc1} \end{align} where \(R_{0}\) denotes the basic reproduction number\(^2\) of the disease in a population that is not vaccinated.

So what does Equation \eqref{eq:pc1} tells us? It's not necessary to vaccinate the entire population to prevent the spread of the disease! Once the population of susceptibles falls below a critical level \((S_{crit})\), the entire population is protected against infection. This concept is called herd immunity, which is a property of the population, not the individual. So in case of a flu, indeed no suprise why some kids don't get sick at all, if most of the kids are vaccinated. On the other hand, in case of Malaria, \(p_{crit}\) is around \(99\%\), which explains why it is so hard to eradicate it.

How did the basic reproduction number changed with vaccination? Note that \(R_{0}\) is defined as the expected number of secondary infected hosts when one primary infected host is placed into a wholly susceptible population. But we don't have a wholly susceptible population anymore, instead, we have vaccinated individuals. So for a given vaccination proportion, \(p\), reproductive number in with vaccination will become, \begin{align} R_{p} = R_{0}(1-p). \label{eq:rp} \end{align} So far so good, if the vaccine is working with a \(100\%\) efficiency (yep, another thing to include in the model, they never end). Remember that at the very beginning of this post, I mentioned that you may still be susceptible, even though you got vaccinated. It simply means that the vaccine didn't work. So if we assign a probability for the success of vaccination, which we will call vaccine efficacy \(VE\), the proportion of people that are vaccinated will drop from \(p\) to \(pVE\), since \(VE\) is not assumed to be \(1\) (or the vaccine is not assumed to be perfect) anymore. As a result, Equation \eqref{eq:rp} becomes, \begin{align} R_{p} = R_{0}(1-pVE). \label{eq:rp2} \end{align} We always played with population densities and proportions so far. But going back to the flow chart given in Figure 1, where can we integrate the effect of \(p\) and \(VE\) in the model? As you may guess, the answer is vaccination rate \(v\). By using Equation \eqref{eq:sf} and substituting \(S\) with \(S_{crit}\), and \(v\) with \(v_{crit}\), we can write \begin{align} S_{crit} = \frac{\Lambda}{\delta_{S}} \frac{\delta_{S} + q_{v}}{\delta_{S}+ v_{crit}+q_{v}}. \label{eq:scrit} \end{align} which yields to, \begin{align} \Lambda - \delta_{S} S_{f} + q_{v} V -v_{crit} S_{crit} + q R = 0, \nonumber \end{align} Using Equation \eqref{eq:scrit} and \eqref{eq:sc1}, we can get a formula for \(v_{crit}\), which is, \begin{align} v_{crit} &= (\delta_{S}+q_{v})(\frac{\beta \Lambda}{(\delta_{I}+r)\delta_{S}}-1), \nonumber \\ v_{crit} &= (\delta_{S}+q_{v})(R_{0}-1). \label{eq:vc5} \end{align} Note that Equation \eqref{eq:vc5} is valid for the case of a perfect vaccine. If we include \(VE\) in Equation \eqref{eq:vc5}, we will have \begin{align} v_{crit} &= \frac{1}{VE}(\delta_{S}+q_{v})(R_{0}-1), \label{eq:vc2} \end{align} since the rate of vaccination has to increase due to the failed vaccination cases.

Of course not vaccinating everybody may generate some conflicts between interests of the individual and interests of the community. Due to the side effects of vaccines, (or other various reasons), some parents decide not to have their kids vaccinated. Anyway, I hope you enjoyed the concept though, and still convinced that you should get yourself or your kid vaccinated for the greater good :)

I will leave you with a toy that I've coded just because I love beautiful plots. There is a real time Runga Kutta 4 ODE solver below, which you can play with the parameters by using the sliders and see how the populations change through time. For every parameter set you choose, the disease free equilibrium is calculated first, and then the endemic is introduced to the system. Also, vaccine is assumed to be perfect (\(VE=1\)). You can see the values of \(R_{0}\), \(R_{p}\), and \(v_{crit}\) calculated for each set of parameters. Playing with \(v\) and setting it to a value below \(v_{crit}\) will give you a nice nonzero orange curve, which are the infected individuals due to lack of vaccination in your population. Setting \(v\) to \(v_{crit}\) will give you \(R_{p}=1\), which is the threshold for a disease to die out. Have fun! :)

Model Parameters,








For vaccination,
\(v_{crit}\) :
\(R_{p}\) :



Footnotes
1) This is important because the mass action kinetics apply to densities, not the absolute numbers. You can see this assumption in the term \(\beta SI \), where the overall transmission depends on the densities of \(S\) and \(I\) in a multiplicative way.

2) Sorry for not going into the details and derivation of \(R_{0}\), but it's a whole different story. I hope the wikipedia article is sufficient enough.