The coronavirus 2019 (COVID- 19) disease was reported to appear for the first time in Wuhan, China, and later it spread to Europe, which is the subject of the presented case studies, and eventually worldwide. While there are individual clinical reports for COVID-19 re-infections, the present stage of the pandemic still allows for the application of a relatively simple epidemic model, which is the subject of the present report. The motivation behind the presented research was the intention to accurately model the short-term dynamics of the outbreaks of COVID-19 pandemics, which by the time of writing, has infected more than 27 million individuals worldwide. The efforts to contain the spread of the pandemic induce sustained social and economic damage. Therefore, the ability to accurately forecast short to medium-term epidemic outbreak's dynamics is of substantial public interest.
The present manuscript gives a comprehensive analytical and numerical treatment of the SIR (Susceptible-Infected-Removed) epidemiological model. The SIR model was introduced in 1927 by Kermack and McKendrick in 1927 to study the plague and cholera epidemics in London and Bombay [9] . To date the SIR model remains as a cornerstone of mathematical epidemiology. It is a deterministic model formulated in terms of ordinary differential equations (ODEs). The model has been extensively used to study the spread of various infectious diseases (see the monograph of Martcheva [10] ).
The objective of the present paper is to demonstrate numerical routines for curvefitting allowing for estimation of the parameters of the SIR model from empirical data. To this end, the paper exhibits an algorithm, which can be used to compute the population variables as functions of time. In contrast to previous approaches, I do not consider the SIR model as an initial value problem but as a problem in the theory of special functions. This change of perspective allows for handling noisy data, e.g. time series having fluctuations caused by delays and accumulation of case reporting. The numerical approach is applied to the COVID-19 incidence and case fatality data in different European countries, having different population densities and dynamics of the epidemic outbreaks.
The SIR model is formulated in terms of 3 populations of individuals. The S population consists of all individuals susceptible to the infection of concern. The I population comprises the infected individuals. These persons have the disease and can transmit it to the susceptible individuals. The R poulation cannot become infected and the individuals cannot transmit the disease to others. The model comprises a set of three ODEs:
The model assumes a constant overall population N = S + I + R. An disease carrier infects on average β individuals per day, for an average time of 1/γ days. The β parameter is called disease transmission rate, while γ -recovery rate. The average number of infections arising from an infected individual is then modelled by the number R 0 = β γ , the basic reproduction number. Typical initial conditions are S(0) = S 0 , I(0) = I 0 , R(0) = 0 [9] .
The model can be re-parametrized using normalized variables aṡ
subject to normalization s + i + r = 1 and time rescaling τ = βt. Therefore, since i(τ ) is integrable on [0, ∞) then i(∞) = 0.
The analytical solution will be formulated first in an implicit form. Since there is a first integral by construction the system can be reduced to two equations:
must hold for the infection to propagate. R e is called the effective reproductive number, while the basic reproduction number is R 0 = R e N [19] .
In order to solve the model we will consider the two equations separately. Direct integration of the equation 7 gives
where the constant c can be determined from the initial conditions. In the present treatment, the constant c will be left indeterminate to be assigned by the different re-parametrization procedures. The s variable can be expressed explicitly in terms of the Lambert W function [4] :
where the signs denote the two different real-valued branches of the function. Note, that both branches are of interest since the argument of the Lambert W function is negative. Therefore, the ODE 5 can be reduced to the first-order autonomous systemi
valid for two disjoined domains on the real line. The ODEs can be solved for the time τ as
Remark 2. There is another equivalent form of the system using the Wright Ω function [5] since
The s variable can be determined by substitution in equation 4, resulting in the autonomous systemṡ = −s (−s + g log s + c)
which can be solved implicitly as ds
Finally, the r variable can also be conveniently expressed in terms of i. For this purpose we solve the differential equation 
For the purposes of curve fitting we assume that i(−∞) = r(−∞) = 0. Therefore,
1. Peak value parametrization. The upper terminal of integration can be determined by the requirement for the real-valuedness of i. This value of i is denoted as i m ; that is
The peak-value parametrization is supported by the following result.
Proof. We use a parametrization for which i(0) = i m . Theṅ
It follows thati (0) = 0, i(0) = i m so i m is an extremum. In the most elementary way since W(z) should be real-valued then −e i−im g
If we consider formally the phase space z × y = −gz W ± −e z−im g −1 + 1 the following argument allows for the correct branch identification.
Therefore, if we move the origin as t(0) = i m then conveniently
Furthermore, the recovered population under this parametrization is
under the same choice of origin.
3.2. Initial value parametrization. As customarily accepted, the SIR model can be recast as an initial value problem. The indeterminate constant c can be eliminated using the initial condition
For this case, the following autonomous differential equation can be formulated:
This can be solved implicitly by separation of variables as
It is noteworthy that the time to the peak of infections t m can be calculated as
The result follows by considering the autonomous system 7 and fixing the upper terminal of integration s = g. However, by Prop. 3 this definite integral can be evaluated only numerically.
The incidence i -function of the SIR model appears to be an interesting object of study on its won. One may pose the question about the representation of this function by other, possibly, elementary functions. The answer to this question is in the negative as will be demonstrated below. In precise terms, this function is non-Liouvillian. However, this does not mean that the function can not be well approximated. Fortunately, this is the case as the i -function can be approximated for a sufficiently wide domain of parameter values by Newtonian iteration. Allowing for the underlying field to be complex numbers -C, trigonometric functions become elementary as well.
We say that f (x) is a Liouvillian function if it lies in some Liouvillian extension of (C(x), ) for some constant field C.
As a first point we establish the non-elementary character of the integral in eq. 11. The necessary introduction to the theory of differential fields is given in the Appendix B. From the work of Liouville it is known that if a function F (x) = f (x)e q(x) , where f , q are elementary functions, has an elementary antiderivative of the form [18] F (x)dx = f e q dx = he q for some elementary function h(x) [2] . Therefore, differentiating we obtain f e q = h e q + hq e q so that if e q = 0
h + hq = f holds. The claim can be strengthened to demand that h be algebraic for algebraic f and q.
are not Liouvillian.
Proof. We use i m parametrization. Let c = i m + g − g log g. The proof proceeds by change of variables -first ξ = g log y − yg + g + i m ; followed by z = log ((g log y + i m + g)/g).
The last integral has the form Ae z e e z − Ae z dz which allows for the application of the Liouville theorem in the form of Corr. 1.
We can identify
for some unknown algebraic h(z). Since the left-hand side of the equation is transcendental in z so is the right-hand side. Therefore, the integrand has no elementary antiderivative.
The proof establishes also the validity of two additional propositions:
The incidence function i(t), defined by the differential eq. 10, is not Liouvillian.
Proof. For the present case, let us assume that i(0) = i m so that i attains the maximum by Prop 1. Therefore,
Without loss of generality let g = 1, which amounts to scaling of the solution by the factor of 1/g. Suppose further that i − i m − 1 = log u − u for some algebraic function u (log-extension case). Then
On the other hand,
However, if u is algebraic so is u by Th. 3. Therefore, we have a contradiction, since the left-hand-side is transcendental. Hence, i is not part of a logarithmic elementary extension. Suppose that u is exponential, i. e. u = e f for some algebraic function f . In this case,
However,
Therefore, the right-hand-side is exponential and can not be algebraic as it is demanded by Corr 1. This is a contradiction, hence f can not be algebraic, hence u is not part of an exponential elementary extension. Finally, suppose that i(t) is algebraic. Since the Wright function Ω(z) is transcendental [5] it follows that W −e i−im−1 = Ω (i − i m − 1 + iπ) can not be algebraic in i. Therefore, i /i and hence i must be transcendental. Hence, the case of an algebraic i(t) can not hold either.
In summary all three cases are rejected, therefore, i is not Liouvillian. [15] prove in Corollary 3 that if the autonomous system y = f (y) has an elementary first integral then
is also elementary. This presents a direct way of proving that the i-function is non elementary by virtue of Th. 1 but leaves open the question about the non-Liouvilian character of the i-function.
We will give two series for the i -function in view of the different re-parametrizations of the SIR model.
Series for thr i m parametrization. The natural parametrization is fixing the peak at the origin. The Taylor development can be computed as follows:
and for the logarithm
5.2. Series for the i 0 -parametrization. The Taylor series starting from an initial value i 0 is
The Taylor series for the logarithm starting from an initial value i 0 is
The series follow directly from successive differentiation of the differential equation 19.
The i-function can be efficiently approximated by the Newton's method. The Newton iteration scheme is given as follows for the c-parametrization:
This is a conceptually simple representation. However, it has the disadvantage of using the Lambert function for the quadrature routine. Another equivalent representation is 6.1. Plots. Plots of the branches of the integral I(x) (Fig. 1) were obtained by direct numerical integration using the QUADPACK [13] routines in the Computer Algebra System Maxima. Plots of the SIR model (Fig. 2) were obtained using a Java routine [16] implementing the double exponential integration method [11, 12] . Both methods turn out to be suitable for the numerical integration problem. 
The COVID datasets were downloaded from the European Centre for Disease Prevention and Control (ECDC) website: https://opendata.ecdc.europa.eu/ covid19/casedistribution/csv. The downloadable data file is updated daily and contains the latest available public data on COVID-19. Each row/entry contains the number of new cases reported per day and per country. The data collection policy is available from https://www.ecdc.europa.eu/en/covid-19/data-collection.
8.1. Processing. The data were imported in the SQLite https://www.sqlite. org database and further filtered by country transferred to MATLAB for parametric fitting using native routines. Fitted parameters were stored in the same database.
8.2. Parametric fitting. The parametric fitting was conducted using the fminsearchbnd routine, which allows for constrained optimization. To reduce the impact of the fluctuation in the weekly reporting of data the parametric fitting procedure was applied first to 7 day moving average of the time series. The fitting algorithm is exemplified with datasets from Belgium, the Netwherlands, Italy, Germany and Bulgaria for the period Jan 2020 -Jun 2020. The fitting equation is given by
where I t is the observed incidence or mortality, respectively, while N, T, g and i m are estimated from the data. For numerical stability reasons the time during the fitting procedure is rescaled by a factor of 10.
The observed case fatality represented a parameter, which could be established with more confidence in the beginning of the pandemic due to the lack of testing and the non-specificity of the clinical signs of COVID-19. Hence, it was the primary target of the parametric fitting. 9.1. Analysis of case fatality data. The data fitting procedure is illustrated with the case fatality data of Belgium and are presented in Fig. 3 . The T , N and i m are estimated from the observed data. For the g parameter an initial estimate of 0.75 is used (i.e. R 0 = 1.33). The intermediate parameters are initially estimated on the 3-day moving average data. The final fit was performed on the raw data, using the intermediate parameters as initial values. The cumulative mortality data were estimated from eq. 17. As can be appreciated from Fig. 3 fluctuations in reporting did not have a detrimental effect on the estimation procedure. The results for Germany, Italy, Belgium and the Netherlands are presented in Table 1 T is given in weeks and refers to the time passed since 1 st Jan 2020. 9.2. Analysis of incidence data. The raw data demonstrate weekly fluctuations most probably caused by the reporting irregularity due to holidays and fluctuations in the testing demand. It is especially pronounced for the morbidity data of Germany for the presented period. The incidence data were analysed in the same way using the fitted parameters for the mortality as initial values. The fitting results demonstrate different lags of the peaks of incidence vs case fatality in the studied Table 2 . Incidence parameters T is given in weeks and refers to the time passed since 1 st Jan 2020; R 0 = 1/g; i m corresponds to the peak of the case fatality.
9.3. Tracking of multiple outbreaks. Changes of containment policies are meant to result in changes in the epidemic outbreak dynamics. This can be followed by the SIR model as demonstrated in the Bulgarian incidence dataset, where resuming of public sports events in the end of June correlates with the 3 rd and ongoing increase of incidence (Fig. 5) . The process is difficult to automate because of the fluctuations in the data. Nevertheless, it was possible to accurately track the past outbreaks.
The SIR model was formulated to model epidemic outbreaks [9] .The model has only two independent variables and two parameters, which allow for their estimation from data. There is a renewed interest in this model in view of the coronavirus disease 2019 (COVID-19) pandemics [6, 14, 3, 17] . For decades the model evaded the efforts of the community to derive explicit solution. A formal analytical solution of the SIR model has been found only recently and formulated in the traditional setting of an initial value problem [8] . Yet, another perspective can be also of meritthe model can be treated as a manifold problem, which can be parametrized by any March 2020 when the first COVID19 case was reported.
efforts are necessary in establishing a robust asymptotic of the incidence i -function. This is a clear direction for future research. On the second place, the analytical formula involving first exponentiation and then computation of the Lambert W function has disadvantages for large arguments due to float under or overflows [5] . Therefore, another special function can be used in principle, notably the Wright Ω function. On the other hand, optimized routines for its calculation are not readily available in MATLAB. 10.3 . Epidemiological implications of the results. Recorded data necessarily suffer from diverse biases. For example, the marked difference in the availability of tests in the early stages of the pandemics in different countries. Another one is the unsteady reporting resulting in fluctuations of the numbers. This severely limits the usefulness of the model formulation as an initial value problem, which is the standard mathematical assumption. This can result is drastic overestimation of the infection peak (see for example the predictions for UK in [7] ).
Presented results indicate that there is a universality in the time evolution of COVID-19 and the same epidemic model, notably SIR, can be applied to countries having large differences in populations sizes and densities. More interestingly, the model seems to fit well also the mortality data, which can be interpreted in the sense that the vulnerable population forms a distinct subpopulation from all susceptible individuals (e.g. elderly people). Presented data lend support to a simple modification of the SIR model: notably -the SIRD model with an independent population of dead (D) persons. This corresponds to the recent findings of other authors [6, 3] .
A key finding of the present report is that simple models can be very useful in studying the epidemic outbreaks. This can be eventually extended to predicting the effects of different containment measures or the lack thereof [17] .
Appendix A. Special functions A.1. The Lambert W function. The Lambert W function can be defined implicitly by the equation
We observe that by Lemma 1 W (z) is transcendental. Furthermore, the Lambert function obeys the differential equation for x = −1
W is a multivalued function. It has many applications in pure and applied mathematics. Properties of the W function are given in [4] . Useful identities
The W function is non-elementary and in particular it is non-Liouvillian [1] . Its indefinite integral is: Proof. We use the change of variables ξ − c = g log y − y and then simplification by the defining identity of the Lambert W function. A.2. The Wright Ω function. The Wright Ω function is related to the Lambert W function [4] Ω(z) = W K(z) (e z ) , z ∈ C where K(z) = (Im(z) − π) /2π is the unwinding number of z. Moreover,
for the principal branch of the logarithm. It is a transcendental function. It obeys the differential equation
The Ω function is non-Liovillian [1] . Its indefinite integral is: is algebraic since it is computed by a finite sequence of algebraic operations. Suppose that t = exp(x). Then exp(a) is not algebraic, hence it is transcendental.
P (x, e x ) = e xm + a m−1 e xm−x + . . . + a 0 is exponential. Suppose that t = log(x). Then log(a) is not algebraic, hence it is transcendental.
P (x, log(x)) = log m x + a m−1 log m−1 x + . . . + a 0 is not algebraic, hence it is transcendental.
In what follows is assumed that the differential field is of characteristic zero and has an algebraically closed field of constants. An element y of a differential field is said to be an exponential of an element A if y = Ay, an exponential of an integral of an element A if y = Ay; logarithm of an element A if y = A /A, and an integral of an element A if y = A.
The next definition is due to [1] .
Definition 5. Let (k, ≡ d/dx) be a differential field of characteristic 0. A differential extension (K, ≡ d/dx) of k is called Liouvillian over k if there are θ 1 , . . . , θ n ∈ K, such that K = C(x, θ 1 , . . . , θ n ) and for all i, at least one of the following (1) θ i is algebraic over k(θ 1 , . . . , θ n−1 ) (2) θ i ∈ k(θ 1 , . . . , θ n−1 ) (3) θ i /θ i ∈ k(θ 1 , . . . , θ n−1 ) holds. The constant subfield C(K) of K is defined to be the set of c in K, such that c = 0.
The next theorem is due to [2] . Theorem 3. If K is an elementary field, then it is closed under differentiation.
An elementary integrability theorem due to Conrad [2] .
Theorem 4 (Rational Liouville criterion). For f, g ∈ C (x) with f and g nonconstant the function f (x)e g (x) can be integrated in elementary terms if and only if there exists a rational function h ∈ C (x) such that h + g h = f .
The last result can be extended to algebraic functions as follows. Therefore, (f (x) + F (x)g (x)) e g(x) dx = F (x)e g(x)
We observe that g (x) is elementary by Th. 3. The L.H.S has the form f e g and since f (x) + F (x)g (x) is elementary we can identify h ≡ F, f 1 ≡ f + F g = h + hg so that (h + hg ) e g = (he g ) and the claim follows.