---
abstract: 'The stochastic SIS logistic process is a well-known birth-and-death process, often used to model the spread of an epidemic within a population of size $N$. Our focus is on the subcritical regime, where the recovery rate exceeds the infection rate by more than $N^{-1/2}$, and the epidemic dies out rapidly with high probability. Previously, only a first-order estimate for the mean extinction time of the epidemic was known, even in the case where the recovery rate and infection rate are fixed constants: we derive precise asymptotics for the distribution of the extinction time throughout the subcritical regime. In proving our results, we illustrate a technique for approximating certain types of Markov chain by differential equations over long time periods.'
address:
- 'Department of Mathematics, London School of Economics, Houghton Street, London WC2A 2AE, United Kingdom'
- 'School of Mathematics, Queen Mary, University of London'
author:
- Graham Brightwell
- Malwina Luczak
date: 28 December 2013
title: Extinction Times in the Subcritical Stochastic SIS Logistic Epidemic
---

[^1]

Introduction {#Sintro}
============

The [*stochastic SIS logistic process*]{} is defined as follows. Given a “size parameter” $N$, and two further parameters $\lambda$ and $\mu$, let $X^N = (X^N_t)_{t\ge 0}$ be the continuous-time Markov chain with state space $\{ 0, \dots, N\}$, and transitions as follows: $$\begin{aligned}
x &\to& x+1 \quad \mbox{ at rate } \quad \lambda x (1-x/N), \\
x &\to& x-1 \quad \mbox{ at rate } \quad \mu x.\end{aligned}$$ This is the most basic stochastic model of the spread of an SIS (susceptible-infective-susceptible) epidemic within a population of size $N$. In this context, $X^N_t$ represents the number of infective individuals at time $t$. Each infective encounters a random other member of the population at rate $\lambda$; if the other individual is currently susceptible, they become infective. Also, each infective recovers at rate $\mu$; once they are recovered they become susceptible again. The stochastic SIS logistic process is also used as a model for a metapopulation process, where $N$ represents the number of available patches, and $X^N_t$ is the number of patches that are populated at time $t$, $\lambda$ represents the rate at which one existing colony attempts to colonise another patch, and $\mu$ represents the rate at which an entire patch becomes depopulated due to some catastrophe. The model was first introduced by Feller [@Feller] in 1939, and further studied by Bartlett [@Bartlett]. It was rediscovered by Weiss and Dishon [@WD] in 1971, and has since been investigated by many authors. A recent thorough treatment of the model is the book of Nåsell [@Nasell].

Our results in this paper are for instances where $\lambda < \mu$. One such case is where $\lambda$ and $\mu$ are fixed real numbers with $\lambda < \mu$. We shall also be interested in the case where $\lambda=\lambda(N)$ and $\mu=\mu(N)$ are functions of $N$ with $\mu(N)-\lambda(N) \to 0^+$. We shall always assume that $\mu(N)$ and $\lambda(N)$ are bounded away from both 0 and $\infty$.

The Markov chain $(X^N_t)$ will start in a state $X_0^N = x_0=x_0(N)$. One case of natural interest is where $x_0 \simeq z_0N$ for some constant $z_0 \in (0,1]$, but our methods and results will also cover the case where $x_0/N \to 0$, as long as $x_0 (\mu-\lambda) \to \infty$. We set $T_e^{X^N}$ to be the time to extinction (i.e., the hitting time of the absorbing state 0) for the chain $(X_t^N)$, with parameters $\mu = \mu(N)$, $\lambda = \lambda(N)$ and $x_0 = x_0(N)$. Our interest is in the asymptotic distribution of $T_e^{X^N}$, as $N \to \infty$.

There is an exact expression for ${\operatorname{\mathbb E{}}}T_e^{X^N}$ as a double summation, due to Weiss and Dishon [@WD] in the case where $x_0 = N$, and in general to Leigh [@Leigh]: the asymptotics of this expression vary considerably according to the behaviour of the parameters, and it is far from straightforward to extract information from the expression.

The stochastic SIS logistic process is naturally associated with the differential equation $$\label{eq.diff-eq}
\frac{dz}{dt} = \lambda z (1-z) - \mu z = \lambda z(1 - \mu/\lambda - z),$$ where $z(t)$ represents the [*proportion*]{} of infective individuals at time $t$. This equation was first studied by Verhulst [@Verhulst], and it is known as the [*Verhulst equation*]{} or [*logistic equation*]{}. It follows from the general theory of Kurtz [@Kurtz] that $X^N_t/N$ is well concentrated around the solution $z(t)$ of the differential equation with initial condition $z(0) = x_0/N$, uniformly over fixed time intervals. For our purposes, we shall need to show concentration for longer periods, and part of our aim in this paper is to illustrate a technique for proving such a law of large numbers over longer timescales.

When $\lambda$ and $\mu$ are fixed, the behaviour of both the deterministic process $z(t)$ and the Markov chain $(X^N_t)$ vary dramatically depending on whether $\lambda$ is greater than, equal to, or less than $\mu$. In the case where $\lambda > \mu$, there is a stable fixed point of the drift equation (\[eq.diff-eq\]) at $z = 1-\mu/\lambda$. If there are initially a large number of infective individuals at time 0, then with high probability the scaled Markov chain $X^N_t/N$ heads rapidly towards the fixed point, then spends most of its time in the neighbourhood of the fixed point, making excursions into the rest of the state space until eventually one of these excursions reaches the absorbing state 0. Precise results are known about the distribution of the time to extinction, which is exponential in $N$, and about the quasi-stationary distribution, which is centred around the stable fixed point of (\[eq.diff-eq\]). See, for instance [@Barbour76; @KL; @Nasell96; @AD; @Nasell].

If $\lambda \le \mu$, then the differential equation (\[eq.diff-eq\]) has a single stable fixed point at $z=0$, and all its solutions converge to zero as $t\to \infty$. For the corresponding Markov chain, it is also known that the epidemic dies out rapidly with high probability whenever $\lambda \le \mu$. Doering, Sargsyan and Sander [@DSS] give an asymptotic formula for the mean extinction time, in the case where $\lambda < \mu$ are fixed constants and the starting state is $x_0 = z_0N$ with $z_0$ a constant: $$\label{dss}
{\operatorname{\mathbb E{}}}T_e^{X^N} = \frac{1}{\mu-\lambda} (\log N + \log z_0 + O(1)).$$ In the case where $\lambda = \mu$, they obtain: $${\operatorname{\mathbb E{}}}T_e^{X^N} = \left( \frac{\pi}{2} \right)^{3/2} \sqrt N + \log N + \log z_0 + O(1).$$ Doering, Sargsyan and Sander [@DSS] also study the mean time to extinction starting from a state with a single infective individual, and Kessler [@Kessler] extends these results to cover the whole of the “transition region”, where $\mu-\lambda$ is of order $N^{-1/2}$. The main focus of the paper of Kessler [@Kessler] is the mean [*number*]{} of infections in this regime.

However, it appears that deriving the precise asymptotic distribution of the time $T_e^{X^N}$ to extinction has been open until now, even in the case where $\lambda$ and $\mu$ are fixed constants with $\lambda < \mu$. A formula for this asymptotic distribution is presented in Kryscio and Lefèvre [@KL], with a heuristic argument, and is then reproduced in Andersson and Djehiche [@AD]; this formula is similar in nature to (\[eq.inter\]) below, but different in several important respects. However, it was noted by Doering, Sargsyan and Sander [@DSS] that the formula in [@KL] and [@AD] is inconsistent with their result (\[dss\]), and with their numerical results. In his 2011 book, Nåsell [@Nasell] identifies two distinct regimes: one “critical regime”, where $\mu-\lambda$ is of order at most $N^{-1/2}$, and another (subcritical) where $\mu-\lambda$ is constant or tends to zero more slowly than $N^{-1/2}$. For both regimes, Nåsell [@Nasell] poses as an open problem the determination of the mean extinction time ${\operatorname{\mathbb E{}}}T_e^{X^N}$.

In this paper, we obtain the asymptotic distribution of $T_e^{X^N}$ throughout the subcritical regime. Our main result is as follows. We recall that a random variable $W$ has the [*standard Gumbel distribution*]{} if ${\operatorname{\mathbb P{}}}(W \le w) = e^{-e^{-w}}$ for all $w \in {{\mathbb R}}$. The mean of $W$ is equal to Euler’s constant $\gamma \approx 0.5772$.

\[thm.main\] Suppose that $(\mu - \lambda) N^{1/2} \to \infty$, and that $x_0(\mu-\lambda) \to \infty$. We have $$\label{eq.general}
(\mu-\lambda) T_e^{X^N} - \Big( \log x_0 + \log (\mu-\lambda) - \log\big( 1 + \frac{\lambda x_0}{(\mu-\lambda) N}\big) - \log \mu \Big) \to W,$$ in distribution, as $N \to \infty$, where $W$ has the standard Gumbel distribution. Therefore $${\operatorname{\mathbb E{}}}_{x_0} T_e^{X^N} = \frac{\log x_0 + \log (\mu-\lambda) - \log\big( 1 + \frac{\lambda x_0}{(\mu-\lambda) N}\big) - \log \mu + \gamma + o(1)}{\mu-\lambda},$$ as $N \to \infty$.

We next give versions of (\[eq.general\]) valid when $x_0/N$ lies in certain ranges. If $(\mu(N)-\lambda(N)) N^{1/2} \to \infty$, and $x_0/N \to z_0$, with $z_0 \in (0,1]$, then Theorem \[thm.main\] gives that $$\label{eq.inter}
(\mu-\lambda) T_e^{X^N} - \big( \log N + \log z_0 + 2\log (\mu-\lambda) - \log(\mu -\lambda +\lambda z_0) - \log \mu \big) \to W,$$ in distribution, as $N \to \infty$, where $W$ has the standard Gumbel distribution. In general, (\[eq.general\]) is the most that can be said if $x_0/N$ is of the same order as $\mu-\lambda$ (e.g., if both are constants). On either side of this regime, the formula in (\[eq.general\]) can be simplified. If $x_0 = o((\mu-\lambda)N)$ and $x_0(\mu-\lambda) \to \infty$, then we have $$\label{eq.low}
(\mu-\lambda) T_e^{X^N} - \big( \log x_0 + \log (\mu-\lambda) - \log \mu \big) \to W,$$ in distribution, as $N \to \infty$, whereas if $x_0/(\mu-\lambda)N \to \infty$, then $$\label{eq.high}
(\mu-\lambda) T_e^{X^N} - \big( \log N + 2\log (\mu-\lambda) - \log \mu -\log \lambda \big) \to W,$$ in distribution, as $N \to \infty$, where in both cases $W$ has the standard Gumbel distribution. In (\[eq.high\]), we necessarily have $\mu-\lambda \to 0$, so either of the terms $\log \mu$ and $\log \lambda$ could be replaced by the other.

We observe that the asymptotic formula for the distribution of $T_e^{X^N}$ in (\[eq.low\]) is independent of $N$, while that in (\[eq.high\]) is independent of $x_0$. An explanation for the first of these phenomena becomes apparent in Section \[sec:final\]: we show that, in this regime, the stochastic SIS logistic process behaves essentially identically to a linear birth-and-death chain with birth-rate $\lambda$ and death rate $\mu$, so that the “logistic correction” to the birth rate does not affect the asymptotics.

If $\mu-\lambda \to 0$, then for large enough $x_0$ (e.g., when $\liminf_{N\to \infty} x_0/N > 0$), we are in the regime covered by (\[eq.high\]), and the time to extinction does not depend significantly on the starting state. To explain this, we give an informal description of the typical course of the epidemic in the case where $\mu-\lambda \to 0$, and we start in some large state, say with $x_0 = z_0N$ and $z_0 > 0$. For such a regime, in the initial phase of the epidemic, the number $X^N_t$ of infectives very rapidly drops until it reaches states of the same order as $(\mu-\lambda)N$. The majority of the time of the epidemic – approximately $\log (N(\mu-\lambda)^2))/(\mu-\lambda)$ – is spent in an “intermediate” phase, getting from there to states of the same order as $(\mu-\lambda)^{-1}$; the time taken to cross this “gap” is very well concentrated around the value derived from the approximating differential equation. Most of the variability of the time to extinction comes from the final phase of the epidemic, starting when the state gets down to about order $(\mu-\lambda)^{-1}$; for this final phase, the differential equation is no longer an adequate guide to the extinction time, and instead the Markov chain is well approximated by a linear birth and death chain. Note that this description relies on having $(\mu-\lambda)N \gg (\mu-\lambda)^{-1}$: if $(\mu-\lambda) \ll N^{-1/2}$, then the situation is completely different (in this regime the time to extinction is essentially distributed as in the case $\mu=\lambda$).

