scieee AI-readable full text Open interactive document viewer

Two Multi-Sigmoidal Diffusion Models for the Study of the Evolution of the COVID-19 Pandemic

Barrera, Antonio,Román Román, Patricia,Serrano Pérez, Juan José,Torres Ruiz, Francisco De Asís

Abstract

Ministerio de Economía, Industria y Competitividad, Spain, under Grant MTM2017-85568-P

Full text

mathematics Article Two Multi-Sigmoidal Diffusion Models for the Study of the Evolution of the COVID-19 Pandemic Antonio Barrera 1,2,† , Patricia Román-Román 2,3,† , Juan José Serrano-Pérez 3,† and Francisco Torres-Ruiz 2,3,*,†   Citation: Barrera, A.; Román-Román, P.; Serrano-Pérez, J.J.; Torres-Ruiz, F. Two Multi-Sigmoidal Diffusion Models for the Study of the Evolution of the COVID-19 Pandemic. Mathematics 2021,9, 2409. https://doi.org/ 10.3390/math9192409 Academic Editor: Davide Valenti Received: 30 July 2021 Accepted: 22 September 2021 Published: 28 September 2021 Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. Copyright: © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). 1Departamento de Análisis Matemático, Estadística e Investigación Operativa y Matemática Aplicada, Facultad de Ciencias, Universidad de Málaga, Bulevar Louis Pasteur, 31, 29010 Málaga, Spain; [email protected] 2Instituto de Matemáticas de la Universidad de Granada (IMAG), Calle Ventanilla, 11, 18001 Granada, Spain; [email protected] 3Departamento de Estadística e Investigación Operativa, Facultad de Ciencias, Universidad de Granada, Avenida Fuente Nueva s/n, 18071 Granada, Spain; [email protected] *Correspondence: [email protected]; Tel.: +34-958241000 (ext. 20056) † These authors contributed equally to this work. Abstract: A proposal is made to employ stochastic models, based on diffusion processes, to represent the evolution of the SARS-CoV-2 virus pandemic. Specifically, two diffusion processes are proposed whose mean functions obey multi-sigmoidal Gompertz and Weibull-type patterns. Both are constructed by introducing polynomial functions in the ordinary differential equations that originate the classical Gompertz and Weibull curves. The estimation of the parameters is approached by maximum likelihood. Various associated problems are analyzed, such as the determination of initial solutions for the necessary numerical methods in practical cases, as well as Bayesian methods to determine the degree of the polynomial. Additionally, strategies are suggested to determine the best model to fit specific data. A practical case is developed from data originating from several Spanish regions during the first two waves of the COVID-19 pandemic. The determination of the inflection time instants, which correspond to the peaks of infection and deaths, is given special attention. To deal with this particular issue, point estimation as well as first-passage times have been considered. Keywords: COVID-19; diffusion processes; multi-sigmoidal curves; inference in diffusion processes; first-passage times 1. Introduction There can be no doubt that the outbreak of the global pandemic caused by the SARS- CoV-2 virus has produced a strong shock worldwide, the repercussions of which are still far from being seen. Obviously, the main concern is to contain the spread as soon as possible, thus putting a stop to the interminable trickle of deaths left in its wake. The data provided in real time by Johns Hopkins University [ 1 ] quantify the number of the infected, as of 22 July 2021, at around 192 million, while the deceased amount to more than 4.1 million. Fortunately, vaccination campaigns are beginning to bear fruit, although there is still a long way to go, especially in developing countries. To add to the problem, severe economic losses are being felt as a result of the pandemic. It is still too early to evaluate their full impact, although some studies are already looking into the matter (see for example [2]). Since the beginning of the pandemic, multiple efforts have been made to model its evolution and understand its behavior. Knowledge of applicable models can help, on the one hand, to make correct decisions to mitigate the spread of the virus and, on the other, to design actions against future health crises of the same nature. For this reason, the scientific community is making strenuous efforts to apply existing techniques and develop new ones capable of modeling and predicting the evolution of the epidemic. Mathematics 2021,9, 2409. https://doi.org/10.3390/math9192409 https://www.mdpi.com/journal/mathematics Mathematics 2021,9, 2409 2 of 29 In this regard, compartmental epidemiological models have been a main focus of attention. Among them, SIR models stand out, which are based on the assumption that the population can be classified into three independent compartmentalized groups (susceptible, infected, and recovered). The number and type of compartmentalized groups can be modified to better reflect the specific dynamics of the disease, giving way, for example, to SEIR models (susceptible, exposed, infected, and recovered). In both cases, the models represent how individuals can progress from one compartmentalized group to the next (see [3] for more details about the compartmental models). Although such models have been widely applied, the specifics of the present pandemic has led researchers to explore how certain modifications can be introduced in the models. For example, Gounane et al. [ 4 ] developed a non-linear SIR model that includes the effect of social distancing imposed by governments around the world. Khan et al. [ 5 ] introduced the so-called SQUIDER model in which new compartments are incorporated; specifically infected and undetected cases (U), undetected recovered cases (E), quarantined cases affected by social distancing (Q), and deaths from contagion (D). Furthermore, Ianni et al. [6] introduced temporal dependence on the parameters of the classical SIR model, thus affecting the behavior of the basic reproductive number R0 over time. This is intended to take into account containment measures, such as lockdowns, social distancing, and limitations on commercial activities. The resulting models are called SIR-T and SIRD-T. While all the efforts mentioned above address compartmental models from a deterministic point of view, some research has looked into the development of stochastic models, including fractional versions of the same (see for instance [7]). Apart from these epidemiological models, several authors have considered other approaches. Among others we can cite the work of Maleki et al. [ 8 ] in which they considered ARMA processes based on two-piece scale mixture normal distributions; Ünlu and Namb [9] used machine learning techniques and addressed various epidemiological models from a Bayesian perspective. Special mention must be made of functional data techniques, which have been applied to several lines of research. For example, Ref. [ 10 ] used principal component analysis to discover patterns of pandemic progression as well as to identify the countries that better represent these archetypes. Similarly, Acal et al. [ 11 ] proposed a principal components multiple function-on-function regression model for the imputation of missing data in the COVID-19 hospitalized and intensive care curves of several Spanish regions. The evolution dynamics of the current pandemic, as in previous ones, point at the importance of considering models based on growth curves, mainly those of the sigmoidal type. Some of them, such as the Richards curve, have already been used in previous situations of this nature (Hsi et al. [ 12 ], Wang et al. [ 13 ]). Concerning COVID-19 specifically, mention must be made of Català et al. [ 14 ], where the authors employed the Gompertz curve; and of Li et al. [ 15 ], a comparative study performed using the Richards, logistic, Von Bertalanffy, and Gompertz curves, among others. However, such curves present a fairly rigid behavior, so it is necessary to resort to more flexible models. In this sense, Tovissodé et al. [ 16 ] have used the generic growth model introduced by Turner et al. [ 17 ]. A fundamental aspect that must be taken into consideration is that practically all the studies in this line of research focus on modeling the first wave of the pandemic. This is due to these curves presenting a sigmoidal behavior with only one inflection point. Sadly, this does not allow for a more in-depth analysis of the evolution of the pandemic as a whole. Therefore, if more complex behaviors are to be modeled, it becomes necessary to consider multi-sigmoidal curves. Likewise, a large part of the studies have been carried out from a deterministic point of view, so they do not take into account possible random fluctuations as well as influences external to the system. The fact that growth curves have their origin, for the most part, in the solution of an ordinary differential equation naturally leads to the consideration of stochastic differential equations whose solutions are, under certain conditions, diffusion processes. Some works have recently been published which combine both aspects, that is, the multi-sigmoidal and the stochastic character of the model. Mathematics 2021,9, 2409 3 of 29 Román-Román et al. [ 18 ] considered a diffusion process associated with a plurisigmoidal Gompertz curve, while Di Crescenzo et al. [ 19 ] proposed two growth and death processes and a diffusion process whose mean functions are logistic curves that present several inflection points. In summary, the starting motivations of the present work can be summarized as: • The need for the broadest possible knowledge of the evolution dynamics of the pandemic, focusing on determining points of contagion peaks, inflections in its evolution, duration, and the succession of waves. • The need to consider models that reproduce the observed multi-sigmoidal behavior of the pandemic. • The need to consider stochastic models that allow the aspects mentioned above to be studied from a probabilistic perspective. With these ideas in mind, the present paper is a proposal to employ diffusion processes, whose mean functions are multi-sigmoidal curves, in order to model the evolution of the pandemic through various waves by considering both the number of infected individuals and the number of deaths. Specifically, the Gompertz process introduced in [ 18 ] is considered, as well as a version of the generalized Weibull-type process that was proposed by Barrera et al. [ 20 ]. In both cases, the processes are obtained by including polynomial-type functions in the ordinary differential equations that give rise to the Gompertz and Weibull curves, respectively. Both processes can be viewed from a common perspective such as that provided by the inhomogeneous lognormal diffusion process. Stochastic diffusion processes provides advantages over other commonly-used models for the study of epidemiological phenomena, such as SIR models based on differential equations. The probabilistic nature of the model allows the researcher to evaluate the variability of the model estimates, considering, for example, confidence intervals for the estimates and predictions made. In addition, in the specific case of diffusion processes such as the ones considered in this paper, they can be used to study several temporary variables of notable interest. Specifically, in the present case the determination of the time instants in which the infection and death peaks are reached can be approached by calculating first-passage times, which provides a valuable probabilistic tool for its study and analysis. Under these general considerations, this paper is structured as follows: Section 2 is dedicated to introducing the multi-sigmoidal Gompertz and Weibull curves, while Section 3 introduces the processes associated with each of the previous curves, based on the inhomogeneous lognormal diffusion process. These two sections cover both models in a unified way, which will help simplify the expressions to be derived later on. Section 4 is dedicated to the estimation of the parameters of the models being considered, which is carried out by maximum likelihood. This section includes some strategies aimed at the selection of initial solutions for the numerical methods necessary for the estimation, and describes a strategy for the selection of the optimal polynomial in each case. Finally, Section 5 uses both processes to model pandemic-related data originating from several Spanish regions during the first two waves of infection, and proposes a strategy for selecting the model that best fits the observed data. For the selected model, a study of the inflection times is considered, which determine the infection and deaths peaks in each wave. This analysis is carried out from the point estimation of said instants and from the study of the first-passage times of the process through the values where inflections occur. Finally, some conclusions are drawn. 2. Gompertz and Weibull Multi-Sigmoidal Curves In this section, we introduce two multi-sigmoidal versions of the Gompertz and Weibull curves. Both are obtained through the inclusion of polynomial functions in the ordinary differential equations whose solutions are said curves. More in detail, let Qβ(t) = ∑p `=1β`t` be a polynomial of degree p> 0, where β=β1, . . . , βpT is a real Mathematics 2021,9, 2409 4 of 29 parametric vector such that βp> 0. Let us consider t≥ 0 and define the multi-sigmoidal Gompertz function as f¯ θg(t) = kgexp−αgexp−Qβg(t),¯ θg=αg,βT gT, (1) and the multi-sigmoidal Weibull functions as f¯ θw(t) = kw−αwexp−Qβw(t),¯ θw=αw,βT wT, (2) where αg , αw> 0 and the parameters kg , kw> 0 are the asymptotic values of every curve, i.e., the carrying capacity of every model. Here we denote with g and w those expressions related to the Gompertz and Weibull models, respectively. Each of such functions can be viewed as the solution of the Malthusian-type linear differential equation d dt fθ(t) = hθ(t)fθ(t),θ=¯ θg,¯ θw, (3) where the key function hθis defined as follows: hθ(t) =    αgPβg(t)e−Qβg(t)if θ=¯ θg, αwPβw(t)e−Qβw(t)kw−αwexp−Qβw(t)−1if θ=¯ θw. Here, Pβg(t) is the polynomial satisfying d dt Qβg(t) = Pβg(t) for all t (analogously for the Weibull case with βw ). From the definition of hθ it follows that the growth periods of the curves are related with the roots of Pβg and Pβw . Indeed, at every root the derivative vanishes and the process stops growing. This is also directly related with the inflection points of the curves, which are discussed at the end of this section. Other differential equations can be derived from (3) by taking into account the original expressions (1) and (2) for Gompertz and Weibull multi-sigmoidal models, respectively. Indeed, d dt fθ(t) =   log kg−log f¯ θg(t)f¯ θg(t)Pβg(t)if θ=¯ θg, kw−f¯ θw(t)Pβw(t)if θ=¯ θw, leads to solutions, provided the initial condition fθ(t0) = f0>0 for all θ, fθ(t) =    explog kg1−e−Qβg(t)−Qβg(t0)+log f0e−Qβg(t)−Qβg(t0)if θ=¯ θg, kw−(kw−f0)exp(−αwQβw(t)−Qβw(t0))if θ=¯ θw. By taking limits when t goes to infinity, such functions tend to values (the carrying capacity) which do not depend on the initial values. This is the main difference with respect to the model solution of Equation (3). As a matter of fact, by considering fθ(t0) = f0 for t≥t0≥0, Equation (3) leads to curves fθ(t) =      f0exp−αe−Qβg(t)−e−Qβg(t0) if θ=θg, f0η−exp(−Qβw(t)) η−exp(−Qβw(t0))if θ=θw, (4) where θg=α,βT gT and θw=η,βT wT for α=αg and η=kw/αw . Note that, provided such reformulation, the Weibull model now has one less parameter. From now on, all definitions depending on θwill be considered for values θgand θw, instead of ¯ θgand ¯ θw. Mathematics 2021,9, 2409 5 of 29 Related with the above equations, note that the expression of hθ is simplified after the reformulation, being now hθ(t) =    αPβg(t)e−Qβg(t)if θ=θg, Pβw(t)e−Qβw(t)η−exp−Qβw(t)−1if θ=θw. (5) Furthermore, note that the limit value of such models depends on initial values t0 and f0, that is, lim t→∞fθ(t) =      f0expαe−Qβg(t0)if θ=θg, f0η η−exp(−Qβw(t0))if θ=θw. The use of the latter models is justified in the cases of phenomena with multiple sample paths of observations, each starting at different points and having different limit values. Due to this more general character, in what follows we will consider the expressions of fθgiven in (4). As mentioned above, inflection points are of great importance in studying the behavior of this type of curves. As such points make the second derivative of the curve vanish, expressions can be obtained by differentiating (3) and taking into account expressions of hθ . Therefore, in the case of the multi-sigmoidal Gompertz function, condition d2 dt2fθg(t) = 0 leads to equation d dt Pβg(t) = P2 βg(t)1−αexp−Qβg(t), whereas, in the case of the multi-sigmoidal Weibull function, it follows that d dt Pβw(t) = P2 βw(t). The solutions of these equations are the inflection points of the curves. Many growth phenomena usually present at least one inflection, representing the moment when the growth rate changes. Multi-sigmoidal models may have multiple inflection points, and are therefore useful in modeling such types of growth phenomena. In order to illustrate the behavior related with inflection points, Figure 1shows multisigmoidal Gompertz and Weibull curves for different values of the polynomial coefficients when p= 3, f0= 5, α=log 2 and η= 2, as well as its first and second derivatives, all according to the values of Table 1. Table 1. Polynomial coefficients for examples in Figure 1. Number of Inflections βgβw 0(0.4, −0.005,0.0002) (0.3, −0.003,0.0001) 1(0.01,0.003,0.001) (0.001, 0.0005, 0.001) 2(0.025, −0.005,0.0015) (0.03, −0.003,0.0005) Mathematics 2021,9, 2409 6 of 29 0 5 10 15 20 5678910 t Multi−sigmoidal Gompertz 0 5 10 15 20 0.0 0.5 1.0 t 1st. derivative 2nd. derivative Multi−sigmoidal Gompertz 0 5 10 15 20 5 6 7 8 9 10 t Multi−sigmoidal Weibull 0 5 10 15 20 −0.5 0.0 0.5 1.0 1.5 t 1st. derivative 2nd. derivative Multi−sigmoidal Weibull 0 5 10 15 20 5678910 t Multi−sigmoidal Gompertz 0 5 10 15 20 −0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 t 1st. derivative 2nd. derivative Multi−sigmoidal Gompertz 0 5 10 15 20 5678910 t Multi−sigmoidal Weibull 0 5 10 15 20 −0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 t 1st. derivative 2nd. derivative Multi−sigmoidal Weibull Figure 1. Cont. Mathematics 2021,9, 2409 7 of 29 0 5 10 15 20 5 6 7 8 9 10 t Multi−sigmoidal Gompertz 0 5 10 15 20 0.0 0.2 0.4 0.6 t 1st. derivative 2nd. derivative Multi−sigmoidal Gompertz 0 5 10 15 20 5 6 7 8 9 10 t Multi−sigmoidal Weibull 0 5 10 15 20 0.0 0.1 0.2 0.3 0.4 t 1st. derivative 2nd. derivative Multi−sigmoidal Weibull Figure 1. Examples of multi-sigmoidal curves and their inflections. Next to every curve, its first and second derivatives are shown. The first two columns correspond to the multi-sigmoidal Gompertz model, and the others to the multi-sigmoidal Weibull. The rows show, from top to bottom, the cases with no inflection, one and two inflections, respectively, (marked with a red vertical dashed line in the plot of the derivatives). Mathematics 2021,9, 2409 8 of 29 3. Gompertz and Weibull Multi-Sigmoidal Diffusion Processes The aforementioned deterministic models are useful to describe growth phenomena in their most basic terms. However, in order to build a more precise model able to take into account other factors and uncertainties, their stochastic counterparts are recommended. Random fluctuations appear in every dynamical behavior, whether as a result of the nature of the phenomenon under study or as the uncertainty derived from observation and measurement instruments. They must therefore be included in any model attempting to describe the growth phenomena in any significant depth. A traditional way to build stochastic models is including a random term (usually a white noise) in an ordinary differential equation. Nevertheless, such approach may lead to intractable models due to the potentially high complexity of the deterministic base model. For this reason, it might be useful to consider other approaches, such as adding a random perturbation to a parametric function. In this case, following (3) , it is possible to introduce a white noise ζ(t) with spectral density σ2 , where σ> 0 will be the diffusion coefficient of the stochastic model, in order to randomly perturb function hθ(t) (from (5)) and to obtain a function hθ(t) + ζ(t) . Please note that, for the sake of clarity and following the unified notation of the previous section, from now on we will omit the subscript in the expression for θ. After replacing hθ(t) with hθ(t) + ζ(t) in (3), such expression becomes a stochastic differential equation; concretely dX(t) = hθ(t)X(t)dt +σX(t)dW(t), (6) where W(t) is the standard Wiener process, independent of initial value X(t0) for t≥t0 . Here, t0≥ 0 is the initial time and t∈[t0 , T] where [t0 , T] is the parametric space of the process. Taking into account that hθ is continuous in t∈[t0 , T] , Equation (6) verifies the conditions for the existence and uniqueness of a solution. Said solution is a stochastic diffusion process, known as inhomogeneous lognormal diffusion process, taking values on R+ and characterized by infinitesimal moments A1(x , t) = hθ(t)x and A2(x) = σ2x2 . In addition, a closed-form expression for the solution can be provided. In fact, by considering initial condition X(t0) = X0 , being X0 a random variable whose distribution must be either degenerate or lognormal (as further explained later in this section), we have X(t) = X0exp(H˜ θ(t0,t) + σ(W(t)−W(t0))),˜ θ=θT,σ2T, where function H˜ θis defined, for t0≤s<t≤T, as H˜ θ(s,t) = Zt shθ(u)du −σ2 2(t−s). Note that parameter ˜ θ takes the form ˜ θg or ˜ θw when θ=θg or θ=θw , respectively, where ˜ θg=θT g,σ2Tand ˜ θw=θT w,σ2T. Function H˜ θ depends on the integral of function hθ , defined in the previous section. Such integral can be computed easily for every multi-sigmoidal model, leading to Hθ(s,t) = Zt shθ(u)du =     −αe−Qβ(θ)(t)+αe−Qβ(θ)(s)if θ=θg, logη−e−Qβ(θ)(t)−logη−e−Qβ(θ)(s)if θ=θw. where parameter βdepends on θin the sense that β(θg) = βgand β(θw) = βw. Such results can be expressed in a more compact form as Hθ(s,t) = ψθe−Qβ(θ)(t)−ψθe−Qβ(θ)(s) Mathematics 2021,9, 2409 9 of 29 where function ψθis defined as ψθ(r) =    −αrif θ=θg, log(η−r)if θ=θw. (7) The inhomogeneous lognormal process has been the subject of many studies, theoretical as well as applied. In particular, Román and Torres [ 21 ] analyzed their versatility when modeling phenomena governed by growth curves such as those considered here (for example Richards [ 22 ] and Hubbert [ 23 ], among other curves). Gutiérrez et al. [ 24 ] carried out a detailed analysis of that process from the perspective of SDE as well as from the point of view of Kolmogorov’s partial differential equations, including the study of the distribution of the process and characteristics of interest, such as the moment and percentile functions. As regards the distribution of the process, if X0 is either degenerate or lognormal, then the finite-dimensional distributions of the process are distributed according to a lognormal law. Indeed, random vector (X(t1), . . . , X(tn))T , where t1<· · · <tn for all n> 0, has an n -dimensional lognormal distribution Λn[ε,Σ] where ε is a vector of elements εi=µ0+H˜ θ(t0 , ti) and Σ is a matrix of elements σij =σ2 0+σ2min(ti,tj)−t0 , for i , j= 1, . . . , n . Here, µ0 and σ2 0 are the parameters of the initial distribution Λ1µ0,σ2 0 . Note that, if X0> 0 is degenerate at a point x0 , i.e., X0=x0 a.s., then µ0=x0 and σ2 0= 0 in the previous expressions. The transition probability distribution is particularly useful for inferential purposes. From the two-dimensional distributions (X(s) , X(t))T , s<t , the transitions of the process can be obtained, which are also lognormal. Concretely, X(t)|X(s) = y∼Λ1hlog y+H˜ θ(s,t),σ2(t−s)i. Once the distribution of the process has been established, different characteristics associated with it can be calculated, including the mean and conditioned mean functions, whose expressions are E(X(t))=E(X0)expψθe−Qβ(θ)(t) expψθe−Qβ(θ)(t0) and E(X(t)|X(t0) = x0)=x0 expψθe−Qβ(θ)(t) expψθe−Qβ(θ)(t0). In addition, taking into account (4) and (7) it can be verified that expψθe−Qβ(θ)(t) expψθe−Qβ(θ)(t0)=fθ(t) fθ(t0), thus the two mean functions are of the type considered in the previous section. This supports the use of the processes introduced to model phenomena whose behavior is of the multi-sigmoidal type. This provides good reason to study the inference of the processes, which is the subject of the next section. 4. Inference In this section, the maximum likelihood estimation of the parameters of the two multi-sigmoidal processes is discussed, following the general methodology suggested by Román-Román et al. [25]. Mathematics 2021,9, 2409 16 of 29 5.2.3. Determination of the Best Model Once the models have been estimated from the observed data, the question arises of determining which of the two models is the most appropriate to describe the global behavior of the phenomenon under study. Figure 3displays, for each model, the sample and estimated mean functions and the 95% confidence band for the mean function together with the sample paths. 0.0 0.2 0.4 0.6 0.8 1.0 0 500 1000 1500 2000 2500 Time Sample mean function Estimated mean function 0.0 0.2 0.4 0.6 0.8 1.0 0 2000 4000 6000 Time (a) 0.0 0.2 0.4 0.6 0.8 1.0 0 500 1000 1500 2000 2500 Time Sample mean function Estimated mean function 0.0 0.2 0.4 0.6 0.8 1.0 0 2000 4000 6000 Time (b) Figure 3. Study of infected: Sample and estimated mean functions ( left ) and 95% confidence band for the mean function together with the sample paths ( right ) for ( a ) the multi-sigmoidal Gompertz model and ( b ) the multi-sigmoidal Weibull model. In view of the plots in Figure 3, it is not easy to decide on one model or another, although we must point out that, while the multi-sigmoidal Weibull model does not replicate the data trend very well at the beginning, the multi-sigmoidal Gompertz model does. However, the confidence band plots also indicate that both models have difficulties in fitting the data at the beginning. A global measure of how well the sample mean is fit by the mean of the estimated model is the absolute relative error given by Mathematics 2021,9, 2409 17 of 29 RAE =1 n n ∑ i=1 |mi−E(b X(ti))| mi . This measure presents values 0.06537265 and 0.2657263, respectively, for the multisigmoidal Gompertz and Weibull models. In this sense, the first model appears to be more suitable. Another relevant question is which of the two models provides a better estimate of the sample distribution at each instant of time. This can be done by determining the resistor-average distance [ 31 ] between the sample and estimated distributions at each time instant. The resistor-average distance is a symmetrized Kullback–Leibler distance defined as the harmonic sum (half the harmonic mean) of the component Kullback–Leibler distances, that is, DRA(fs|| fe) = DKL(fs|| fe)DKL(fe||fs) DKL(fs|| fe) + DKL(fe||fs) where DKL(fs|| fe) denotes the Kullback–Leibler distance between the sample distribution (fs) and that of the estimated model (fe). For the models under consideration, the component Kullback–Leibler distances at time instant tiare given by DKL(fs|| fe) = 1 2  logbσ2(ti−t0) b σi2+b σi2 bσ2(ti−t0)+log gi−log \ E(X0)−H˜ θ(t0,ti)2 bσ2(ti−t0)−1   and DKL(fe|| fs) = 1 2  log b σi2 bσ2(ti−t0)!+bσ2(ti−t0) b σi2+log gi−log \ E(X0)−H˜ θ(t0,ti)2 b σi2−1   where b σi2= 2 log(mi/gi) , being mi and gi , respectively, the sample mean and sample geometric mean at ti. The values of resistor-average distances allow us to appreciate the time periods in which the estimated distribution moves away or approaches the sample distribution, and how close or far it is from said distribution. Furthermore, measures such as the mean or median of the resistor-average distances values allow us to globally assess the goodness of fit and select the best model. For the estimated models, Figure 4shows the resistor-average distance between sample and estimated distributions as a function of time. An initial period of time is observed in which the Weibull model estimates the sample distributions much worse than the Gompertz model, and only at a later time does the Weibull model estimate the sample distributions somewhat better than the Gompertz model. Table 4collects some measures of interest to summarize the values of resistor-average distances. All such measures point at the multi-sigmoidal Gompertz model as the best choice. Table 4. Study of infected: Measures of interest from the values of resistor-average distances for each model. Minimum Mean Median Maximum Variance Gompertz model 0.0000031 0.1406574 0.0288676 1.1691629 0.0554912 Weibull model 0.0000914 0.4240050 0.0349878 13.7878014 3.2147742 Mathematics 2021,9, 2409 18 of 29 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.5 1.0 1.5 2.0 2.5 Time Gompertz model Weibull model Figure 4. Study of infected: Resistor-average distance between sample and estimated distributions as a function of time for the two estimated models. 5.2.4. The Study of Inflection Time Instants A matter of great interest when describing the behavior of a set of growth-related data is to establish when the growing pattern changes, which is revealed by the inflection time instants. In the specific case that we are considering, these instants of time mark the moments in which infection peaks are reached in each wave. Once we have determined and estimated an appropriate model b X(t) to explain the evolution of the COVID-19 data, inflection times can be estimated using the inflection points of the estimated mean function of the selected model, b m(t) = E(b X(t)). By setting d2 dt2b m(t) = 0, we have been able to estimate three inflection time instants. Table 5contains the estimated values of the inflections times, btI,j , together with values Sj=b m(btI,j) for j= 1,2,3. We can conclude that changes in the average growth pattern occur on 2 April, 30 May, and 6 November. Table 5. Study of infected: Estimated inflection time instants. btI,jSj 0.08893562 120.8690 0.28901782 271.8643 0.84546491 1925.691 Figure 5a depicts the second derivative of the estimated mean function. The vertical lines are located on the estimated inflection time instants. Figure 5b locates the estimated inflection time instants (vertical lines) on the graph of the estimated mean function. The horizontal lines are placed on the values of the estimated mean function at those time instants. It should be noted that the second inflection moment obtained does not seem to correspond to a peak of infection proper. Indeed, Figure 2shows how between instants 0.2 and 0.4 (corresponding to the dates between 4 May and 30 June, approximately) the evolution of the pandemic slowed down considerably, in such a way that a plateau is observed on the graph. In that period of time, and despite fitting the observed average quite well, the estimated average shows a very slight decrease that motivates the appearance of this new inflection, without it being linked to a new wave of infection. Regarding the other two dates, they can be related to actions promoted by the Spanish government as well as the governments of the different autonomous communities. Indeed, on 14 March Mathematics 2021,9, 2409 19 of 29 a state of alarm and nationwide lockdown and quarantine were imposed to control the spread of the virus, which meant that around 14 days later the peak of the first wave was reached. Similarly, around the third week of October an increase in the number of infected was observed. The reason for this must be found in the holidays that occurred in Spain on the occasion of the celebration of the National Day (12 October) and the mobility that this motivated among the population. For this reason, government actions took place, such as restricting attendance at university teaching, the closure of activities related to nightlife, and the limitation of opening hours for bars and restaurants. Again, around 14 days later, the peak of infection in this second wave was observed. Furthermore, and regarding each of the inflection points, we can consider the firstpassage-time variable, defined as the time required for data to reach the mean growth at the inflection point for the first time. By studying the distribution of this random variable we may determine, for example, the probability that the change in the growth pattern occurs in a certain period of time as well as the average or most frequent time instant in which the growth pattern changes. The first-passage-time variable associated with each inflection time instant can be approximated by the first-passage-time variable defined as the time required for the estimated model to reach its mean growth at the estimated inflection point for the first time, that is, the time variable TSj=inf t≥t0nt:b X(t)>Sjo. The probability density function of the first-passage-time variable can be obtained as the solution of a Volterra integral equation of the second kind (see Gutiérrez et al. [ 32 , 33 ]). Nevertheless, and apart from some particular processes and boundaries, closed-form solutions for the integral equation are not available, as is the one we are considering in this application. For this reason, for these cases numerical procedures are needed. The most usual methods are based on numerical quadrature procedures, as the composite trapezoid method (see [34,35]). 0.0 0.2 0.4 0.6 0.8 1.0 −0.4 −0.2 0.0 0.2 0.4 Time 0.0 0.2 0.4 0.6 0.8 1.0 0 500 1000 1500 2000 2500 Time (a) (b) Figure 5. Study of infected: Estimated inflection time instants from ( a ) the second derivative of the estimated mean function and ( b ) the estimated mean function for the multi-sigmoidal Gompertz model. The vertical lines are located on the estimated values. Considering the comment made earlier about the second inflection time obtained, we will now focus on the other two, for which we will obtain the first-passage-time variables Mathematics 2021,9, 2409 20 of 29 using the fptdApprox R-package [ 36 – 38 ]. Figure 6contains the density functions of random variables TSj , j= 1,3, (note that we have kept the same notation used in the point estimation of the inflection time points). 0.05 0.10 0.15 0.20 0 10 20 30 Time Mean Mode Median 0.4 0.6 0.8 1.0 1.2 1.4 0.0 0.5 1.0 1.5 2.0 2.5 Time Mode Median (a) (b) Figure 6. Study of infected: Probability density functions of TS1 ( a ) and TS3 ( b ) corresponding to the first-passage times of the estimated multi-sigmoidal diffusion process through the constant boundaries S1and S3shown in Table 5. The approximation procedure of the density functions provided the following information about changes in the growth pattern of the COVID-19 data: • The first change occurs, with a probability of 0.999, in [ 0.055306,0.185625 ] , that is, between 23 March and 30 April. • The second relevant change (remember the above remark) happens in time interval [ 0.251004,1 ] , that is, between 19 May and 21 December, with a probability of 0.656171. It should be noted that in this case there is a part of the range of the first-passage-time variable that exceeds the temporal limits considered in the data (see Figure 6b), which means that the complete probability mass is not confined to this interval. This is due to the fact that some regions reached the established level of contagion after 21 December. Table 6summarizes some of the main numerical characteristics of variables TSj , j= 1,3, concretely the mean, variance, and mode, as well as some of the most relevant percentiles of the distributions. Note that in the case of variable TS3 , neither the mean nor the variance have been calculated since the observation interval does not contain the complete probability mass. The percentiles falling into said interval are shown. From the values taken by these characteristics we can draw some conclusions, namely: • The first change in the growth pattern of the COVID-19 data happened, on average, at time instant 0.091806, that is, on 3 April, and more frequently at time instant 0.086358, that is, on 1 April. Of all regions, 50% reached the peak of infection before 2 April, while by 4 April they had already exceeded the peak by around 75%. • Regarding the second relevant change, it occurs more frequently at time instant 0.801248, that is, on 24 October, while 50% of regions peaked before 17 November. Mathematics 2021,9, 2409 21 of 29 Table 6. Study of infected: Numerical characteristics of the inflection time random variables for the COVID-19 data. TS1TS3 Mean 0.091806 Variance 0.000305 Modes 0.086358 0.801248 0.1% 0.065957 0.551516 2.5% 0.072643 0.645670 25% 0.082497 0.778273 Median 0.089167 0.883515 75% 0.097491 97.5% 0.122761 99.9% 0.214438 5.3. Fitting the Number of Deaths Next we show the results about the fitting of the number of deaths, for which the same methodology that has been considered with the number of infected has been followed. The study of the number of deaths has shown to be of great interest to epidemiologists. Indeed, as mentioned above, the collection of data on those infected during the first waves of the epidemic, especially during the first, has presented quite a few drawbacks meaning that the data collected does not show, most likely, the reality of the number of infected. This has given rise to an extensive literature in which procedures are shown to approximate the data of infected from that of deceased. Since the methodology and procedures used have been described in detail in the previous application, below we summarize the main results obtained. Note that in this case it has not been necessary to rescale the time space associated with the process. Regarding the degree of the polynomial, the selection method chooses degree 7 for both the Gompertz and Weibull models as can be deduced from Table 7. Table 7. Study of deceased: Posterior probabilities of the polynomial regression model of degree less than or equal to 8. Posterior Probability Degree Gompertz Model Weibull Model 0 7.389174 ×10−106 1 1.476089 ×10−92 2.685957 ×10−98 2 1.831829 ×10−87 1.682021 ×10−94 3 2.687253 ×10−59 2.830093 ×10−70 4 1.356825 ×10−56 3.805252 ×10−60 5 4.724887 ×10−16 3.222198 ×10−36 6 1.365893 ×10−10 2.136724 ×10−6 7 9.999999 ×10−18.852732 ×10−1 8 1.592107 ×10−34 1.147246 ×10−1 Once the degree of the polynomial has been selected, the estimation of the parameters of both models provide the following results: • for Gompertz model, ˆ α= 2.869936, ˆ βg 1= 6.346708 × 10 −2 , ˆ βg 2=− 1.361939 × 10 −3 , ˆ βg 3= 1.641620 × 10 −5 , ˆ βg 4=− 1.227131 × 10 −7 , ˆ βg 5= 5.733615 × 10 −10 , ˆ βg 6=− 1.527834 ×10−12,ˆ βg 7=1.774433 ×10−15 and ˆ σ2=7.484960 ×10−4, • for Weibull model, ˆ η= 1.059529, ˆ βw 1= 1.862481 × 10 −2 , ˆ βw 2=− 2.421367 × 10 −4 , ˆ βw 3 = 1.866785 × 10 −6 , ˆ βw 4=− 1.656611 × 10 −8 , ˆ βw 5= 1.368341 × 10 −10 , ˆ βw 6=− 5.895702 ×10−13,ˆ βw 7=9.569781 ×10−16 and ˆ σ2=7.48496 ×10−4, Mathematics 2021,9, 2409 22 of 29 from which the mean functions are estimated as well as the 95% confidence bands, whose graphs can be seen in Figure 7. Regarding the selection of the optimal model, the results provided by the resistoraverage distance (see Figure 8and Table 8) indicate that both models fit the variable of interest quite well, although the Gompertz multi-sigmoidal model offers a better fit in the initial phase, which makes the measurements calculated from the resistor-average distance bias the decision towards said model. 0 50 100 150 200 250 5 10 15 Time Sample mean function Estimated mean function 0 50 100 150 200 250 0 10 20 30 40 Time (a) 0 50 100 150 200 250 5 10 15 Time Sample mean function Estimated mean function 0 50 100 150 200 250 0 10 20 30 40 Time (b) Figure 7. Study of deceased: Sample and estimated mean functions ( left ) and 95% confidence band for the mean function together with the sample paths ( right ) for ( a ) the multi-sigmoidal Gompertz model and ( b ) the multi-sigmoidal Weibull model. Table 8. Study of deceased: Measures of interest from the values of resistor-average distances for each model. Minimum Mean Median Maximum Variance Gompertz model 0.000424 0.041400 0.011593 0.274669 0.004803 Weibull model 0.000121 0.060799 0.011898 1.223415 0.027666 Mathematics 2021,9, 2409 23 of 29 0 50 100 150 200 250 0.0 0.2 0.4 0.6 0.8 1.0 1.2 Time Gompertz model Weibull model Figure 8. Study of deceased: Resistor-average distance between sample and estimated distributions as a function of time for the two estimated models. Regarding the determination of the death peaks, the point estimation determines that these were reached on 31 March and 22 November, respectively. Finally, the probability density functions of the first-passage time of the process through the barriers defined by the value of the mean estimated in said time instants ( S1= 2.476951 and S2= 14.392886, respectively) have been approximated. Figure 9shows the graph of such density functions. 45678910 0.0 0.1 0.2 0.3 0.4 0.5 Time Mean Mode Median 100 200 300 400 0.000 0.002 0.004 0.006 0.008 Time Mode Median (a) (b) Figure 9. Study of deceased: Probability density functions corresponding to the first-passage times of the estimated multi-sigmoidal Gompertz diffusion process through the constant boundaries S1(a) and S2(b). Finally, by applying the proposed methodology, we can deduce the following: • The first-passage-time variable through S1 is quite symmetric. In fact, it can be seen how the mean coincides with both the mode and the median. This leads to establishing 31 March as the date on which the peak of deceased was reached with a high probability. Furthermore, the variable is quite concentrated, observing that on 1 April , 75% of the regions had already reached the peak, while 97.5% did so on 2 April. Mathematics 2021,9, 2409 24 of 29 • Regarding the second peak, which more frequent date is 20 November, while 50% of regions peaked before 27 November. Furthermore, at the end of the observed period, 64.4% of the regions have reached the peak. 6. Conclusions In real phenomena governed by growth curves there are situations in which the maximum level of growth is reached after successive stages, in each of which there is a slowdown followed by an exponential explosion. A clear example of this is provided by the evolution of pandemics, as is the case of the current one caused by the SARS-CoV-2 virus, where the appearance of successive waves of infection has been (and continues to be) observed. This motivates the use of sigmoidal curves with more than one inflection point. In this work, two stochastic diffusion processes are presented, their main characteristic being that their means are multi-sigmoidal growth curves derived from classical curves such as the Gompertz and the Weibull. In both cases, these curves have been generated by introducing polynomial functions in their classic expressions. Starting from a global formulation for both processes, this paper studied the problem of estimation using the method of maximum likelihood. Parameter estimates have been obtained by solving the system of likelihood equations as well as by direct maximization of the likelihood function. This entails analyzing how to obtain initial solutions in the first case and the delimitation of the parametric space in the second. Determining the degree of the polynomial before approaching the estimation of the parameters is a fundamental question in real-world applications. To do this, a Bayesian approach to the model selection problem has been considered based on the methodology derived from intrinsic prior distributions. The stochastic models introduced here have been applied to data concerning the evolution of the COVID-19 epidemic in Spain during the first two officially recognized waves. For this, sample trajectories have been considered corresponding to the data of infected and deceased individuals reported by 15 Spanish regions between 8 March and 21 December 2020 . The method of selecting the degree of the polynomial leads to the choice of degree 5 as optimal in the case of the number of infected, while for that of the deceased the selected degree is 7. After estimating the models, we proceeded to select the optimal one for the description of the evolution of the pandemic. Although the two diffusion processes considered are good models to describe the phenomenon under study, one of them was selected as the best choice. For this, two criteria were used: the absolute relative error between the observed and the estimated mean, and the average resistor distance, which measures the discrepancy between the sample and the estimated distributions. Both criteria favor the choice of the model based on the multi-sigmoidal Gompertz curve for both the number of infected and the number of deaths. The study of the inflection times of the estimated mean function provides an estimate of the moments when the peak of the epidemic was reached. Our conclusions were drawn considering the total number of infected and death at the national level. By including in our analysis data from several regions we can account for the variability derived from their specific characteristics. Regarding the point estimation of the inflection instants, the results indicate that, for the number of infected, the peak of the first wave was reached around 2 April , while the second peak occurred around 6 November. In the case of the number of deaths, such values are around 31 March and 22 November, respectively Making a comparison with the information provided by other studies, we can see how the already refined statistics from the National Epidemiology Center (CNE) of Spain indicate that the nation-wide first-wave infection peak occurred on 20 March, 6 days after the national lockdown was implemented, and the cases of COVID-19 steadily decreased after then (see [ 39 ] for details). Other studies place the peak on 26 March (Guirao, [ 40 ]), while in the work of Mora et al. [ 41 ] an interval is established that goes from 29 March to 3 April. Since the first week of July, Spain experienced an increasing trend in the cumulative incidence. The data provided by the CNE place the peak of the second wave around 27 October , two weeks after the National Day holidays (21 October), which led to a large Mathematics 2021,9, 2409 25 of 29 increase in the mobility of the population. Regarding the number of deaths, the peak of the first wave is placed on 30 March, whereas the corresponding to the second wave is placed on 17 November. Another perspective for the analysis of the tipping peaks is provided by studying the time required for data to reach, for the first time, the mean growth values at an inflection point. Our results indicate that 50% of regions reached the first peak of infection before 2 April , while by 4 April they had already exceeded the peak by around 75%. Regarding the second peak it occurred more frequently on 24 October, with 50% of regions reaching peak values before 17 November. In the case of the number of deaths, 50% of the regions reached the first peak before 31 March, while on 2 April it was 97.5% the regions that had reached it. On the other hand, 20 November is the most frequent date in which the regions reached the second peak, with 26 November being the date on which 50% of the regions had already reached it. With the present work as a starting point, several lines of research can be suggested. Among them, the models may be modified by introducing exogenous variables that represent the therapeutic and non-therapeutic actions promoted by the authorities, and thereby explore their impact on the evolution of the pandemic. Other studies may look into how the number of death and/or hospitalized can be introduced as exogenous variables with the aim of improving the estimates of the real number of infected. Such research initiatives may be undertaken by introducing temporal variables in the infinitesimal moments of the diffusion processes being considered. Other research lines can be derived from the incorporation of this type of multisigmoidal curves to SIR-type models as well as considering diffusion processes with delays. Finally, it is important to highlight the fact that the models presented in this work have allowed a good adjustment of both the number of infected and the number of deaths. This is of special interest given the vast literature that has been generated around the estimation of the number of infected from the number of deaths given the low quality of the data on infected during, especially, the first wave. Author Contributions: Conceptualization, A.B., P.R.-R., J.J.S.-P. and F.T.-R.; methodology, A.B., P.R.-R. , J.J.S.-P. and F.T.-R.; software, J.J.S.-P.; validation, A.B., P.R.-R., J.J.S.-P. and F.T.-R.; formal analysis, A.B., P.R.-R., J.J.S.-P. and F.T.-R.; investigation, A.B., P.R.-R., J.J.S.-P. and F.T.-R.; writing—original draft preparation, A.B., J.J.S.-P. and F.T.-R.; writing—review and editing, A.B., J.J.S.-P. and F.T.-R.; supervision, P.R.-R.; funding acquisition, F.T.-R. All authors have read and agreed to the published version of the manuscript. Funding: This work was supported in part by the Ministerio de Economía, Industria y Competitividad, Spain, under Grant MTM2017-85568-P and by the FEDER, Consejería de Economía y Conocimiento de la Junta de Andalucía, Spain under Grant A-FQM-456-UGR18. Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable. Data Availability Statement: Publicly available datasets were analyzed in this study. This data can be found here: https://cnecovid.isciii.es/covid19/#documentacion-y-datos (last accessed on 20 September 2021). Conflicts of Interest: The authors declare no conflict of interest. Appendix A. Standardization of [t0,T] For a fixed u∈(0, T−t0) , let us consider the diffusion process nY(t0);t0∈h0, T−t0 uio , such that Y(t0) = X(t) a.s., where t0∈h0, T−t0 ui and X(t) is the multi-sigmoidal diffusion process defined with t∈[t0,T]. Note that t0=t−t0 uand then, t=t0u+t0.