Waning immunity can drive repeated waves of infections

: In infectious disease models, it is known that mechanisms such as births, seasonality in transmission and pathogen evolution can generate oscillations in infection numbers. We show how waning immunity is also a mechanism that is su ﬃ cient on its own to enable sustained oscillations. When previously infected or vaccinated individuals lose full protective immunity, they become partially susceptible to reinfections. This partial immunity subsequently wanes over time, making individuals more susceptible to reinfections and potentially more infectious if infected. Losses of full and partial immunity lead to a surge in infections, which is the precursor of oscillations. We present a discrete-time Susceptible-Infectious-Immune-Waned-Infectious (SIRWY) model that features the waning of fully immune individuals (as a distribution of time at which individuals lose fully immunity) and the gradual loss of partial immunity (as increases in susceptibility and potential infectiousness over time). A special case of SIRWY is the discrete-time SIRS model with geometric distributions for waning and recovery. Its continuous-time analogue is the classic SIRS with exponential distributions, which does not produce sustained oscillations for any choice of parameters. We show that the discrete-time version can produce sustained oscillations and that the oscillatory regime disappears as discrete-time tends to continuous-time. A di ﬀ erent special case of SIRWY is one with ﬁxed times for waning and recovery. We show that this simpler model can also produce sustained oscillations. In conclusion, under certain feature and parameter choices relating to how exactly immunity wanes, ﬂuctuations in infection numbers can be sustained without the need for any additional mechanisms