We briefly discuss what happens if we drop the assumption that $x_0(\mu-\lambda) \to \infty$ at the end of Section \[sec:final\].

The plan of the paper is as follows. We track the process through three phases, roughly corresponding to the three phases mentioned in the informal description above. For some regimes, not all the phases are necessary, and we tackle them in “reverse order”, starting with the final phase of the epidemic. Our results are stated in terms of a function $\omega(N)$ tending to infinity suitably slowly, which can be taken equal to $(\mu-\lambda)^{1/4}N^{1/8}$.

We treat the final phase in Section \[sec:final\]. Here, we start from a state $x^*$ below $N^{1/2} \omega(N)$, and show that, from this point on, the stochastic SIS logistic process is well approximated by a linear birth and death chain with the same parameters: as the distribution of the extinction time for a linear birth and death chain is known explicitly, this enables us to estimate very precisely the behaviour of the logistic chain. An alternative way to view this phase of the epidemic is to approximate it by a branching process, where each initially infected individual sparks a brief small epidemic within the population, and these various small epidemics do not interact. The time to extinction is then the maximum of the duration of these small epidemics, and this explains the appearance of the standard Gumbel distribution – which typically arises as the maximum of a number of independent samples from a given distribution – in our formulae.

The intermediate phase is covered in Section \[sec:intermediate\]. Here, effectively we prove Theorem \[thm.main\] under the additional assumption that $x_0 \le (\mu-\lambda)N \omega(N)$. In this phase, we use a method, based on a concentration of measure inequality, developed by Luczak [@Luczak] to show that the scaled process $(X^N_t/N)$ stays close to the solution of the differential equation (\[eq.diff-eq\]), for a (deterministic) period of time until there are about $N^{1/2} \omega(N)$ infective individuals (from which point the analysis for the final phase can be invoked). The general method of Kurtz [@Kurtz] for showing that a Markov chain follows a differential equation would not suffice for our purposes: the idea of this approach is to use the Lipschitz constant of the differential equation to bound the rate at which the solution to the differential equation and the Markov chain get further apart: in our setting, this would only show that the Markov chain follows the differential equation for a fixed time, or at best a time given by a small constant times $\log N$. Our method allows us to take advantage of the fact that, if we have two copies of the chain started in different states, we can couple them so that the expected distance between the copies is always decreasing. We believe that our method can often be used to show that Markov chains with this “contractive” property follow differential equations for longer periods. Another illustration of this approach is given in [@BL].

In Section \[sec:initial\], we provide a fairly crude upper bound on the time taken for the initial phase of the chain, starting from any state and reaching a state of order about $N(\mu-\lambda)\omega(N)$. The point is that the time taken for this phase is negligible compared to the overall extinction time. In Section \[sec.proof\], we combine the results of the preceding sections to prove Theorem \[thm.main\].

Our results have some bearing on the “critical regime”, where $|\mu-\lambda| = O(N^{-1/2})$. In particular, the results of Section \[sec:initial\] can be used to show that the expected time taken for the epidemic, started from an arbitrary state, to reach a state of order about $N^{1/2}$ is of order at most $N^{1/2}$. Dolgoarshinnykh and Lalley [@DL] show that, in this regime, the scaled stochastic SIS epidemic process started from a state of order $N^{1/2}$ converges in law to a diffusion process they call the “attenuated Feller diffusion”. One consequence is that the time to extinction from states of order $N^{1/2}$ is of order $N^{1/2}$ (and is not well-concentrated). We discuss the critical regime in the short final section: we make no attempt to provide precise quantitative results.

Throughout the paper, we shall use the notation ${\operatorname{\mathbb P{}}}(\cdot)$ and ${\operatorname{\mathbb E{}}}(\cdot)$ to denote probability in whatever space we are working in. Sometimes we find it convenient to use a subscript $x_0$ to indicate that we are working with a process with starting state $x_0$. We will sometimes treat a real quantity as though it were an integer, so as to avoid any unnecessary clutter with floors and ceilings.

Final phase: approximation by linear birth and death chains {#sec:final}
===========================================================

In this section, we show that the stochastic SIS logistic process is well approximated by a linear birth and death chain, from a state $x^*$ until extinction, provided $x^* \le N^{5/8}(\mu-\lambda)^{1/4}$. We also assume that $x^*(\mu-\lambda) \to \infty$: this assumption is necessary only for expressing the distribution of the extinction time of the approximating linear birth and death chain in a convenient form.

A [*linear birth and death chain*]{} with parameters $(\lambda, \mu)$ is a continuous-time Markov chain $(Y_t)_{t\ge 0}$ with state space ${{\mathbb Z}}_+ = \{ 0, 1,2,\dots\}$ and the following transitions: $$\begin{aligned}
y &\to& y+1 \quad \mbox{ at rate } \quad \lambda y, \\
y &\to& y-1 \quad \mbox{ at rate } \quad \mu y.\end{aligned}$$

Let $T^Y_e$ be the hitting time of the absorbing state $0$ for the Markov chain $(Y_t)$ starting at $x^*$. It is known, see for instance Renshaw [@Renshaw] (2.4.23), that, for $t \ge 0$ and $\mu \not= \lambda$, $$\begin{aligned}
{\operatorname{\mathbb P{}}}(T^Y_e \le t) &=& {\operatorname{\mathbb P{}}}(Y_t = 0) \nonumber \\
&=& \left( \frac{\mu  - \mu e^{-(\mu-\lambda)t}}{\mu - \lambda e^{-(\mu-\lambda)t} } \right)^{x^*} \nonumber \\
&=& \left( 1 - \frac{(\mu-\lambda) e^{-(\mu - \lambda) t}}{\mu - \lambda e^{-(\mu-\lambda)t}} \right)^{x^*}. \label{eq.lbdc}\end{aligned}$$ We shall be interested in comparing the stochastic SIS logistic process with parameters $\lambda = \lambda(N)$, $\mu = \mu(N)$ and $x^*=x^*(N)$ with the corresponding linear birth and death chain. Accordingly, we shall be interested in the case where all the parameters of the Markov chain $(Y_t)$ vary with $N$, and in this case we shall use the notation $(Y^N_t)$ and $T_e^{Y^N}$ to indicate that we are dealing with a sequence of Markov chains with different parameters, indexed by $N$.

We shall use the following routine result several times in the course of the paper.

\[lem.escape\] Let $(Y_t)$ be a birth-and-death chain such that, for any state $x$, the probability that the next step is upwards is at most $\lambda/(\lambda+\mu) < 1/2$. Suppose the chain is started in state $x^*$. For any state $y > x^*$, the probability that the chain $(Y_t)$ reaches $y$ before it reaches 0 is at most $$\frac{(\mu/\lambda)^{x^*} - 1}{(\mu/\lambda)^y - 1} \le \left( \frac{\lambda}{\mu} \right)^{y-x^*} \le \exp \left( - \frac{\mu-\lambda}{\mu} (y-x^*)\right).$$

Suppose that the linear birth and death chain $(Y_t^N)$ is started in a state $x^* = x^*(N)$, where $x^*(\mu-\lambda) \to \infty$ as $N \to \infty$. For each fixed $w \in {{\mathbb R}}$, we set $$t_w = t_w(\mu,\lambda,x^*) = \frac{\log x^* + \log (\mu-\lambda) - \log \mu + w}{\mu-\lambda},$$ and note that $t_w > 0$ for sufficiently large $N$. Restricting to those $N$ for which $t_w$ is indeed positive, we have that $e^{-(\mu-\lambda)t_w} = \mu e^{-w} / (\mu-\lambda)x^*$, and hence $$\begin{aligned}
{\operatorname{\mathbb P{}}}(T^{Y^N}_e \le t_w) &=& \left( 1 - \frac{\mu e^{-w}/x^*}{\mu - \lambda \mu e^{-w}/(\mu-\lambda)x^*} \right)^{x^*} \\
&=& \left( 1 - \frac{e^{-w}}{x^* - \lambda e^{-w}/(\mu-\lambda)} \right)^{x^*} \to e^{-e^{-w}},\end{aligned}$$ as $N \to \infty$, since $x^*(\mu-\lambda) \to \infty$. This can be written as $$\label{eq.lbdc2}
(\mu - \lambda) T^{Y^N}_e - \big( \log x^* + \log (\mu-\lambda) - \log \mu \big) \to W,$$ in distribution, as $N \to \infty$, where $W$ has the standard Gumbel distribution (${\operatorname{\mathbb P{}}}(W\le w) = e^{-e^{-w}}$), provided $x^*(\mu-\lambda) \to \infty$.

\[lem.late\] Suppose that $(\mu-\lambda)N^{1/2} \to \infty$, and set $\omega (N) = \big( (\mu-\lambda)N^{1/2} \big)^{1/4}$. Take any function $x^* = x^*(N)$ such that $x^*(\mu-\lambda) \to \infty$ and $x^* \le N^{1/2} \omega(N)$.

Suppose that $(X^N_t)$ is a copy of the stochastic SIS logistic process, started in state $x^*$. Then $$(\mu - \lambda) T_e^{X^N} - \big( \log x^* + \log (\mu-\lambda) - \log \mu \big) \to W,$$ in distribution, as $N \to \infty$, where $W$ has the standard Gumbel distribution.

Note that this result is the same as the special case of Theorem \[thm.main\] covered by (\[eq.low\]), with $x_0$ replaced by $x^*$, under the slightly more restrictive hypothesis that $x^* \le N^{1/2} \omega(N) = N^{5/8}(\mu-\lambda)^{1/4}$ instead of $x^* = o((\mu-\lambda)N)$. Later results will supply the conclusion of Theorem \[thm.main\] with no restrictions on the starting state.

The plan of the proof is to sandwich the stochastic SIS logistic process between two linear birth and death chains: the upper bound on $x^*$ is to ensure that the distributions of the extinction times of the two linear birth and death chains are asymptotically equal.

We couple three Markov chains: one is the stochastic SIS logistic process $(X^N_t)$, another is the linear birth and death chain $(Y^N_t)$ with the same parameters $(\lambda,\mu)$ as $(X^N_t)$, and the third is a different linear birth and death chain $(Z^N_t)$, this one with parameters $(\lambda', \mu)$ where $\lambda' = \lambda (1-2x^*/N)$. All three processes start at $x^*$. Let $\tau$ be the first time that either $Y^N_t=0$ or $Y^N_t = 2x^*$. The infection rate of $(X^N_t)$ is $\lambda X^N_t (1- X^N_t/N)$, which for $t < \tau$ is sandwiched between the birth rates of the two linear birth and death chains in the same state. We may thus construct a coupling with $Z^N_t \le X^N_t \le Y^N_t$ for all $t\le \tau$ and all $N$: the rule is that, if any two chains are in the same state, then they make jumps together as far as possible; otherwise two chains in different states make jumps independently according to their given transition rates, and so they a.s. do not jump simultaneously (so they do not cross). Under this coupling, on the event that $Y^N_\tau = 0$ (i.e., the “highest” chain reaches 0 before it reaches the upper boundary $2x^*$), we have $T^{Z^N}_e \le T_e^{X^N} \le T^{Y^N}_e$.

By Lemma \[lem.escape\], the probability that $(Y^N_t)$ escapes to $2x^*$ before it reaches 0 is at most $e^{-(\mu-\lambda)x^*/\mu} = o(1)$, since $(\mu-\lambda)x^* \to \infty$.

For each fixed $w$ and $N$, we choose $v=v(w,N)$ so that $t_w(\mu,\lambda,x^*) = t_v(\mu,\lambda',x^*)$, i.e., $$\frac{\log x^* + \log (\mu-\lambda) - \log \mu + w}{\mu-\lambda} = \frac{\log x^* + \log (\mu-\lambda') - \log \mu + v}{\mu-\lambda'}.$$ This translates to $$v(w,N) - w = \frac{\lambda-\lambda'}{\mu-\lambda}\left( \log x^* + \log(\mu-\lambda) -\log \mu + w\right) -
\log \left(1 + \frac{\lambda-\lambda'}{\mu-\lambda} \right).$$ We observe that $$\frac{\lambda - \lambda'}{\mu-\lambda} = \frac{2x^* \lambda}{N(\mu-\lambda)} \le \frac{2\lambda \omega(N)}{N^{1/2}(\mu-\lambda)}
\le \frac{2\lambda}{\omega(N)^3}.$$ Also we have, for $N$ sufficiently large, $$\log (x^*(\mu-\lambda)) \le (x^*(\mu-\lambda))^{1/2} \le \big( N^{1/2}\omega(N) N^{-1/2}\omega(N)^4 \big)^{1/2} = \omega(N)^{5/2}.$$ Therefore, for each fixed $w$, we have both $$\frac{\lambda-\lambda'}{\mu-\lambda}\left( \log x^* + \log(\mu-\lambda) -\log \mu + w\right) = o(1); \quad
\log \left(1 + \frac{\lambda-\lambda'}{\mu-\lambda} \right) = o(1),$$ and so $|v(w,N)-w| = o(1)$. In other words, $v(w,N) \to w$ as $N\to \infty$, for each fixed $w$. Thus $$\begin{aligned}
\lefteqn{|{\operatorname{\mathbb P{}}}(T^{Z^N}_e \le t_w(\mu,\lambda,x^*)) - e^{-e^{-w}}|} \\
&=& |{\operatorname{\mathbb P{}}}(T^{Z^N}_e \le t_v(\mu,\lambda',x^*)) - e^{-e^{-w}}| \\
&\le& | {\operatorname{\mathbb P{}}}(T^{Z^N}_e \le t_v(\mu,\lambda',x^*)) - e^{-e^{-v(w,N)}}| + | e^{-e^{-v(w,N)}} - e^{-e^{-w}}| \to 0\end{aligned}$$ as $N \to \infty$. Here we used (\[eq.lbdc2\]) applied to $(Z^N_t)$; applying the same formula to $(Y^N_t)$ tells us that $$|{\operatorname{\mathbb P{}}}(T^{Y^N}_e \le t_w(\mu,\lambda,x^*)) - e^{-e^{-w}}| = o(1).$$

As $(X^N_t)$ is sandwiched between $(Y^N_t)$ and $(Z^N_t)$ on the event that $Y^N_\tau = 0$, which occurs with probability $1-o(1)$, we now deduce that $$|{\operatorname{\mathbb P{}}}(T^{X^N}_e \le t_w(\mu,\lambda,x^*)) - e^{-e^{-w}}| = o(1).$$ Equivalently, $$(\mu - \lambda) T_e^{X^N} - \big( \log x^* + \log (\mu-\lambda) - \log \mu \big) \to W,$$ in distribution, as $N \to \infty$, where $W$ has the standard Gumbel distribution, as claimed.

In the case where $(\mu-\lambda)x^*$ does not tend to infinity, the same argument tells us that the distribution of the extinction time of the stochastic SIS logistic process is asymptotically the same as that of the linear birth and death chain with the same parameters. The formula (\[eq.lbdc\]) for the distribution of the extinction time of the linear birth and death chain can be approximated for various different parameter regimes. For convenience, we state two asymptotic formulae, doubtless familiar in other contexts.

For instance, it can be seen that, if $(\mu-\lambda)x^* \to 0$ but $x^* \to \infty$, then for any $v \in (0,\infty)$, $${\operatorname{\mathbb P{}}}\big(T_e^{X^N} \le v x^* /\mu\big) \to e^{-1/v}$$ as $N \to \infty$. We can also consider the case where the epidemic starts with a single infective: if $\mu-\lambda \to 0$ and $x_0 = 1$, then, for any $u \in (0, \infty)$, $${\operatorname{\mathbb P{}}}\big(T_e^{X^N} \le u /\mu\big) \to \frac{u}{1+ u}$$ as $N \to \infty$.

Intermediate phase: differential equation approximation {#sec:intermediate}
=======================================================

Fix some function $\omega(N)$ tending to infinity. In this section, we follow the process from a starting state below $(\mu-\lambda) N \omega(N)$, for a deterministic period of time $t^*$, and show that $X^N_{t^*}$ is close to $x^* = x^*(N) = N^{1/2} \omega(N)$ with probability $1-o(1)$ as $N \to \infty$. Our basic plan is to show that the process, suitably scaled, is well approximated by the differential equation (\[eq.diff-eq\]) in this phase.

The technique we use requires us to work with discrete-time Markov chains. Accordingly, we next define a discrete-time version of the logistic process; later we shall convert our results to the continuous-time case. We consider a Markov chain $({\widehat{X}}_k)_{k \in {{\mathbb Z}}_+} = ({\widehat{X}}_k^{N,K})_k$, with state space $\{ 0, \dots, N\}$ and transition probabilities given by $$p_{x,x+1} = \frac{\lambda}{K(\mu+\lambda)N} x (1 - x/N), \qquad p_{x,x-1} = \frac{\mu}{K(\mu+\lambda)N} x,$$ $$p_{x,x} = 1 - p_{x,x+1} - p_{x,x-1},$$ for $x = 0, \dots, N$. In the above, $K \ge 2$ is a constant that may depend on the parameters of the model, but not on $x$. The restriction $K \ge 2$ ensures that $p_{x,x} \ge \frac12$ for all $x$, but in fact $K$ can be set arbitrarily large without affecting the argument, and we shall later let $K$ tend to infinity. (We choose to express the denominators here as $K(\mu+\lambda)N$ so as to make $K$ a “dimensionless” constant.) The idea is that one step of the discrete-time chain approximates the continuous-time chain over a time period of $1/K(\mu+\lambda)N$, in a sense that we will make precise later.

We shall use the following result of Luczak [@Luczak]. For a discrete-time Markov chain with transition matrix $P$, a function $f$ on the state space $S$ of the chain, and a state $x \in S$, we write $(Pf)(x) = \sum_y P(x,y) f(y)$, where the sum is over all states $y$ with $P(x,y) > 0$.

\[thm.concb-general\] Let $P$ be the transition matrix of a discrete-time Markov chain with discrete state space $S$. Let $f: S \to {{\mathbb R}}$ be a function. Suppose the set $S_0$ and numbers $a_{x,i}(y)$ ($x,y  \in S_0$) satisfy the following conditions: for all $i \in {{\mathbb Z}}^+$ and all $x,y \in S_0$ such that $P(x,y) > 0$, $$\label{eq.coupling}
|{\operatorname{\mathbb E{}}}_x [f(X_i)] -  {\operatorname{\mathbb E{}}}_y [f(X_i)]| \le a_{x,i}(y).$$ Let $S_0^0 = \{x \in S_0: y \in S_0 \mbox{ whenever } P(x,y) > 0\}$. Assume that, for some sequence $(\alpha_i)_{i \in {{\mathbb Z}}^+}$ of positive constants, $$\sup_{x \in S_0^0} (P a_{x,i}^2)(x) \le \alpha_i^2.$$ Let $k >0$, and let $\beta = 2\sum_{i=0}^{k-1} \alpha_i^2$. Suppose also that $\alpha$ is such that $$2\sup_{0 \le i \le k -1}  \sup_{x \in S^0_0, y: P(x,y)>0} \alpha_i (x,y)\le \alpha.$$ Finally, let $A_k= \{\omega: X_s(\omega) \in S_0^0: 0 \le s \le k-1\}$. Then, for all $a >0$, $${\operatorname{\mathbb P{}}}_{x_0} \Big ( \left \{ |f(X_k)-{\operatorname{\mathbb E{}}}_{x_0} [f(X_k)] |\ge a \right \} \cap A_k \Big)
\le 2e^{-a^2/(2\beta+2\alpha a/3)}.$$

Our chain $({\widehat{X}}_k)$ is a birth-and-death chain, so that, for $x > 0$, $P(x,y) > 0$ if and only if $|x-y| \le 1$. We shall apply Theorem \[thm.concb-general\] to the function $f(x) = x$. To establish (\[eq.coupling\]), we will analyse a coupling and show that the expected difference between copies of the chain started in adjacent states decreases exponentially in time, so that the quantity $\beta$ is uniformly bounded for all time. The conclusion then gives us a concentration of measure inequality valid for all time (although in practice it is only useful if the expectation of ${\widehat{X}}_k$ is not too small).

Here and in future, for $z\in (0,1]$, we set $$s(z) = \log \left( 1 + \frac{\lambda}{\mu-\lambda} z \right) - \log z.$$ The significance of this function for us is that, for any $z_0 \in (0,1]$, the differential equation (\[eq.diff-eq\]) has an explicit solution $$z(t) = \frac{ z_0 (\mu-\lambda) e^{-(\mu-\lambda)t}}{\mu-\lambda + z_0 \lambda(1- e^{-(\mu-\lambda)t})},$$ for $t\ge 0$, where $z(0) = z_0$. The inverse of the function $z(t)$ is given by, for $0< z \le z_0$, $$t(z) = \frac{s(z) - s(z_0)}{\mu-\lambda}.$$ Our overall aim is to show that the time for the Markov chain $(X^N_t)$ to travel from $x_0 = z_0N$ to $x^* =z^*N$ is well-concentrated around $t(z^*)$: the total time to extinction will then be obtained by adding $t(z^*)$ to the time to extinction from $x^*$, which is covered in Lemma \[lem.late\]. Our first task is to establish the analogous result for the discrete time approximation $({\widehat{X}}_k)$.

\[lem.inter\] Suppose $(\mu-\lambda) N^{1/2} \to \infty$ as $N \to \infty$. Let $\omega(N)$ be any function tending to infinity with $N$, and set $x^* = N^{1/2} \omega(N)$. Let $x_0 = x_0(N)$ be any function such that $x^* \le x_0 \le N (\mu-\lambda) \omega(N)$.

Then, whenever $K \ge N$, $${\operatorname{\mathbb P{}}}_{x_0}\big( | {\widehat{X}}_{\lceil k^*\rceil}^{N,K} - x^* | \ge \omega(N)^{-1/3} x^* \big) = o(1),$$ as $N \to \infty$, where $$k^* = \frac{K(\mu+\lambda)N}{\mu-\lambda} \Big( s\Big(\frac{x^*}{N}\Big) - s\Big(\frac{x_0}{N}\Big) \Big).$$

As mentioned above, we first describe and analyse a coupling between two copies $({\widehat{X}}_k)_{k\in {{\mathbb Z}}_+}$ and $({\widehat{Y}}_k)_{k\in {{\mathbb Z}}_+}$ of the discrete chain. We couple the chains so that, if ${\widehat{X}}_k = {\widehat{Y}}_k$, then ${\widehat{X}}_{k+1} = {\widehat{Y}}_{k+1}$, and otherwise at most one of the chains moves at each step: such a coupling exists since $p_{x,x} \ge 1/2$ for each state $x$.

We claim that, for each $k \ge 0$, $${\operatorname{\mathbb E{}}}\big( | {\widehat{X}}_{k+1} - {\widehat{Y}}_{k+1} | \mid {\mathcal F}_k \big) \le |{\widehat{X}}_k - {\widehat{Y}}_k|
\big(1- \frac{\mu-\lambda}{K(\mu+\lambda)N}\big),$$ where $({\mathcal F}_k)$ is the natural filtration of the coupling. This is certainly true on the event that ${\widehat{X}}_k = {\widehat{Y}}_k$. Otherwise, we assume without loss of generality that ${\widehat{X}}_k > {\widehat{Y}}_k$, and note that any change to one of ${\widehat{X}}$ or ${\widehat{Y}}$ at step $k+1$ either reduces or increases the distance by 1. (The requirement that only one of the chains move unless they have already coalesced is to ensure that the chains do not “cross”.) Then we have $$\begin{aligned}
\lefteqn{{\operatorname{\mathbb E{}}}({\widehat{X}}_{k+1} - {\widehat{Y}}_{k+1} \mid {\mathcal F}_k)} \\
&=& ({\widehat{X}}_k - {\widehat{Y}}_k) + \frac{1}{K(\mu+\lambda)N}
\left( \lambda {\widehat{X}}_k ( 1 - \frac{{\widehat{X}}_k}{N}) - \lambda {\widehat{Y}}_k (1 - \frac{{\widehat{Y}}_k}{N}) - \mu {\widehat{X}}_k + \mu {\widehat{Y}}_k \right) \\
&=& ({\widehat{X}}_k - {\widehat{Y}}_k) \left( 1 + \frac{1}{K(\mu+\lambda)N} \big(\lambda - \mu  - \lambda \frac{{\widehat{X}}_k + {\widehat{Y}}_k}{N} \big) \right) \\
&\le& ({\widehat{X}}_k - {\widehat{Y}}_k) \left( 1 - \frac{\mu-\lambda}{K(\mu+\lambda)N} \right),\end{aligned}$$ as claimed.

By induction, we obtain that, for all $k \ge 0$, $${\operatorname{\mathbb E{}}}( |{\widehat{X}}_k - {\widehat{Y}}_k | \mid {\mathcal F}_0 ) \le |{\widehat{X}}_0 - {\widehat{Y}}_0| \Big(1 - \frac{\mu-\lambda}{K(\mu+\lambda)N} \Big)^k
\le |{\widehat{X}}_0 - {\widehat{Y}}_0| e^{-(\mu-\lambda) k/K(\mu+\lambda)N }.$$

We shall apply Theorem \[thm.concb-general\] with $S_0 = \{ 0, \dots, 2x_0\}$, $f(x) = x$ and $a_{x,i}(y) = e^{-(\mu-\lambda) i/K(\mu+\lambda)N}$ whenever $|x-y| = 1$ (and $a_{x,i}(x) = 0$ for all $x$). We note that $$P a_{x,i}^2 = (p_{x,x+1} + p_{x,x-1}) e^{-2(\mu-\lambda) i /K(\mu+\lambda)N} \le \frac{2x_0}{KN} e^{-2(\mu-\lambda) i/K(\mu+\lambda)N},$$ for all $x \in S_0$. Then we may take $$\alpha_i^2 = \frac{2x_0}{KN} e^{-2(\mu-\lambda) i/K(\mu+\lambda)N},$$ and so, since $(\mu-\lambda)/K(\mu+\lambda)N \le 1$, we have $$\beta = \sum_{i=0}^k \alpha_i^2 \le \frac{2x_0}{KN} \frac{1}{1- e^{-2(\mu-\lambda) /K(\mu+\lambda)N}} \le \frac{2x_0}{KN} \frac{K(\mu+\lambda)N}{\mu-\lambda}
= \frac{2x_0 (\lambda+\mu)}{\mu-\lambda},$$ and $\alpha = 2 \ge 2 \max_{i,x,y} a_{x,i}(y)$. Theorem \[thm.concb-general\] now gives that $${\operatorname{\mathbb P{}}}_{x_0} \Big( \{ | {\widehat{X}}_k - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k | \ge a \} \cap A_k \Big) \le 2 \exp\left( - \frac{a^2}{4x_0(\lambda+\mu)/(\mu-\lambda) + \frac43 a} \right),$$ for all $a \ge 0$ and all $k \ge 0$, where $A_k$ is the event that ${\widehat{X}}_\ell < 2x_0$ for all $\ell \in \{ 0, \dots, k\}$.

We see that ${\operatorname{\mathbb P{}}}(\overline{A_k})$ is at most the probability that the chain $({\widehat{X}}_k)$, started at $x_0$, reaches $2x_0$ before it reaches $0$. By Lemma \[lem.escape\], $${\operatorname{\mathbb P{}}}(\overline{A_k}) \le e^{-(\mu-\lambda)x_0/\mu}.$$ Therefore we have $${\operatorname{\mathbb P{}}}_{x_0} \Big( | {\widehat{X}}_k - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k | \ge a \Big) \le 2 \exp\left( - \frac{a^2}{4x_0(\lambda+\mu)/(\mu-\lambda) + \frac43 a} \right)
+ e^{-(\mu-\lambda)x_0/\mu},$$ for all $a \ge 0$ and all $k \ge 0$. In particular, for $a \le 2x_0$, we have $$\begin{aligned}
{\operatorname{\mathbb P{}}}_{x_0} \Big( | {\widehat{X}}_k - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k | \ge a \Big) &\le& 2 \exp\left( - \frac{a^2(\mu-\lambda)}{8x_0(\lambda+\mu)} \right) + 2 e^{-3a/8} \nonumber \\
&&\mbox{} + \exp\left( -\frac{(\mu-\lambda)a^2}{4 x_0 \mu} \right) \nonumber \\
&\le & 3 \exp\left( - \frac{a^2(\mu-\lambda)}{8x_0(\lambda+\mu)} \right) + 2 e^{-3a/8}. \label{eq.concwXk}\end{aligned}$$

For $a \ge 2x_0$, we note that $0 \le {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k \le x_0$ for all $k \ge 0$, so $${\operatorname{\mathbb P{}}}_{x_0} \Big( | {\widehat{X}}_k - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k | \ge a \Big) \le {\operatorname{\mathbb P{}}}_{x_0} ( {\widehat{X}}_k \ge 2x_0 ) \le \exp\left( - \frac{\mu-\lambda}{\mu} (a-x_0) \right),$$ using Lemma \[lem.escape\].

For the calculation that follows, we need a bound on the variance of ${\widehat{X}}_k$, which we can now obtain readily. For sufficiently large $N$, $$\begin{aligned}
\lefteqn{{\operatorname{\mathbb E{}}}_{x_0}({\widehat{X}}_k - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k)^2} \\
&\le& \int_{z=0}^\infty {\operatorname{\mathbb P{}}}_{x_0}(|{\widehat{X}}_k - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k| \ge \sqrt z\ ) \, dz \\
&\le& \int_{z=0}^\infty 3 e^{-z(\mu-\lambda)/8x_0(\lambda + \mu)} + 2 e^{-3\sqrt z/8} \, dz
+ \int_{z=4x_0^2}^\infty e^{-(\mu-\lambda)(\sqrt z-x_0)/\mu} \, dz \\
&=& \frac{24 x_0 (\lambda + \mu)}{\mu-\lambda} + \frac{256}{9} +
\left( \frac{4\mu x_0}{\mu-\lambda} + \frac{2\mu^2}{(\mu-\lambda)^2} \right) e^{-(\mu-\lambda)x_0/\mu} \\
&\le& \frac{30x_0(\lambda+\mu)}{\mu-\lambda} \le \frac{60x_0 \mu}{\mu-\lambda},\end{aligned}$$ since our hypotheses imply that $(\mu-\lambda)x_0 \ge (\mu-\lambda) x^* \to \infty$ as $N \to \infty$.

We now show that ${\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k/N$ remains close to the appropriately scaled solution $z(t)$ of the differential equation (\[eq.diff-eq\]) with $z(0) = z_0 = x_0/N$ until the chain drops to about $x^*$. Accordingly, we consider $$E_k = \frac{{\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k}{N} - z\Big(\frac{k}{K(\mu+\lambda)N}\Big).$$ Note that $$\begin{aligned}
\lefteqn{{\operatorname{\mathbb E{}}}_{x_0} ({\widehat{X}}_{k+1} - {\widehat{X}}_k)} \\
&=& {\operatorname{\mathbb E{}}}_{x_0} \big( {\operatorname{\mathbb E{}}}_{x_0} ({\widehat{X}}_{k+1} - {\widehat{X}}_k \mid {\mathcal G}_k) \big) \\
&=& {\operatorname{\mathbb E{}}}_{x_0} \Big( \frac{1}{K(\lambda+\mu)N} \big(\lambda {\widehat{X}}_k \big(1- \frac{{\widehat{X}}_k}{N}\big) - \mu{\widehat{X}}_k\big) \Big) \\
&=& \frac{1}{K(\lambda+\mu)N} \Big( -(\mu - \lambda) {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k - \lambda \frac{{\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k^2}{N} \Big) \\
&=& \frac{1}{K(\lambda+\mu)N} \Big( -(\mu - \lambda) {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k - \lambda \frac{({\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k)^2}{N}
- \lambda \frac{{\operatorname{\mathbb E{}}}_{x_0} ({\widehat{X}}_k - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k)^2}{N} \Big).\end{aligned}$$ By Taylor’s Theorem, we have that, for some $u \in \big(\frac{k}{K(\mu+\lambda)N}, \frac{k+1}{K(\mu+\lambda)N}\big)$, $$\begin{aligned}
\lefteqn{z\Big( \frac{k+1}{K(\mu+\lambda)N}\Big) - z\Big(\frac{k}{K(\mu+\lambda)N} \Big)} \\
&=& \frac{1}{K(\lambda+\mu)N} z'\Big(\frac{k}{K(\mu+\lambda)N}\Big) + \frac{1}{2K^2(\mu+\lambda)^2N^2} z''(u) \\
&=& \frac{1}{K(\lambda+\mu)N} \Big[ -(\mu-\lambda) z\Big(\frac{k}{K(\mu+\lambda)N}\Big) - \lambda z\Big(\frac{k}{K(\mu+\lambda)N}\Big)^2 \Big] \\
&&\mbox{} + \frac{1}{2K^2(\mu+\lambda)^2N^2} z''(u),\end{aligned}$$ since $z(t)$ satisfies (\[eq.diff-eq\]). Thus we have, for some $u \in \big(\frac{k}{K(\mu+\lambda)N}, \frac{k+1}{K(\mu+\lambda)N}\big)$, $$\begin{aligned}
\lefteqn{E_{k+1} - E_k} \\
&=& \frac{1}{K(\mu+\lambda)N} \Big[ -(\mu-\lambda) \frac{{\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k}{N} - \lambda \left( \frac{{\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k}{N} \right) ^2
- \frac{\lambda}{N^2} {\operatorname{\mathbb E{}}}_{x_0} ({\widehat{X}}_k - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k)^2 \\
&&\mbox{} + (\mu-\lambda) z\Big(\frac{k}{K(\mu+\lambda)N}\Big) + \lambda z\Big(\frac{k}{K(\mu+\lambda)N}\Big)^2 - \frac{1}{2K(\mu+\lambda)N} z''(u) \Big] \\
&=& \frac{1}{K(\mu+\lambda)N} \Big[ -(\mu-\lambda)E_k - \lambda E_k \Big(\frac{{\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k}{N} + z\Big(\frac{k}{K(\mu+\lambda)N}\Big) \Big) \\
&&\mbox{} - \frac{\lambda}{N^2} {\operatorname{\mathbb E{}}}_{x_0} ({\widehat{X}}_k - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k)^2 - \frac{1}{2K(\mu+\lambda)N} z''(u) \Big].\end{aligned}$$ One may easily check that $0 \le z''(u) \le \mu(\mu+\lambda)$ for all $u \in [0,1]$, so we may now write $$\begin{aligned}
|E_{k+1}| &\le& |E_k| \Big( 1 - \frac{(\mu-\lambda) + \lambda \frac{{\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k}{N} + \lambda z\big(\frac{k}{K(\lambda+\mu)N}\big)}{K(\mu+\lambda)N} \Big) \\
&& \mbox{} + \frac{\lambda}{K(\mu+\lambda)N^3} \frac{60 x_0 \mu}{\mu-\lambda}+ \frac{1}{2K^2(\mu+\lambda)^2N^2} \sup_u |z''(u)| \\
&\le& |E_k| \Big( 1 - \frac{\mu-\lambda}{K(\mu+\lambda)N} \Big) + \frac{60\lambda x_0\mu}{(\mu-\lambda)(\mu+\lambda) K N^3} + \frac{\mu}{2K^2(\mu+\lambda)N^2}.\end{aligned}$$

It follows by induction that, for all $k \ge 0$, $$|E_k| \le \frac{60 x_0 \lambda\mu}{N^2 (\mu-\lambda)^2} + \frac{\mu}{2K(\mu-\lambda) N}.$$ Provided $K \ge N$, the second term above is at most $\lambda\mu/N^2(\mu-\lambda)^2$, so we have, for all $k\ge 0$, $$\label{eq.Ek}
\Big|\frac{{\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_k}{N} - z\Big(\frac{k}{K(\mu+\lambda)N}\Big) \Big|= |E_k| \le \frac{70 x_0 \lambda \mu}{N^2 (\mu-\lambda)^2}.$$

Recall that $t(z) = (s(z) - s(z_0))/(\mu-\lambda)$ is the inverse to $z(t)$. We set $t^* = t(x^*/N)$, and $k^* = K (\mu+\lambda)N t^*$, so that $k^*$ is as in the statement of the lemma, and $z\big( \frac{k^*}{K(\mu+\lambda)N} \big) = z(t^*) = x^*/N$. Note that $k^* \ge 0$ since $x_0 \ge x^*$. Also, since $|z'(t)| \le \mu$ for all $t \in [0,1]$, we have $$\left| z \Big(\frac{\lceil k^*\rceil }{K(\mu+\lambda)N} \Big) - z \Big( \frac{k^*}{K(\mu+\lambda)N} \Big) \right| \le \frac{\mu}{K(\mu+\lambda)N} \le \frac{1}{N}.$$ We then obtain from (\[eq.Ek\]) that $$\label{eq.f1}
\left| {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_{\lceil k^*\rceil} - x^* \right| \le \frac{70 x_0\lambda \mu}{N(\mu-\lambda)^2} + 1 \le \frac{70 \lambda \mu \omega(N)}{\mu-\lambda} + 1 = o(x^*),$$ since $(\mu-\lambda)N^{1/2} \to \infty$ and $x^* = N^{1/2} \omega(N)$. Also, from (\[eq.concwXk\]) with $a = \omega(N)^{-1/3} x^*$, we have that $$\begin{aligned}
\lefteqn{{\operatorname{\mathbb P{}}}_{x_0} \left( \left| {\widehat{X}}_{\lceil k^*\rceil} - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_{\lceil k^*\rceil } \right | \ge \omega(N)^{-1/3} x^* \right)} \\
&\le& 3 \exp\left( - \frac{\omega(N)^{-2/3}(x^*)^2(\mu-\lambda)}{8x_0(\lambda+\mu)} \right) + 2 e^{-3\omega(N)^{-1/3} x^*/8} \\
&\le& 3 \exp\left( - \frac{\omega(N)^{1/3}}{8 (\lambda + \mu)} \right) + 2 e^{-3 N^{1/2} \omega(N)^{2/3} /8} = o(1).\end{aligned}$$ Hence $$\label{eq.f2}
{\operatorname{\mathbb P{}}}_{x_0} \left( \left| {\widehat{X}}_{\lceil k^*\rceil} - {\operatorname{\mathbb E{}}}_{x_0} {\widehat{X}}_{\lceil k^*\rceil} \right | \ge \omega(N)^{-1/3} x^* \right) \to 0.$$

From (\[eq.f1\]) and (\[eq.f2\]), we deduce that, provided $K \ge N$, $${\operatorname{\mathbb P{}}}_{x_0} \left( \left| {\widehat{X}}_{\lceil k^*\rceil} - x^* \right| \ge \omega(N)^{-1/3} x^* \right) = o(1),$$ as $N \to \infty$, as desired.

The next result shows how to connect the discrete-time chain $({\widehat{X}}_k)$ and the continuous-time chain $(X^N_t)$.

\[lem.disc-cont\] For each fixed $N$, $K$, and $t_0 \ge 0$, $$d_{TV} \left( \mathcal{L}(X^N_{t_0}), \mathcal{L}({\widehat{X}}^{N,K}_{\lceil K(\mu+\lambda)Nt_0\rceil}) \right) \le \frac{4 (\mu+\lambda)N t_0 + 1}{K},$$

Recall that $(X^N_t)$ is a continuous-time Markov chain with transitions given by $x \to x+1$ at rate $\lambda x (1-x/N)$ and $x \to x-1$ at rate $\mu x$. We fix $K \ge 2$ for the moment, and set $\delta = 1/K(\mu+\lambda)N$. We also assume for the moment that $t_0$ is an integer multiple of $\delta$. Recall now also that $({\widehat{X}}_k) = ({\widehat{X}}^{N,K}_k)$ is a discrete time chain with transition probabilities given by $$p_{x,x+1} = \delta \lambda x (1 - x/N), \qquad p_{x,x-1} = \delta \mu x,$$ $$p_{x,x} = 1 - p_{x,x+1} - p_{x,x-1},$$ for $x = 0, \dots, N$.

We consider the sequence $(Z_k)_k = (X^N_{k\delta})_k$, obtained by observing $(X^N_t)$ at each integer multiple of $\delta$, as a discrete-time Markov chain. Our plan is to show that $(Z_k)$ is well-approximated by $({\widehat{X}}_k)$, for all $k$ up to $t_0/\delta = K(\mu+\lambda)Nt_0$. The idea here is that, for $K$ large, the chain $(X^N_t)$ usually does not jump in an interval of length $\delta$, which means that $(Z_k)$ usually does not move. Moreover, the chain $(X^N_t)$ is very unlikely to take two jumps within the same small interval of length $\delta$ at any time during the period $[0,t_0]$.

To be precise, let $P'$ be the transition matrix of $(Z_k)$. Then we have $$p'_{x,x} \ge e^{-p_{x,x+1} - p_{x,x-1}} \ge 1 - p_{x,x+1} - p_{x,x-1}.$$ To see this, note that $(X^N_t)$, while in state $x$, makes jumps at rate $q_x = \lambda x(1-x/N) + \mu x$. So the probability that the chain makes no jumps in a time interval of length $\delta$, conditional on the chain being in state $x$ at the start of the interval, is equal to the probability that a Poisson random variable of mean $q_x\delta = p_{x,x+1} + p_{x,x-1}$ is equal to zero, which is given by $e^{-p_{x,x+1} - p_{x,x-1}}$.

Now note that the jump rate of $(X_t^N)$ in state $x$ satisfies $q_x \le (\lambda+ \mu) N$ for all $x$. The probability, conditional on the chain $(X^N_t)$ being in state $x$ at the start of an interval of length $\delta$, that the chain makes one jump upwards and no other jumps during that interval, is $$\int_{s=0}^{\delta} e^{-q_xs} e^{-q_{x+1}(\delta - s)} \lambda x (1-x/N) \, ds,$$ where $s$ represents the time of the single jump within the interval. This integral is at least $$\lambda x (1-x/N) \delta e^{-(\lambda+\mu) N \delta} = p_{x,x+1} e^{-1/K}.$$ So we have $$p'_{x,x+1} \ge p_{x,x+1} e^{-1/K} \ge p_{x,x+1} (1-1/K) \ge p_{x,x+1} - \frac{1}{K^2},$$ and similarly $$p'_{x,x-1} \ge p_{x,x-1} - \frac{1}{K^2}$$

As also $p'_{x,x} + p'_{x,x+1} + p'_{x,x-1} \le 1$, these lower bounds also imply corresponding upper bounds: $$p'_{x,x} \le 1 - p'_{x,x+1} - p'_{x,x-1} \le 1 - p_{x,x+1} - p_{x,x-1} - \frac{2}{K^2} = p_{x,x} + \frac{2}{K^2},$$ and similarly $$p'_{x,x+1} \le p_{x,x+1} + \frac{1}{K^2}; \quad p'_{x,x-1} \le p_{x,x-1} + \frac{1}{K^2}.$$

We couple the discrete-time chains $({\widehat{X}}_k)$ and $(Z_k)$ so that they jump together as far as possible. Specifically, if the chains are both in state $x$, they jump up by 1 together with probability $\min(p_{x,x+1},p'_{x,x+1})$, jump down by 1 together with probability $\min(p_{x,x-1},p'_{x,x-1})$, and stay in state $x$ together with probability $\min(p_{x,x},p'_{x,x})$. Then, for each $k$, $${\operatorname{\mathbb P{}}}({\widehat{X}}_{k+1} \not= Z_{k+1} \mid {\widehat{X}}_k = Z_k) \le \frac{4}{K^2}.$$ Hence, by induction, we have ${\operatorname{\mathbb P{}}}({\widehat{X}}_k = Z_k \mbox{ for all } k \le \ell) \ge 1 - \frac{4\ell}{K^2}$, for each $\ell \ge 0$. In particular, for $\ell = K(\mu+\lambda)Nt_0$, we have that $$d_{TV}  \left( \mathcal{L}(X^N_{t_0}), \mathcal{L}({\widehat{X}}^{N,K}_{K(\mu+\lambda)Nt_0}) \right)
\le {\operatorname{\mathbb P{}}}({\widehat{X}}^{N,K}_{K(\mu+\lambda)Nt_0} \not= X^N_{t_0}) \le \frac{4 (\mu+\lambda)N t_0}{K}$$ for all $K$, and all times $t_0$ that are integer multiples of $\delta = 1/K(\mu+\lambda)N$.

For values $t_0$ that are not necessarily integer multiples of $\delta$, we set $t_0^* = \delta \lceil t_0/\delta \rceil$, so that $\lceil K(\mu+\lambda)N t_0 \rceil = K(\mu+\lambda)N t_0^*$. The probability that $X^N_{t_0}$ is not equal to $X^N_{t_0^*}$ is at most $1 - \max_x p'_{x,x} \le 1/K$, so we have, for all values of $N$, $t_0$ and $K$, $$d_{TV} \left( \mathcal{L}(X^N_{t_0}), \mathcal{L}({\widehat{X}}^{N,K}_{\lceil K(\mu+\lambda)Nt_0\rceil}) \right) \le \frac{4 (\mu+\lambda)N t_0 + 1}{K},$$ as claimed.

The following result now follows from Lemmas \[lem.inter\] and \[lem.disc-cont\].

\[lem.slow\] Suppose $(\mu-\lambda) N^{1/2} \to \infty$ as $N\to \infty$. Let $\omega(N)$ be any function tending to infinity, and set $x^*=x^*(N) = N^{1/2} \omega(N)$. Suppose $x_0 = x_0(N) \le \omega(N) (\mu-\lambda) N$. Then $${\operatorname{\mathbb P{}}}_{x_0} \left( \left| X^N_{t^*} - x^* \right| > \omega(N)^{-1/3} x^* \right) = o(1),$$ where $$t^* = t^*(x_0) = \frac{s(x^*/N) - s(x_0/N)}{\mu-\lambda}.$$

If, additionally, $(\mu-\lambda) N^{1/2} / \omega(N) \to \infty$, then we have $$\label{eq.number}
t^*(x_0) = \frac{1}{\mu-\lambda} \left( \log x_0 - \log(x^*) - \log \left(1+ \frac{\lambda}{\mu-\lambda} \frac{x_0}{N} \right) + o(1) \right).$$

For each $N$, choose $K = K(N)$ so that $K(N) \ge N$ and $\frac{4 (\mu+\lambda)N t^* + 1}{K(N)} \le 1/N$. Note that the value $k^*$ in Lemma \[lem.inter\] is equal to $\lceil K(\mu+\lambda)N t^* \rceil$.

Now we have from Lemma \[lem.inter\] and Lemma \[lem.disc-cont\] that $$\begin{aligned}
\lefteqn{{\operatorname{\mathbb P{}}}_{x_0} \left( \left| X^N_{t^*} - x^* \right| > \omega(N)^{-1/3} x^* \right)} \\
&\le& {\operatorname{\mathbb P{}}}_{x_0} \left( \left| {\widehat{X}}_{k^*}^{N,K(N)} - x^* \right| > \omega(N)^{-1/3} x^* \right) + d_{TV} \left( X^N_{t^*}, {\widehat{X}}_{k^*}^{N,K(N)} \right) \\
&\le& o(1) + \frac{1}{N} = o(1),\end{aligned}$$ as $N \to \infty$.

The final assertion in the statement is immediate, since, with the assumptions given, $\log \big(1 + \frac{\lambda}{\mu-\lambda} \frac{x^*}{N} \big) = o(1)$.

Initial Phase: Upper Bounds {#sec:initial}
===========================

In this section, we show that, if our chain $(X^N_t)$ is started in any state and run for a suitably chosen time period $t_0 = o((\mu-\lambda)^{-1})$, then with high probability the chain will have reached a state below $(\mu-\lambda)N \omega(N)$.

An alternative approach to analysing this phase of the process would be to show, using similar methods to those of the previous section, that the process closely follows the differential equation. The argument we give is significantly simpler, since all we need to show is that the time taken for this initial phase does not contribute significantly to the total extinction time.

We first prove a lemma, showing that the expected state of the stochastic process is always bounded above by the appropriately scaled solution of the differential equation (\[eq.diff-eq\]). The lemma below holds without any assumptions on the values of the parameters or on the starting state.

\[lem.inequality\] Let $x_0$ be any starting state for the stochastic logistic chain, and let $z(t)$ be the solution to the differential equation (\[eq.diff-eq\]) with $z(0) = z_0 = x_0/N$. Then, for all $t \ge 0$, $${\operatorname{\mathbb E{}}}_{x_0} X^N_t \le N z(t).$$

We note that, for all $t \ge 0$, $$\begin{aligned}
\frac{d}{dt} {\operatorname{\mathbb E{}}}_{x_0} X^N_t &=& \lambda {\operatorname{\mathbb E{}}}_{x_0} \big( X^N_t (1-X^N_t/N) \big) - \mu {\operatorname{\mathbb E{}}}_{x_0} X^N_t \\
&=& - (\mu-\lambda) {\operatorname{\mathbb E{}}}_{x_0} X^N_t - \frac{\lambda}{N} {\operatorname{\mathbb E{}}}_{x_0} (X^N_t)^2 \\
&=& - (\mu-\lambda) {\operatorname{\mathbb E{}}}_{x_0} X^N_t - \frac{\lambda}{N} ({\operatorname{\mathbb E{}}}_{x_0} X^N_t)^2 - \frac{\lambda}{N} {\operatorname{\mathbb E{}}}_{x_0} (X^N_t - {\operatorname{\mathbb E{}}}_{x_0} X^N_t)^2.\end{aligned}$$ Therefore we have $$\begin{aligned}
\frac{d}{dt} \big( {\operatorname{\mathbb E{}}}_{x_0} X^N_t - N z(t) \big) &=& - (\mu-\lambda) {\operatorname{\mathbb E{}}}_{x_0} X^N_t - \frac{\lambda}{N} ({\operatorname{\mathbb E{}}}_{x_0} X^N_t)^2 \\
&&\mbox{} - \frac{\lambda}{N} {\operatorname{\mathbb E{}}}_{x_0} (X^N_t - {\operatorname{\mathbb E{}}}_{x_0} X^N_t)^2 + N \big( (\mu-\lambda) z(t) + \lambda z(t)^2 \big) \\
&=& \big( {\operatorname{\mathbb E{}}}_{x_0} X^N_t - Nz(t) \big) \left\{ - (\mu-\lambda) - \frac{\lambda}{N} \big({\operatorname{\mathbb E{}}}_{x_0} X^N_t + z(t)\big) \right\} \\
&&\mbox{} - \frac{\lambda}{N} {\operatorname{\mathbb E{}}}_{x_0} (X^N_t - {\operatorname{\mathbb E{}}}_{x_0} X^N_t)^2.\end{aligned}$$ It follows now that, since ${\operatorname{\mathbb E{}}}_{x_0} X^N_t - Nz(t)$ is equal to zero at $t=0$, it is non-positive for all $t\ge 0$.

We now state a version of this result in the specific context we shall use it. (It might be useful to note that the lemma is trivial if $(\mu-\lambda) \omega(N) \ge 1$ fr sufficiently large $N$.)

\[lem.quick\] Let $\omega(N)$ be any function tending to infinity, and set $t_0 = t_0(N) = \frac{1}{\omega(N)^{1/2} \lambda (\mu-\lambda)}$.

For any starting state $x_0=x_0(N)$, ${\operatorname{\mathbb P{}}}_{x_0} \big(X^N_{t_0} \ge N (\mu-\lambda) \omega(N) \big) = o(1)$.

Let $z_0 = x_0 / N \le 1$. We note that $$\begin{aligned}
z(t_0) &=& \frac{ z_0 (\mu-\lambda) e^{- (\mu-\lambda)t_0}}{(\mu-\lambda) + z_0 \lambda (1-e^{-(\mu-\lambda)t_0})}\\
&\le& \frac{(\mu-\lambda) e^{-(\mu-\lambda)t_0}}{\lambda (1- e^{-(\mu-\lambda)t_0})} \\
&\le& \frac{1}{\lambda t_0} = (\mu-\lambda) \omega(N)^{1/2}.\end{aligned}$$ Here we used the elementary inequality $e^{-u} \le (1-e^{-u})/u$, valid for all $u > 0$. Hence, by Lemma \[lem.inequality\], we have ${\operatorname{\mathbb E{}}}X^N_{t_0} \le (\mu-\lambda) N \omega(N)^{1/2}$. Moreover, we have $${\operatorname{\mathbb P{}}}_{x_0} \Big(X^N_{t_0} \ge (\mu-\lambda)N \omega(N) \Big) \le \frac{1}{\omega(N)^{1/2}} = o(1),$$ as desired.

Proof of Theorem \[thm.main\] {#sec.proof}
=============================

In this section, we assemble all the lemmas from the preceding three sections into a proof of Theorem \[thm.main\].

Set $\omega(N) = \big( N^{1/2} (\mu-\lambda) \big)^{1/4}$, and note that $\omega(N)$ tends to infinity as $N \to \infty$.

We now distinguish three ranges for the starting state $x_0 = x_0(N)$, assuming always that $(\mu-\lambda)x_0 \to \infty$: (a) $x_0(N) \le N^{1/2}\omega(N)$, (b) $N^{1/2} \omega(N) < x_0(N) \le (\mu-\lambda)N \omega(N)$, (c) $x_0(N) > (\mu - \lambda)N \omega(N)$. It could be that $x_0(N)$ falls into different ranges for different values of $N$: we partition the set of natural numbers into three sets depending on which of (a), (b), (c) holds. It suffices to prove the result separately for whichever subsequence(s) are infinite, and so we may treat each of the three ranges in turn, working (tacitly) with an infinite sequence of values of $N$ for which the inequalities defining the range hold.

\(a) Suppose $(\mu-\lambda) x_0(N) \to \infty$ and $x_0(N) \le N^{1/2} \omega(N)$. In this case, we have, from Lemma \[lem.late\] with $x^* = x_0$, that $$(\mu - \lambda) T_e^{X^N} - \big( \log x_0 + \log (\mu-\lambda) - \log \mu \big) \to W,$$ in distribution, as $N \to \infty$, where $W$ has the standard Gumbel distribution. This is equivalent to (\[eq.general\]), since in this range we have $$\begin{aligned}
\log \left( 1 + \frac {\lambda x_0}{(\mu-\lambda)N} \right) \le \log \left( 1 + \frac{\lambda \omega(N)}{(\mu-\lambda) N^{1/2}} \right) \\
= \log \left( 1 + \frac{\lambda}{\big((\mu-\lambda) N^{1/2}\big)^{3/4}} \right)= o(1).\end{aligned}$$

\(b) Set $x^*= x^*(N) = N^{1/2} \omega(N)$, and suppose $x^*(N) < x_0(N) \le (\mu-\lambda)N \omega(N)$. Now we run the chain for a time $t^* = t^*(x_0)$, as in the statement of Lemma \[lem.slow\]. Note that $N^{1/2}(\mu-\lambda)/ \omega(N) = \omega(N)^3 \to \infty$ as $N \to \infty$, so the asymptotic formula (\[eq.number\]) for $t^*$ is valid. Let $A$ be the event that $x^*(1 - \omega(N)^{-1/3}) \le X_{t^*} \le x^*(1 + \omega(N)^{-1/3})$: by Lemma \[lem.slow\] we have that ${\operatorname{\mathbb P{}}}(\overline A) = o(1)$.

Now let $(Y^N_t)$ be a copy of the stochastic SIS logistic process started in state $x^*(1 - \omega(N)^{-1/3})$, and $(Z^N_t)$ be another copy started in state $x^*(1 + \omega(N)^{-1/3})$. We may couple these two copies, as well as the chain $(X^N_t)$ from time $t^*$ onwards, in an obvious way. Then, on the event $A$, under the coupling, we have $Y^N_t \le X^N_{t^*+t} \le Z^N_t$ for all $t \ge 0$. We therefore also have, on the event $A$, under the coupling, that $T_e^{Y^N} + t^* \le T_e^{X^N} \le T_e^{Z^N} + t^*$. By Lemma \[lem.late\], we have $$(\mu - \lambda) T_e^{Y^N} - \big( \log x^* + \log (1- \omega(N)^{-1/3}) + \log (\mu-\lambda) - \log \mu \big) \to W,$$ in distribution, as $N\to \infty$, where $W$ has the standard Gumbel distribution. Therefore, since $\log(1-\omega(N)^{-1/3}) = o(1)$, we have, using the asymptotic formula (\[eq.number\]) for $t^*$, $$(\mu - \lambda) (T_e^{Y^N} + t^*) - \Big( \log x_0 + \log (\mu-\lambda) - \log \big( 1 + \frac{\lambda x_0}{(\mu-\lambda)N}\big) - \log \mu \Big) \to W,$$ in distribution, as $N \to \infty$. The same result holds for $T_e^{Z^N} + t^*$. Hence we also have $$(\mu - \lambda) T_e^{X^N} - \Big( \log x_0 + \log (\mu-\lambda) - \log \big( 1 + \frac{\lambda x_0}{(\mu-\lambda)N}\big) - \log \mu \Big) \to W,$$ in distribution, as $N \to \infty$, as required.

\(c) Suppose $x_0(N) > (\mu - \lambda)N \omega(N)$. Let $(Y^N_t)$ be a copy of the chain started in state $(\mu - \lambda)N \omega(N)$. Then there is a coupling of $(X^N_t)$ and $(Y^N_t)$ so that $T_e^{X^N} \ge T_e^{Y^N}$. Now let $t_0 = 1/\omega(N)^{1/2}(\mu-\lambda)$, as in Lemma \[lem.quick\]: as mentioned earlier, the idea is that $t_0$ is negligible compared to the overall extinction time. Let $B$ be the event that $X^N_{t_0} \le (\mu-\lambda)N \omega(N)$. By Lemma \[lem.quick\], ${\operatorname{\mathbb P{}}}({\overline B}) = o(1)$. There is then a coupling of $(Y^N_t)$ and $(X^N_{t_0+t})$ so that, on the event $B$, $Y^N_t \ge X^N_{t_0+t}$ for all $t \ge 0$, and so $T_e^{X^N} \le T_e^{Y^N} + t_0$.

Now, by the result in part (b), we have $$(\mu - \lambda) T_e^{Y^N} - \big( \log \big((\mu-\lambda)N \omega(N)\big) + \log (\mu-\lambda) - \log \big( 1 + \lambda \omega(N)\big) - \log \mu \big) \to W,$$ in distribution, as $N \to \infty$, which is equivalent to $$(\mu - \lambda) T_e^{Y^N} - \big( \log N + 2 \log (\mu-\lambda) - \log \lambda - \log \mu \big) \to W,$$ in distribution, as $N \to \infty$. Since $(\mu-\lambda) t_0 = o(1)$, it follows that $$(\mu - \lambda) T_e^{X^N} - \big( \log N + 2 \log (\mu-\lambda) - \log \lambda - \log \mu \big) \to W,$$ in distribution, as $N \to \infty$. This is equivalent to (\[eq.general\]), since in this range we have $$\log \big( 1 + \frac{\lambda x_0}{(\mu-\lambda)N} \big) = \log \lambda + \log x_0 - \log (\mu-\lambda) - \log N + o(1).$$ This completes the proof.

The critical regime {#sec.critical}
===================

We finish with a remark about the application of our methods to the critical regime, where $|\mu-\lambda| = O(N^{-1/2})$. In this case there exist constants $\delta, c > 0$ (depending on $\limsup_{N\to \infty} (\lambda-\mu)N^{1/2}$)), such that, for all starting states $x_0$, ${\operatorname{\mathbb P{}}}_{x_0} (T_e^{X^N} \le c N^{1/2}) > \delta$. One way to prove this is to follow our methods: first use Lemma \[lem.inequality\] with $t_0 = N^{1/2}$ and $z(t_0) = O(N^{-1/2})$, to show that, for some constant $c_1$, with positive probability, $X_{t_0} \le c_1 N^{1/2}$. Then compare the chain $(X_t^N)$ with the linear birth-and-death chain with the same parameters, both started in state $c_1 N^{1/2}$, and show that, for some constant $c_2$, with positive probability, the chain $(X_t^{N})$ reaches 0 in a further time $c_2 N^{1/2}$. Once we have this result, it follows that ${\operatorname{\mathbb P{}}}_{x_0} (T_e^{X^N} > c(N) N^{1/2})$ tends to 0 whenever $c(N) \to \infty$. Throughout the critical regime, a lower bound on the extinction time of the form ${\operatorname{\mathbb P{}}}_{N^{1/2}} (T_e^{X^N} \le {\varepsilon}(N) N^{1/2} ) \to 0$ whenever ${\varepsilon}(N)\to 0$ can again be obtained by comparing with a suitable linear birth-and-death chain. Much more precise results concerning the process in the critical regime started from a state of order $N^{1/2}$ are given by Dolgoarshinnykh and Lalley [@DL].

[99]{}

H. Andersson and B. Djehiche, A threshold limit theorem for the stochastic logistic epidemic, [*J. Appl. Prob. **35***]{} (1998) 662–670.

A.D. Barbour, Quasi-stationary distributions in Markov population processes, [*Adv. Appl. Probab **8***]{} (1976) 296–314.

M.S. Bartlett, On theoretical models for competitive and predatory biological systems, [*Biometrika **44***]{} (1957) 27–42.

G.R. Brightwell and Malwina J. Luczak, A fixed-point approximation for a routing model in equilibrium. Submitted.

C.R. Doering, K.V. Sargsyan and L.M. Sander, Extinction times for birth-death processes: Exact results, continuum asymptotics, and the failure of the Fokker-Planck approximation. [*SIAM J. Multiscale Modeling and Sim. **5***]{} (2005) 283–299.

R.G. Dolgoarshinnykh and S.P. Lalley, Critical scaling for the SIS stochastic epidemic, [*J. Appl. Prob. **43***]{} (2006) 892–898.

W. Feller, Die Grundlagen des Volterraschen Theorie des Kampfes ums Dasein in wahrscheinlichkeitstheoretischer Behandlung, [*Acta Biotheoretica **5***]{} (1939) 11–40.

David A. Kessler, Epidemic size in the SIS model of endemic infections, [*J. Appl. Prob. **45***]{} (2008) 757–778.

R.J. Kryscio and C. Lefèvre, On the extinction of the SIS stochastic logistic epidemic, [*J. Appl. Prob. **27***]{} (1989) 685–694.

T.G. Kurtz, Limit theorems for sequences of jump Markov processes approximating ordinary differential processes, [*J. Appl. Prob. **8***]{} (1971) 354–366.

E.J. Leigh, The average lifetime of a population in a varying environment, [*J. Theoret. Biol. **90***]{} (1981) 213–239.

Malwina J. Luczak, A quantitative differential equation approximation for a routing model. Submitted.

I. Nåsell, The quasi-stationary distribution of the closed endemic SIS model, [*Adv. Appl. Prob. **28***]{} (1996) 895–932.

Ingemar Nåsell, [*Extinction and Quasi-stationarity in the Stochastic Logistic SIS Model*]{}, Lecture Notes in Mathematics 2022, Springer (2011).

Eric Renshaw, [*Stochastic Population Processes*]{}, Oxford (2011).

P.F. Verhulst, Notice sur la loi que la population suit dans son accroisement, [*Corr. Math. Phys. **X***]{} (1838) 113–121.

G.H. Weiss and M. Dishon, On the asymptotic behavior of the stochastic and deterministic models of an epidemic, [*Math. Biosci. **11***]{} (1971) 261–265.

[^1]: The research of Malwina Luczak is supported by an EPSRC Leadership Fellowship, grant reference EP/J004022/2.


Humpback whale songs undergo a ‘cultural revolution’ every few years

Like any fad, the songs of humpback whales don’t stick around for long. Every few years, males swap their chorus of squeaks and groans for a brand new one. Now, scientists have figured out how these “cultural revolutions” take place.

All male humpbacks in a population sing the same song, and they appear to learn new ones somewhat like people do. Males in the eastern Australian population of humpbacks, for example, pick up a new song every few years from the western Australian population at shared feeding grounds or while migrating. Over the next few years, the songs spread to all South Pacific populations.

To understand how the whales learn the novel ballads, scientists analyzed eastern Australian whale songs over 13 consecutive years. Using spectrograms of 412 song cycles from 95 singers, the scientists scored each tune’s complexity for the number of sounds and themes, and studied the subtle variations individual males can add to stand out. Complexity increased as the songs evolved (as heard in the video below), the team reports today in the Proceedings of the Royal Society B . But after a song revolution, the ballads became shorter with fewer sounds and themes.

The revolutionary songs may be less complex than the old ones because the whales can only learn a certain amount of new material at a time, the scientists conclude. That could mean that although humpback whales are still the crooners of the sea, their learning skills are a bit limited.


Unilever Project Sunlight: Sharing a Meal for Childhood Hunger

by Lori. LAST UPDATED ON September 4th, 2016
The links in the post below may be affiliate links. Read the full disclosure.

This campaign is part of a sponsored conversation by Unilever’s Project Sunlight. All opinions are ours.

We were invited by Unilever’s Project Sunlight to learn more about the problem of childhood hunger in the US and talk with our readers about finding viable solutions. Through our partnership, we learned that 1 in 5 children in America are unaware of where their next meal is coming from. The term they use is “food insecure.”

Because we have more than enough, thinking about food insecurity and children is heartbreaking. Racquel and I were moved to follow some of the proactive suggestions that are provided in an easy to use toolkit put together by Project Sunlight US.

From the Feeding America Food Bank Locator, I found the Second Harvest Food Bank here in Orange County California where I live. If you are not familiar with Orange County, California, it is one of the nation’s most affluent counties.

My husband Art and I signed up to take a tour of the facility. Located in the former El Toro Marine Base, Second Harvest is a partner of Feeding America.

Every day we see wasted food and we see those in need. The Second Harvest Food Bank exists to help to bridge that gap. Second Harvest collects food from grocery stores, food manufactures, farmers, community food drives, restaurants and fresh produce gleaned from the fields.

The Second Harvest Food Bank invites local gardeners to donate their fresh fruits and vegetables grown in their backyards or community gardens to help nourish those in need.

Once that food is collected, stored and organized in their giant warehouse, community organizations, food pantries, and churches pick up the food and distribute it to more than 480 sites. During our tour they explained that Second Harvest is like a giant supermarket where the food pantries can shop.

According to Second Harvest, nearly 400,000 people in Orange County are at risk of hunger. Their findings match up with 1 in 5 children being at risk. This is a far cry from the Orange County depicted on television shows.

Working to End Childhood Hunger

At more than 36 sites across Orange County. Second Harvest provides healthy after-school meals, and summer meals along with nutrition education to 1,800 children every day.

Their School Pantry program brings fresh fruit, vegetables and other healthy food directly to kids, parents and other community residents at school locations. The food is delivered and arranged on tables similar to a Farmer’s Market. Now serving about 300 families, more than 40 additional schools have put in applications to join the program. As funds become available, more schools will be added.

Through their mobile pantry program, trucks deliver over 5,000 pounds of fresh-produce and staple items directly to families right in their neighborhoods.

Arranging a Local Food Drive

We learned that we can arrange for empty food collection barrels to be dropped off at my husband’s work location. We are going to organize a food drive and place the collection barrels by the entrances and exits of his building to collect food through the holidays. Once the barrels are full, we can call Second Harvest to arrange for them to be picked up.

Racquel and her children began a food drive to collect food for childhood hunger in their neighborhood. She used the resources and ideas found at the Project Sunlight website. She wanted to involve her young children to help to build awareness and to begin a family conversation around small acts of kindness and service.

A Shared Meal

Racquel became aware of a veteran in her community who is a widow and is facing hard times. Finding work in her rural area is difficult which means a meal on the table is sometimes scarce.

She invited him over to share a meal with her family and later, her quiet son shared that he thinks a classmate might be going hungry.

An Opportunity to Help a Family in Need

From this simple act of sharing a meal, Racquel is going to take some time to get to know the classmate’s family and hopes to invite them over to share their Thanksgiving meal.

We would like to encourage you to visit the Project Sunlight US website and discuss with your family how you might get involved and Share a Meal or volunteer to help end childhood hunger. If you are already taking action, we would love to hear about and share your ideas.

You Buy One, We Give One – Mark Your Calendar!

Coming up on November 16th in Sunday newspapers throughout the country, Unilever will be including a coupon offer for supermarkets nationwide. Unilever will donate one meal to Feeding America for every participating product that you purchase in participating stores from November 16th – 30th. Be sure and stay tuned for more updates here. Racquel and I hope you will participate with us in the “You Buy One, We Give One Campaign.”

Imagine having to tell your children that there is not enough money to buy food today. From job loss, medical illness, disability or family problems, there are multiple reasons why a family would find themselves in a hopeless situation. Every person’s story may be different but we can unite in our desire to put an end to childhood hunger in our land of plenty.

I love it when companies are involved in solving world problems. What a great cause to get involved with.

Robin (Masshole Mommy)

That is a wonderful cause and I loved learning about this great project!!

Danielle Stewart

Fabulous! My friend just had to go to the Food Bank for the first time in her life, while it was an extremely hard thing for her to do, she was treated with dignity and respect…and so grateful. Fantastic project.

Second harvest is such an amazing organization and it is so important to give back to others in need. I love the idea of sharing the experience with children so that they can understand early in life that not everyone has what they need to survive comfortably.

That is so nice of Unilever. Sharing is always a great idea and I believe if you don’t have the financial capacity, you can always share your time.. to volunteer maybe. 😛 I hope more people support this Unilever project.

Disclaimer: Nothing contained on this website is intended to constitute professional advice, including but not limited to, medical, legal, or financial advice. All information is provided "as is" without warranty of any kind. Views expressed here do not necessarily represent the views of this website or it's employees, contractors, users, or sponsors. Readers are expected to do their own research before making any purchases.

A part of Allyou.com Sites

The links found on this site may be referral links, which support this site at no cost to you. Please see my Disclosure Policy for full details


Top Products

This is a pack of 20 16-pin header connectors for the Omega2/Omega2+ modules. You need 2 headers for each module (one per side), so this is enough for 10 modules. The headers can be used if you are creating your own custom PCB and want to be able to insert the module in, just like you do with the Onion Expansion docks.


1. Field of the Invention
This invention relates to the nursing home, retirement home, assisted living facility, and other long-term care industries in general and, more particularly, to pharmaceutical operations within nursing homes, retirement homes, assisted living facilities, and other long-term care facilities.
2. Description of Related Art
Over the years, pharmacies have been a backbone in providing prescription drugs and other medications to people and have been a convenience as retail pharmacies have expanded to locating close to most residential areas in our country. Recently, pharmacies also have been placed inside of facilities such as hospitals, physician offices, malls, nursing homes, retirement homes, assisted living facilities, and other locations to make it easier for people to get access to medications and to facilitate interaction with medical personnel. Because of the numerous types of medications stored and dispensed by pharmacies, automation within the pharmacy industry has been desirable. Accordingly, numerous developments have been made to automate the pharmacy ordering, dispensing, and storage capabilities. For example, machines have been developed to store and dispense medication responsive to security codes or other identification from medical personnel or users. Also, electronic storage and dispensing carts have been developed which are often stored on each floor of a hospital to allow the carts to electronically receive dispensing instructions from a hospital pharmacy computer. Additionally, machines have been developed to store several hundred different types of medications and to dispense the medications to medical personnel for distribution to patients.
Nevertheless, little has been done to enhance storage and distribution of medications in nursing homes, retirement homes, Alzheimer's living facilities, senior communities, assisted living facilities, and other types of long term care facilities (hereinafter collectively “long-term care facilities”) which are significantly different in operation, personnel structure, and physical structure than hospitals, physician offices, and home care. This is increasingly important as the baby boom generation ages and more and more people enter these long-term care facilities. Also, because more and more people are and will be entering these long-term care facilities and because medication costs have been rising over the years, attempting to help make pharmacies, providing services to these long term facilities, profitable can often be important in successfully operating a long-term care facility. Further, error can arise when dispensing medication, and a need still exists to reduce the risk of error in dispensing medication, especially in long-term care facilities.


5th Generation Flite is the lightest kite that’s ever been made by Ocean Rodeo. This kite offers impressive performance in extremely low wind conditions. With its swift turns and nearly effortless air jumps, this is a must have kite for a light-wind day!

The Prodigy lives up to its name, being the most popular and easy to control kite, designed for ultimate freeriding and/or wave kiting. With its solid 3-strut design it delivers smooth, effortless turns, lasting air hang, and ideal steering when handling de-power situations. The 2016 Prodigy is lighter than ever, now also features high flow inflate / deflate valves!

The Razor, is by far the most praised kite of Ocean Rodeos collection! It is built to perform in an environment that requires agility and precision in control for the ace professional. With the unique Venturi technology, powerful 4strut canopy and FST wing tips this beauty guarantees the ride of a lifetime!

Built with a tight, 3 strut frame and big lifting wingtips the Roam is a dedicated Wave kite that drifts down the line while maintaining positive steering with tight, pivot turns for ultra fast changes of direction.

If you’re just getting into the exciting world of kitesurfing, we can’t think of a better jump start than with Ocean Rodeo’s React Trainer kite. The kit comes ready to fly, comes with a 2m tube kite, control bar, lines and trainer harness specifically designed for ease of use for beginners.

Decided to try kiteboarding? You're in for one exhilarating adventure! While there are many things to cover, every one certainly starts with a small trainer kite. Ocean Rodeo's 1.5m Start Trainer kite is perfect for the task!

Signup for iKite Canada newsletters

Leave this field empty if you’re human:

Connect with us on social media

iKite Canada is the ultimate kiteboarding club, based in Toronto. Our vision is to popularize this sport in Canada through supporting the kiteboarding community by teaching professional kitesurfing and snowkiting classes in Ontario, providing all enthusiasts with a specialized online store that sells gear, and offering travel tours to exclusive kiteboarding destinations around the world!


import { style } from 'typestyle';

export const tabStyle = style({
  padding: '5px 8px',
});

export const tableStyle = style({
  overflowY: 'auto',
  height: 'calc(100vh - 180px)',
});


Last week UPC launched its groundbreaking new TV experience to its customers.

For the first time, this unique service offers customers the benefit of seven day catch-up TV from the RTÉ Player and 3player and over 1,300 hours of the best box sets and series for free. Additionally, Movies On-Demand is also available at the touch of a button.

Over one third of Dublin homes have instantly received the on demand service and it will roll out to the rest of the country throughout the summer to eventually reach 600,000 homes in Ireland.

Access to ITV, BBC and US box sets as well as the On Demand content from MGM, True Movies, Food Network, History and Discovery Channel will be available with further new programmes and content being added in the weeks ahead. Additionally, there are complete box sets of award winning US TV, such as Blue Bloods, The Good Wife and Dexter among others – available free of charge to UPC Select and Max customers through their UPC digital remote.

UPC has negotiated with the top Hollywood studios to allow customers to rent from hundreds of movies, including the latest box office hits, directly through their TV at the touch of a button. UPC will provide the latest release movies at the same time as they are available on DVD.

The on demand movies are very likely to pose yet further problems for Xtravision’s already struggling business model. We would anticipate an increased push behind their postal subscription service, although this still has nowhere near the ease of functionality that UPC is offering and does not provide a substantial cost saving.

The greater issue from a media planning point of view is the catch up TV service will most likely further fragment the viewing of TV as viewers also avail ofonline broadcast programme options.

Any viewers watching a programme on the catch up service rather than the TV broadcast (including anyone who recorded the programme and watched it later) will no longer be picked up by Nielsen as a TV viewer.

This will inevitably lead to a reduction in Nielsen monitored TV viewing – when fully rolled out the on demand service will be available in almost 40% of all homes. Any reduction in monitored ad impressions will mean reduced supply for RTÉ and TV3 and may lead to price inflation (assuming demand does not reduce further than supply).

However, the viewers will not be lost; they will simply be watching the programme on a different feed. They will even be watching it on the same television set – as far as the viewer is concerned they are just watching the programme they want to watch on their TV, they will have no concept of which “feed” has supplied it.

Currently the catch up service does not carry advertising but the intention is that it will in the same manner as the online and mobile versions. The increased inventory the catch up service will provide for RTÉ and TV3 should also lead to deflation for “player” advertising be it either through straight reduction in cost per thousands or through the development of more optimized packages.

What we know for sure is that once the service is carrying advertising it will become even more important to ensure “player” advertising is incorporated into broadcast media plans since it will further blur the lines for the viewer about where they watch their TV and make it more about what they watch.

Chris Nolan – Director

As always, if you have any opinions- supporting or conflicting- on this post or related matters we’d love to hear from you, so please feel free to post replies below

The oft maligned newspaper industry has frequently been accused of being (for want of a better term), “yesterday’s news” but, in the UK at least, positive steps appear to have been made this past week to address the evolving environment that newspapers are currently in.

The Newspaper Marketing Agency (UK) has rebranded itself as Newsworks. Their core objective is to “help advertisers and agencies harness the power of national ‘newsbrands’ – in all their forms – to achieve their communication objectives”. It is funded by six national newspaper groups in the UK including Guardian News & Media, Independent Print Limited, Mail Newspapers, Mirror Group Newspapers, News International and Telegraph Media Group. The organisation provides a range of services including research, case studies, creative benchmarking and training.

So what is the reason for the rebrand? As Roy Greenslade highlighted in his Guardian blog this past Monday, the rebrand is “indicative of the changed landscape of the news industry”, i.e. the ways in which people consume and engage with news content are changing before our very eyes. The new reality for publishers is that while consumer appetite for news and entertainment has not dwindled, the platforms through which content is consumed has changed dramatically. The advent of mobile technology via smart phone and tablet has made accessing information on-the-go much easier and is actively contributing to a change in the consumption patterns of news and entertainment content. Although print circulations are in decline, the printed product is still obviously a huge part of the mix for ‘newsbrands’ but it is (and will continue to be) just that, a single part of a multi platform offering.

Rebranding their marketing body as Newsworks is a clear sign that the UK industry has accepted this new reality. Just take a minute to look at the actual name, Newsworks. It is a clear signal that the definition of the newspaper publisher is being redefined. Publishers or newsbrands can no longer be defined solely on the production of a daily printed product. At their core, they are providers of content, whether it covers news, lifestyle, entertainment or sport. Newsbrands still have huge influence within society and have the innate ability to generate debate amongst both the general public and rival media. According to Newsworks, in the UK, although the methods of content consumption and distribution of newsbrands content is becoming more varied, the rate at which people are beginning to access newsbrands on digital platforms is increasing faster than print readership is contracting. This is clear evidence that the core offering from newsbrands is still relevant, important and being actively sought out by consumers.

The future for what we used to term ‘newspapers’ is clear. It is now time to embrace it.

UPC are increasing their offering this week with the launch of three new RTÉ Digital channels. RTÉ One+1 launched on Tuesday the 13th March while RTÉ Two HD and RTÉjr, their children’s offering, launch today, Thursday 15th March. The new channels will be available to all UPC Digital customers. SKY will carry RTE One+1 and RTEjr from May.

RTÉ Two HD will be a big draw for sports fans, broadcasting the RBS 6 Nations triple header this Saturday as well as Champions League games, key GAA championship fixtures and many more key sporting events across the year in high definition. RTÉjr will carry no advertising during preschool hours of 8:30am and 15:15. The channel will simulcast RTÉ2 until 15:15 and will then run on a loop until 19:00 when RTEOne+1 will kick in. As with the RTÉ player, Fair City will not be broadcast on RTÉ One+1 due to rights issues so the channel will be blank over this period.

“UPC is committed to bringing our customers the best possible Digital TV service and we are the only pay-TV provider to carry the RTÉ One+1 (EPG 107), RTÉ Two HD (EPG 135) and RTÉjr (EPG 600) channels,” said Simon Kelehan, head of TV, UPC. “The addition of these channels to our digital package offers our customers more television choice than ever before.”

Currently these channels are not tracked by Nielsen, however RTE One+1 is due to be monitored in the next 4 weeks with the other 2 having data in the next 6 weeks.

Until now RTÉ One +1, RTÉ Two HD and RTÉjr were only available to the 49,000 Saorview homes. The latest Nielsen data estimates 340,000 UPC Digital homes.

RTE One +1, RTE Two HD and RTEjr are available to Saorview customers at present, which translates to 49,000 homes. The latest Nielsen data estimates that there are a further 340,000 UPC Digital homes who can now benefit from these latest offerings.

Sarah Murphy – Broadcast Director

As always, if you have any opinions- supporting or conflicting- on this post or related matters we’d love to hear from you, so please feel free to post replies below

Following the recent Competition Authority ruling, it is very welcome news that RTÉ has agreed to abolish its practice of pricing television airtime based on the share it receives of an advertiser’s television budget. Their trading policy was based on the rule that the higher the share of television budget an advertiser gave to RTÉ, the less expensive the airtime. The policy made it difficult to plan budgets at an optimum level because the price of airtime on RTE rose significantly if an advertiser tried to give increased share to other television channels.

RTÉ have committed to change their trading system in July 2012, however, they planned to continue their current trading practice for the January to June period next year. Our view is that by only releasing policy and prices for the January to June 2012 six month period this will make planning television next year very difficult and will create increased uncertainty. We are expecting RTÉ to relook at this and create a more stable planning environment for 2012.

The review from the Competition Authority (to be available here from mid December this year) also brings into sharp focus the debate on how RTÉ is funded and what this may look like in the future. With the appointment of Willie O’Reilly as Commercial Director, RTÉ have signalled their intention to look at a major restructure of their commercial division which will see a more centralised commercial approach across all their media platforms. A very interesting year awaits all TV stakeholders in 2012.

Local Newspaper Week recently ran at the end of October. This inaugural initiative was spearheaded by the Regional Newspapers and Printers Association of Ireland (RNPAI) and was promoted to agencies and clients by Mediaforce Ireland. The aim of the week long initiative was to “celebrate local newspapers and the important role they play right across Ireland.”

The launch of the initiative took place at the Alexander Hotel on Wednesday, 26th October and featured a presentation of the IPSOS/MRBI research and an address by Minister for Communications, Pat Rabbitte TD.

Over 30 RNPAI newspapers participated in the week-long event which included a 16-page tabloid supplement inserted into all participating titles which promoted local press, as well as details of a microsite.

So, what to make of this week long promotion of local press?

We live in a time when the media landscape presents us with more choice than ever before in terms of the breadth of vehicles we can use to target consumers. It is also a time when newspapers (both national and regional) have received much criticism, with the doom merchants proclaiming the imminent demise of the medium on a regular basis. With this in mind, it was very refreshing to see regional press raising its head above the parapet and making a concerted effort to re-establish its credentials amongst advertisers, agencies and the wider public.

The tabloid supplement was a nice mixture of localised content for each title (featuring advertiser & reader testimonials and historical pieces on each paper) with additional information given on the background of the project and on the research results. The research itself yet again affirmed the bedrock footing that local newspapers have in Ireland.

Some key points:

76% of households buy a local newspaper at least once a month

63% of respondents trust their local paid for newspaper the most to deliver local news about their area

Three quarters of all respondents have an opinion that their local newspaper offers value for money

Levels of engagement remain high with half of all respondents reading the entire newspaper each week & the average length of reading per week is approximately 69 minutes

Respondents are strong advocates of local press both in terms of news (86%) and information on products & services (81%)

Source: RNPAI/Ipsos MRBI 2011

In addition to re-affirming the important role that local newspapers play among communities, it was encouraging to see RNPAI members actively going to local schools to promote and educate what will hopefully be their next generation of readers. This is a key area for the newspaper industry as a whole to address, in order to develop and maintain their readership in future years.

Efforts such as this are to be commended, given the battle the industry seems to be facing to prove itself. Despite the continual evolution of digital, local newspapers still play a huge part in the lives of people across Ireland and cannot be overlooked by advertisers when seeking engagement at a local level.


Q:

How to loop in Python to create files with names in list

I have a list of colors with a txt file containing URLs of images of those colors. I am trying to create a folder to contain images of each color and move this directory so that I may ultimately download the images.
I am able to perform this for each element of the list individually, but this is tedious and I would prefer to automate it.
classes = ['red', 'orange', 'yellow', 'green', 'blue', 'purple']

This is the code I currently have for each color:
folder = 'red'
file = 'red.txt'
mv red.txt data/colors

path = Path('data/colors')
dest = path/colors
dest.mkdir(parents=True, exist_ok=True)

download_images(path/file, dest, max_pics=200)

I expect to have a folder per color containing the respective downloaded images.

A:

Your list of colors is in classes python list. You have <color name>.txt files containing URLs of images of those colors listed in classes list. So you have an initial directory structure which looks like following directory tree:
.
├── blue.txt
├── green.txt
├── orange.txt
├── purple.txt
├── red.txt
├── script.py
└── yellow.txt

Now you want to create separate directories for each color. So finally your directory structure should look like following directory tree:
.
├── data
│   └── colors
│       ├── blue
│       ├── blue.txt
│       ├── green
│       ├── green.txt
│       ├── orange
│       ├── orange.txt
│       ├── purple
│       ├── purple.txt
│       ├── red
│       ├── red.txt
│       ├── yellow
│       └── yellow.txt
└── script.py

Where your download_image() method will download the image for given URLs in <color name>.txt file which it receives as one of the arguments. It also receives the destination of the image directory to be placed and the maximum no of images it should download.
If I understood your problem correctly following code would solve your problem. Code is well commented and self-explanatory. You can drop comments to ask for more clarifications.
import os

base_path = "data/colors/"
# create base path directories if not already present
os.system("mkdir -p data")
os.system("mkdir -p data/colors")

classes = ['red', 'orange', 'yellow', 'green', 'blue', 'purple']

# dummy download image function
def download_image(path, dest, max_pics):
    print("URL file path: " + path)
    print("Image destination: " + dest)
    print("No of Images to be downloaded: " + str(max_pics))

if __name__ == "__main__":
    for colour in classes:
        # create directories for each colour if not already present
        os.system("mkdir -p " + base_path + colour)
        # move <colour_name>.txt file into base path
        os.system("mv " + colour+".txt " + base_path)
        dest = base_path + colour
        # call download_image method
        download_image(base_path+colour+".txt", dest, max_pics=200)