Introduction
Sustained oscillations in the number of infections have been observed for some infectious diseases.A classic example is the highly regular biennial pattern in measles case numbers in England and Wales from 1950 to 1967 (depicted in Fine and Clarkson, 1982 [1]), which is driven by a combination of births and seasonality of transmission related to the opening of school terms.
Mathematically, sustained oscillations can be demonstrated by relatively simple models.Such models focus on a key mechanism such as seasonality in transmission (Aron and Schwartz, 1984 [2]), births and vaccinations (Earn et al., 2000 [3]), pathogen evolution through time scale separation of within and between season dynamics (Andreasen, 2003 [4]) or in combination with seasonality forcing (Dushoff et al., 2004 [5]), changes in human social behavior (d'Onofrio and Manfredi, 2009 [6]), importations of infectious individuals (Silva and Monteiro, 2014 [7]), heterogeneity in transmission due to chronological age (Kuniya and Inaba, 2023 [8] in this special issue) and change in behavior of healthy individuals due to social pressure (Baccili and Monteiro, 2023 [9]).These mechanisms can drive a surge in infections through three main methods: (i) replenishment of susceptible individuals, (ii) replenishment of infectious individuals and (iii) variation of the transmission parameter.Sustained oscillations are possible in these models for certain choices of parameter values.
We argue that waning immunity is also a mechanism that can, by itself, produce sustained oscillations in infection numbers.For diseases with waning immunity, previous infection or vaccination only confers a temporary period of full protection against reinfection.The duration of protection ranges from a few weeks or months for the Omicron variant of SARS-CoV-2 (Burkholz et al., 2023 [10] and Bobrovitz et al., 2023 [11]), to possibly a few years for pertussis (Wendelboe et al., 2005 [12]).As fully immune individuals wane, more individuals become susceptible to infection and more infections occur.Eventually, fewer susceptibles remain and the number of infections falls.When new individuals lose full immunity, replenishment of susceptibles occurs and the cycle repeats.
Here, we present a discrete-time waning immunity model (SIRWY model) that features the aforementioned loss of full immunity as a general population waning distribution, where the proportion of fully immune individuals who wane can be specified on a daily basis.In this Susceptible-Infectious-Immune-Waned-Infectious (SIRWY) model, S and I represent susceptible and infectious individuals without prior immunity, R represents fully immune individuals and W and Y represent waned (susceptible) and infectious individuals with prior immunity.
A special case of SIRWY is the Susceptible-Infectious-Recovered-Susceptible (SIRS) model with geometric distributions for waning and recovery.This is the discrete-time counterpart to the continuous-time classic SIRS model with exponential distributions (Hethcote, 1976 [13]): (1.1) In these equations, ω is the waning rate, β is the transmission rate per infectious individual and γ is the recovery rate.For all parameter values, the number of infections either tends to zero or the endemic equilibrium via exponential decay or damped oscillations (see Hethcote, 1976 [13] or a different proof in §6 of this paper).A variation of the classic SIRS is the SIR 1 ...R n S model with Erlang distribution (sum of exponentials), in which individuals wait in the additional immune sub-compartments before becoming susceptible.It has been shown that sustained oscillations are possible for the SIR 1 ...R n S model when n ≥ 3 (Hethcote et al., 1981 [14]).In this paper, we show that the discrete-time version of SIRS with geometric distributions can generate undamped oscillations, and the oscillatory regime disappears when discrete-time tends to continuous-time.
A different special case of SIRWY is one with homogeneous waning and recovery distributions.This model has fixed waning and recovery times, in which individuals spend exactly the same number of days fully immune and are infectious for exactly same number of days if infected.Due to this fixed delay in terms of time spent in the immune compartment, surges in susceptibles occur at fixed intervals.We show that sustained oscillations can be produced, similar to continuous-time models with delays (Hethcote et al., 1981 [14], Diekmann and Montijn, 1982 [15] and Kyrychko and Blyuss, 2005 [16]).
Besides having a general waning distribution, the full SIRWY model features another effect of waning immunity, the loss of partial immunity, which also contributes to oscillatory dynamics.After losing full immunity, individuals still have partial immunity that reduces their susceptibility to reinfection and potentially also their infectiousness if infected.However, partial immunity wanes over time and individuals become more susceptible and infectious.The accumulation of susceptibility and infectiousness in the population leads to a surge in infections.Similar to the loss of full immunity, this results in a cyclical pattern in infection numbers.
While waning immunity is a mechanism that can generate oscillations, it does not always do so as it depends on the choice of waning immunity effects (losses of full and partial immunity) and how exactly these effects are represented in the model (discrete/continuous time, population waning distribution, changes in susceptibility and infectiousness over time).As a general model which also encompasses different simpler sub-models, SIRWY allows an appropriate model to be chosen based on what is currently known about the infectiousness of the disease and the effects of waning immunity in the population, before scaling up to the full model when needed.Furthermore, for model implementation, discrete-time SIRWY is a system of difference equations, which makes numerical simulations easier to perform as compared with integro-differential equations in continuous-time.
The rest of this paper is structured as follows.We start by presenting the Susceptible-Infectious-Immune-Waned-Infectious (SIRWY) model in §2, before presenting a stability analysis about the disease-free and endemic equilibria in §3.We then proceed to recover two sub-models of the SIRWY model, one with fixed waning and recovery times in §4 and another with geometric distributions for waning and recovery in §5.For these sub-models, we perform bifurcation analysis, on top of the stability analyses about the disease-free and endemic equilibria.We then study the continuous-time exponential SIRS model (equation 1.1) in §6, before making the connection between this model and its discrete-time counterpart in §7 to show that the oscillatory regime disappears in continuous-time.

The RWY model
Since our goal is to understand how waning immunity shapes the long term dynamics of a disease, we consider a population comprising individuals with some degree of immunity because all individuals would have been infected at least once in the long run.Furthermore, as the focus is on waning immunity, other mechanisms that replenish susceptibles such as births are not included (similar to how the evolutionary model is constructed in Pease, 1987 [17]).Since we are also not considering pathogen evolution, this means that all properties of the disease related to infection, recovery and waning of immunity are unchanged over extended periods.Let R t , W t and Y t denote the proportions of the population who are in the fully immune, waned and infectious compartments respectively on day t.Here, we always discuss in terms of proportions of population in each compartment rather than exact numbers.For completeness, we give the full Susceptible-Infectious-Immune-Waned-Infectious (SIRWY) model in Appendix A but our focus is on the Immune-Waned-Infectious (RWY) model (Figure 1) for the rest of the paper.The second component of the subscript is the time since recovery τ, which starts from 0, increases and then resets to 0 when the individual rejoins the R compartment.Subtracting the second subscript from the first subscript gives the day of recovery t.
Each compartment in the model (R, W and Y) is further divided into sub-compartments based on time since most recent recovery τ (first introduced by Kermack and McKendrick, 1932 [18]) with respect to day t.For example, R t,τ denotes the proportion of population in the immune R compartment on day t and day τ since recovery.In this notation, we can deduce the day of recovery by subtracting the second subscript from the first subscript (day t − τ for R t,τ ).
The use of time since recovery τ allows us to track the total number of days an individual spends in the R, W and Y compartments.Time since recovery τ starts from day 0 when the individual first joins the R compartment and increases with the day as the individual progresses through the waned W and infectious Y compartments.The value of τ then resets to 0 when the individual rejoins the R compartment (see Figure 2 for an example).This formulation tracks a full RWY cycle (R→W→Y→R→ • • • ), not just the time spent in each compartment (Inaba, 2001 [19]).
We cover the entire immune spectrum as we have the fully immune R compartment and the waned W and infectious Y compartments with partial immunity based on each day τ since recovery.We do not have the fully susceptible S in the RWY model but it is present in the full SIRWY model.The R compartment represents full immunity against infection, unlike that in Kermack and McKendrick (1932) [18], where R individuals are partially susceptible to infection.Partial immunity provides a reduction in susceptibility α τ of waned W individuals and a reduction in infectiousness χ τ of infectious Y individuals.Since the susceptibility of waned individuals depends on the time since recovery τ, there is no need to use the method of stages to partition susceptibles into a fixed number of sub-compartments S 1 , S 2 , ..., S n with n different susceptibilities.The RWY model, along with a summary of terms in Table 1, is described by the following system of difference equations, and the conservation of individuals means that Each compartment (R, W and Y) can be defined in terms of their corresponding sub-compartments (see Table 2).
In the RWY model (equation 2.1), the newly infected y is used instead of the infectious Y because the infectious Y t = θ θ=0 φ θ y t−θ can be expressed in terms of newly infected y at time t and earlier times, with φ θ representing the fraction of y t−θ still infectious on day θ since infection (as similarly defined by Kermack and McKendrick, 1927 [20]).Here, φ 0 = 1 because all infecteds would have just joined Table 2. Definition of variables in the RWY model.The indices t, τ and θ refer to the time, time since recovery and time since infection respectively.The summations correspond to the max immune period (τ+1), the max value of τ (τ) and the max infectious period (θ+1).

Symbol Variable Composition
the infectious compartment the same day they became infected, which is day 0 since infection.By defining the maximum allowable infectious period to be θ + 1 days, the fraction still infectious φ θ = 0 for θ ≥ θ + 1 and the infectious Y t is expressed in terms of newly infecteds y t−θ to y t .The force of infection F t has contributions from the fraction φ θ of newly infecteds y t−θ,τ who are still infectious on day θ since infection.On day t, each of these individuals contributes a baseline infectiousness ξ θ based on the time since infection θ, which is then reduced by a factor of χ τ .Here, the τ in both χ τ and y t−θ,τ refers to the number of days since recovery with respect to the day of infection t − θ and not with respect to day t.As the maximum infectious period is θ + 1 days, infectiousness Individuals who recover on day t + 1 join the newly recovered R t+1,0 immune compartment.Using the fraction still infectious φ θ , we define the population recovery distribution φ θ − φ θ+1 , which gives the proportion of newly infected y t−θ who recover on day θ + 1 since infection.
We define the immune R t in a similar way as the infectious Y t .Here, R t = τ τ=0 ζ τ R t−τ,0 , where ζ τ represents the fraction of newly recovered R t−τ,0 still immune on day τ since recovery.Again, ζ 0 is equals to 1 because all individuals would have just joined the immune compartment the day they recover.By defining the maximum allowable immune period to be τ + 1 days, the fraction still immune ζ τ = 0 for τ ≥ τ + 1 and the immune R t only consists of newly recovereds R t−τ,0 to R t,0 .Since individuals can only remain in the immune compartment for τ + 1 days and the immune compartment is the first compartment individuals join after recovery, we can express R t = τ τ=0 R t,τ in terms of its sub-compartments R t,τ , with the final term being R t,τ as R t,τ = 0 for τ ≥ τ + 1.Using the fraction still immune ζ τ , we define the population waning distribution ζ τ−1 − ζ τ , which gives the proportion of newly recovered R t−(τ−1),0 who wane on day τ since recovery.
The waned W t and newly infected y t can also be expressed in terms of their sub-compartments.For the waned on day t, W t,τ starts from W t,1 rather than W t,0 because individuals are assumed to spend at least one day in the immune compartment before moving to the waned compartment.By the same reasoning, y t,τ starts from y t,2 because individuals are assumed to spend at least another day in the waned compartment.By defining a maximum value of τ = τ, we have W t = τ τ=1 W t,τ and y t = τ τ=2 y t,τ , where the final terms W t,τ and y t,τ comprise all waned and newly infecteds individuals respectively with τ ≥ τ.We may also define the infectious Y t = τ τ=2 Y t,τ , in terms of its sub-compartments Y t,τ , where Y t,τ comprises all infectious individuals with τ ≥ τ.
The waning of partial immunity is a decrease in protection, which is equivalent to decreases in the value of the reduction in susceptibility α τ and potentially also the reduction in infectiousness χ τ as τ increases.As we are using a maximum value of τ = τ, the reduction in susceptibility α τ reaches a constant value α τ for τ ≥ τ and the reduction in infectiousness χ τ a constant value χ τ for τ ≥ τ.Together with the population waning distribution ζ τ−1 − ζ τ , these three features specify how the losses of full and partial immunity are modeled in the RWY model.
We conclude this section by remarking that we have intentionally made a linear approximation on how the newly infected y t depends on the force of infection F t (Hernandez-Ceron et al., 2013 [21], Diekmann et al., 2021 [22]).The full description is the following: This form, however, cannot be utilized easily as F t is also a function of newly infected y t at earlier times.As long as the force of infection F t is not too large, we can work with the linearized equation (2.1) to perform stability analysis.Equation 2.1 also allows for efficient numerical simulations to be performed via matrix-vector multiplications.

Stability analysis
In this section, we derive the model equations (equation 2.1) at steady state.Letting time tend to infinity and using * to denote the steady state, the immune R equations become after substituting θ θ=0 (φ θ − φ θ+1 ) = 1.Adding the equations in (3.1), the proportion of recovered individuals in the population at steady state is where we have used ζ 0 = 1.Performing a similar analysis on the waned equations, we get: where we have substituted R * ,0 = y * .The waned equations can also expressed in terms of y * and its components: Note that in the above analysis, we do not have an expression for W * ,τ yet.The steady state equations for the force of infection and newly infectious are: Since Y t = θ θ=0 φ θ y t−θ , the infectious proportion of population at steady state is The steady state equations above will be used to derive the disease-free and endemic equilibria in the sub-sections that follow.

Disease-free equilibrium
We derive the disease-free equilibrium by setting the newly infected proportion of the population y * ,τ to be zero for all τ in the steady state equations 3.1, 3.4 and 3.5.By the conservation of individuals (equation 2.2), we find that in the disease-free equilibrium, all individuals end up in the waned W * ,τ compartment, with (3.7) We now proceed to set up a vector system of the model for linear stability analysis about the diseasefree equilibrium.Let x t+1 = g(x t ), where x t is a vector that is formed by the newly infected y t−τ−θ to y t and the waned W t .Here, g is a function to be specified using the model equations (2.1 and 2.2).
Linearizing about the disease-free equilibrium and performing elementary column operations on J − λI (where J is the Jacobian for the model equations evaluated at the disease-free equilibrium), we obtain the following characteristic equation: Theorems related to the zeroes of polynomial are discussed in Appendix B. Using Theorem B.6 and Lemma B.7, we find that the disease-free equilibrium is asymptotically stable if and only if R 0 < 1, where the modified basic reproductive ratio is defined as R Note that R 0 < 1 is the explicit threshold for all solutions to tend towards the disease-free equilibrium.Here, R 0 is a modified basic reproductive ratio because α τ and χ τ are not necessary zero, in particular, waned W individuals at τ = τ may still be less susceptible to infection than susceptible S individuals.
There are two key observations.First, R 0 depends on the reductions in infectiousness χ τ and susceptibility α τ only when τ = τ and not earlier values of τ.This is because earlier values of τ are transient and hence not present in the steady disease-free equilibrium.The only value of τ that has a lasting effect is when τ takes the maximum value of τ because τ remains at this value thereafter even as the day increases.Second, R 0 is independent of population recovery distribution φ θ − φ θ+1 and population waning distribution ζ τ−1 − ζ τ (see equation 2.1).Again, this is because recovery takes place for a maximum allowable period of θ + 1 days (infectious period) and waning for a maximum allowable period of τ + 1 days (immune period), which are transient periods that do not continue until τ = τ.

Endemic equilibrium
For the endemic equilibrium, an explicit form is difficult to obtain because the steady state equations (3.1, 3.4 and 3.5) are non-linear in y * ,τ .We can make progress in the special case where the reduction in susceptibility and infectiousness are independent of τ, namely, α τ = α and χ τ = χ respectively.Then, the force of infection and the newly infected (equation 3.5) can be simplified to: where we have substituted R 0 = (1−χ)(1−α) θ θ=0 ξ θ φ θ defined earlier.Summing up the y * ,τ equations, we get W * = 1 R 0 .Substituting this equation along with equations 3.2 and 3.6 into R * + W * + Y * = 1, we obtain an expression for y * : The term in brackets is the sum of the fraction of newly recovered who remain immune and the fraction of newly infecteds who remain infectious throughout the entire immune and infectious period respectively.Clearly, y * exists (is greater than zero) if and only if R 0 is greater than one.Now, W * and y * are completely defined in terms of parameter values.Using W * = τ τ=1 W * ,τ , equation 3.4 and W * = 1 R 0 , we can express W * ,τ in terms of y * ,τ : This equation, along with equations 3.9 and 3.3, allow us to obtain a closed form for the endemic equilibrium: In this case, the endemic equilibrium is uniquely defined.Proceeding, we perform stability analysis for the simplest case (τ = 3, τ = 1 and θ = 1).Here, R 0 = (1 − χ)(1 − α)(ξ 0 φ 0 + ξ 1 φ 1 ).Equation 3.10 for y * simplifies to y * = R 0 −1 R 0 (2+φ 1 +ζ 1 ) and the endemic equilibrium (equation 3.12) is Performing elementary column operations on J−λI (where J is the Jacobian for the model equations evaluated at the endemic equilibrium), we get the following characteristic equation: where Here, we have used the short-form σ θ = ξ θ φ θ .Using Theorem B.6, we obtain sufficient conditions for the endemic equilibrium to be asymptotically stable.Depending on the sign of k 2 and k 3 , there are four different cases to consider: 1.For k 2 < 0 and k 3 > 0, i.e., 1 (σ 0 +σ 1 )(φ 1 +ζ 1 ) .

Sub-model with fixed waning and recovery times
We consider the case where every individual follows exactly the same waning and recovery trajectory.Infected individuals join the immune compartment on day θ + 1 since infection and recovered individuals join the waned compartment on day τ + 1 since recovery.Similar to how classic SIRS is formulated, we consider the simplest model by dropping the dependence on time since infection θ and time since recovery τ, arriving at a constant value of infectiousness ξ, reduction in susceptibility α and reduction in infectiousness χ.The RWY model (equation 2.1) becomes: where β = ξ(1 − χ)(1 − α).Note that the proportions of the population in the sub-compartments y t+1,τ and W t+1,τ are no longer needed to be considered individually as they have been summed up.In addition, from the RWY model (equation 2.1), we get R t+1,0 = y t−θ and R t = θ+τ+1 θ=θ+1 y t−θ .Substituting the latter expression and W t = 1 − R t − Y t into the last equation of (4.1), we obtain a non-linear scalar equation: We linearize about the disease-free equilibrium by setting y t = λ t , where is small, to get the following characteristic equation: By Theorem B.6 and Lemma B.7, the disease-free equilibrium is asymptotically stable if and only if R 0 < 1, where R 0 = β(θ + 1).The endemic equilibrium can be found using equation (4.2) to be y * = R 0 −1 R 0 (θ+τ+2) , which is uniquely defined.Linearizing about the endemic equilibrium, we get the following characteristic equation: Applying Theorem B.6, the sufficient conditions for asymptotic stability are: 1 < R 0 < 3 and θ > τ. (4.5) The second condition requires the infectious period to be greater than the immune period for stability.This agrees with what other continuous-time models have found (Diekmann and Montijn, 1982 [15], Hethcote et al. (1981) [14] and Stech and Williams (1981) [23]): a long immune period can lead to instability of the endemic equilibrium.On the other hand, applying Lemma B.7, the necessary conditions for asymptotic stability are given by: Note that θ + τ + 3 is the minimum amount of time an individual spends going through the R (τ + 1 days), W (1 day) and Y (θ + 1 days) compartments before returning to the R compartment.
To obtain explicit thresholds, we consider two special cases.Case 1: If the immune period is one day (τ = 0), then using Theorem B.5, the endemic equilibrium is asymptotically stable if and only if equation (4.6) holds.Case 2: If the infectious period is one day (θ = 0), then we use the Determinantal Criterion directly (Theorem B.3) for τ = 1, 2 and 3 to get respectively.We perform bifurcation analysis for these two cases.For case 1 (τ = 0), at the critical value R 0 = θ + 3, the endemic equilibrium loses stability.There are two sub-cases.
(a) If θ = 0, the eigenvalues are ±i, which leads to a 1 : 4 (also known as period 4) resonance, for which the constants b and d in the complex normal form can be computed using equations (C.11) and (C.12) to be 9 4 − 9i 8 and − 9i 8 respectively.For case 2 (θ = 0), for τ = 1 to 3, at the critical value of R 0 , we have a pair of complex conjugate eigenvalues with modulus 1, leading to a Neimark-Sacker bifurcation.There is no strong resonance for these eigenvalues found.The invariant expression d can be computed using equation (C.9) and they are all negative, which means that a stable closed invariant curve bifurcates from the fixed point for R 0 greater than the critical value.
Our analysis above for the RWY sub-model with fixed recovery and waning times implies that there are three dynamic regimes -(i) disease-free equilibrium, (ii) endemic equilibrium and (iii) oscillatory solutions due to flip or Neimark-Sacker bifurcations.

Sub-model with geometric distributions
We now consider geometric distributions for both recovery and waning.At the individual level, on each day, an infectious individual has a probability γ of recovering and a recovered individual has a probability ω of joining the waned compartment.At the population level, the fraction still infectious is φ θ = (1 − γ) θ and the fraction still immune is ζ τ = (1 − ω) τ .The R equations can thus be expressed as: (5.1) Note that both the immune period and the infectious period are infinite days long.Furthermore, if we assume that the infectiousness ξ, reduction in susceptibility α and reduction in infectiousness χ are constants, then the RWY model (using equations 2.1, 2.2 and 5.1) becomes: where the transmission parameter Using the property of geometric distributions, we note that the mean number of days an individual stays in the infectious and immune compartments is 1 γ and 1 ω respectively.Such a model with geometric distributions is often described as 'memoryless' because the probabilities that an infectious individual remains infectious and an immune individual remains immune on a particular day do not depend on the number of days they have already spent in the infectious and immune compartments respectively. Substituting into the second equation of (5.2), we obtain a scalar nonlinear difference equation: We linearize about the disease-free equilibrium by letting Y t = λ t , where is small, and obtain the characteristic equation ω[λ − (1 − γ + β)] = 0.The disease-free equilibrium is asymptotically stable if and only if R 0 < 1, where R 0 = β γ .From equation (5.3), the endemic equilibrium can be found to be Y * = ω(β−γ) β(ω+γ) , which is uniquely defined.Linearizing about the endemic equilibrium, we get the characteristic equation λ 2 +p 1 λ+p 0 = 0, where Using the Determinantal Criterion for order 2 (equation B.2), the endemic equilibrium is asymptotically stable if and only if where At the critical value . The latter eigenvalue cannot take the value 1 or −1 under the constraints for γ and ω.Hence, the Jacobian J has a simple critical eigenvalue −1 and a flip bifurcation occurs.The invariant formula b in the normal form of a flip bifurcation (equation C.6) can be calculated using the formula (equation C.7) to be Under the constraints for γ and ω, b is always greater than 0, which means that a stable period two cycle bifurcates from the fixed point for R 0 > R * 0 .On the other hand, at the critical value R * 0 = 1 + γ+ω γ(γ+ω−1) , the eigenvalues are which have modulus one under the constraints for γ and ω.Thus, a Neimark-Sacker bifurcation occurs at the critical value R * 0 .Like the RWY sub-model with fixed recovery and waning times, our analysis here for the submodel with geometric distributions in discrete-time implies that there are three dynamic regimes -(i) the disease-free equilibrium, (ii) the endemic equilibrium and (iii) oscillatory solutions due to flip or Neimark-Sacker bifurcation.

Sub-model with exponential distributions
We take the limit as time step tends to zero for the discrete-time sub-model with geometric distributions (equation 5.2), to get the continuous-time RWY model with exponential distributions: where β is the transmission rate per infectious individual, ω is the waning rate and γ is the recovery rate.We present the following analysis in the same manner as earlier sections of the paper, and refer the reader to Hethcote, 1976 [13] for an alternative derivation of these results.The disease-free equilibrium is given by: R * = 0, W * = 1 and Y * = 0.It is asymptotically stable if and only if R 0 < 1, where R 0 = β γ .The endemic equilibrium is given by: R * = γ(β−γ) β(ω+γ) , W * = γ β and Y * = ω(β−γ) β(ω+γ) , which is uniquely defined.Note that the expression for the endemic equilibrium in continuous-time is the same as that in discrete-time.The eigenvalues of the Jacobian matrix are where ω = ω ω γ +R 0 ω γ +1 .The endemic equilibrium is asymptotically stable if and only if both eigenvalues are negative, which occurs if and only if R 0 > 1.Hence, the RWY sub-model with exponential distributions in continuous-time only has two dynamic regimes: the disease-free equilibrium and the endemic equilibrium.No oscillatory solution is possible.

Bridging between discrete-time and continuous-time sub-models with geometric distributions
In this section, we seek to understand how the dynamic regimes change when we transit from discrete-time to continuous-time.The discrete-time sub-model with geometric distributions with time step h is: which is almost identical to the discrete-time sub-model with geometric distributions (equation 5.2), except that each of the parameters ω, β and γ is scaled by h.By taking into account this factor h in previous results for the discrete-time model with a time step of one day, we see that as before, R 0 = β γ and the disease-free equilibrium is asymptotically stable if and only if R 0 < 1.The endemic equilibrium also remains the same: R * = γ(β−γ) β(ω+γ) , W * = γ β and Y * = ω(β−γ) β(ω+γ) .It is asymptotically stable if and only if 1 < R 0 < 1 + q h , where (7.2) In the limit as h tends to zero, the top case in equation 7.2 collapses and q h tends to infinity.Hence, the endemic equilibrium is asymptotically stable if and only if R 0 > 1 and the last regime with flip/Neimark-Sacker bifurcation in discrete-time disappears (see Figure 3).The number of dynamic regimes decreases from three to two and oscillatory solutions are no longer possible.

Discussion
We have intentionally chosen to focus on waning immunity to improve our understanding of the underlying mechanism behind the recent waves of COVID-19 infections in this ongoing pandemic.The emergence of new variants has often been invoked as the reason causing waves of surges in case numbers.However, our work shows that the waning of prior immunity, whether that immunity is from infection or vaccine, is sufficient on its own to drive oscillations.Hence, at least in theory, pathogen evolution may be purely consequential rather the cause of these waves.
In practice, COVID-19 waves are unlikely to be driven by a single mechanism.The effects of phylodynamics (Grenfell et al., 2004 [25]) are complex and there is likely a feedback loop between waning immunity dynamics and pathogen evolution.However, we argue that for diseases with evidence of waning immunity, the loss of immunity should be considered to be a candidate for the main mechanism driving oscillatory dynamics.This is particularly true for diseases with a short temporary From the public health point of view, policy makers may want to know whether surges in case numbers will happen in the long term for endemic diseases with waning immunity.Surges in case numbers are particularly problematic if the disease has severe health outcomes, especially when healthcare capacity is a major constraint.Models can help by distinguishing between two model outcomes for endemic diseases -the endemic equilibrium and sustained oscillations.The former does not lead to long term surges in case numbers but the latter does.If waning immunity plays a role in sustaining oscillations, then understanding the population infection dynamics can help policy makers decide the timing of booster campaigns to reduce the size of future case surges.
and the conservation of individuals means that The I, R, W and Y compartments can be defined in terms of their corresponding sub-compartments (see Table 4).Similar to the RWY model, the SIRWY model is specified using the proportion of newly infecteds (i and y) rather than the proportion of infectious individuals (I and Y).
Table 4. Definition of variables in the SIRWY model.The indices t, τ and θ refer to the time, time since recovery and time since infection respectively.The summations correspond to the max infectious period (θ+1), the max immune period (τ+1) and the max value of τ (τ).

Symbol Variable Composition
I t infectious (without prior immunity)

Appendix B Theorems regarding zeroes of polynomial
For a k th order difference equation, we define the following characteristic polynomial: where p i are real numbers in our case.
Definition B.1 (Inners of a matrix).(Jury, 1971 [26], Jury, 1974 [27] and Elaydi, 2005 [28]) The inners of a matrix B = (b i j ) are the matrix itself and all the matrices obtained by sequentially removing the first and last rows and the first and last columns.For example, other than the matrix itself, the inners of the following matrices are indicated by boxes: 3 by 3 matrix 4 by 4 matrix 5 by 5 matrix    (iii) The (k − 1) by (k − 1) matrices

Appendix C Theorems regarding bifurcation analysis
We first start from the following discrete time dynamical system (map) given by To perform a bifurcation analysis on the fixed point x * at the critical parameter value ω * , we do a coordinate shift, placing the fixed point at the origin.Now, in the new coordinates, after renaming and keeping the same variable x, we assume that this system can be written in the form where J is the Jacobian matrix and F(x) is a smooth function of order O(||x|| 2 ) with the following Taylor expansion ∂ 3 F i (s) ∂s j ∂s k ∂s l s=0 x j y k z l (C.5) for i = 1, • • • , n.This presentation and subsequent results in this section are attributed to Kuznetsov, 2004 [33].

C.1 Flip Bifurcation
Here, assume that the Jacobian J has a simple eigenvalue −1 on the unit circle.The map (equation C.2), when restricted to the center manifold, can be transformed to the normal form ỹ = −y + by 3 + O(y 4 ), (C.6)where b gives the direction of bifurcation of the period-two cycle and can be computed using the following invariant formula: b = 1 6 p, L(q, q, q) − 1 2 p, K(q, (J − I) −1 K(q, q)) . (C.7) dS dt = ωR − βS I dI dt = βS I − γI dR dt = γI − ωR.

Figure 2 .
Figure2.Example of how an individual moves between compartments.The second component of the subscript is the time since recovery τ, which starts from 0, increases and then resets to 0 when the individual rejoins the R compartment.Subtracting the second subscript from the first subscript gives the day of recovery t.

Figure 3 .
Figure 3. Schematic of the stable long term dynamic regimes for the discrete-time Immune-Waned-Infectious (RWY) model with geometric distributions.As the time step h tends to zero, this model tends to its continuous classic SIRS and the regime with sustained oscillations disappears.

Table 1 .
Variables, indices and parameters of the RWY model.

Table 3 .
Variables, indices and parameters of the SIRWY model.