{'fraction_non_alphanumeric': 0.031210544921973636, 'fraction_numerical': 0.012474117468814706, 'mean_word_length': 4.623970462936666, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 0, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
SIR Model Parameters Estimation with COVID-19 Data

Based on the SIR model that divides the population into susceptible, infected and removed individuals, data about the evolution of the pandemic compiled by the Johns Hopkins University Center for Systems Science and Engineering (JHUCSSE) are integrated into the numerical system solution. The system parameters Rate of Contact β, Basic Reproduction Number R0 and Removal *Corresponding author: E-mail: nilson@con.ufrj.br; Roberty and Araujo; JAMCS, 36(3): 97-117, 2021; Article no.JAMCS.67121 Rate γ, also named Rate of Decay, are determined according to a ridge regression approach and a mobile statistical scheme with different averages. Data is automatically downloaded from https://raw.githubusercontent.com/CSSEGISandData/COVID-19. The main Python libraries used are Numpy, Pandas, Skit-Learn, Requests and Urllib.


Introduction
The simplest model capable of describing the three main states of the phenomenology associated with 'COVID-19 infection' is the SIR model ( [1], [2]). These three letters designate the three compartments grouping the population affected by the disease. The susceptible group (S) correspond to all people that can be in contact with the virus and contract the disease. By contracting the disease, susceptible people will become part of the temporary group of infected people (I). After the characteristic time of the evolution of the disease, those infected individuals migrate to the removed group (R) that counts both the people who get recovered and those who died due to the severity of clinical conditions. This model is based on two parameters traditionally denoted as β and γ, which contemplate two basic types of fundamental mechanisms found in the phenomena of reaction and decay ( [3]).
The emergence of corona virus epidemic at the end of 2019 has led the world to an unprecedented crisis. The last infectious disease of this size had occurred a century ago, exponentially increasing the social consequences that followed the first world war. At this time, the importance of scientific treatment for pests and epidemics emerges in the wake of these consequences and the SIR model appears as a simple and adequate tool for the quantification of this type of problem.Important books on mathematical modeling of populations in biology and epidemiology have been published, we quote ( [4]). As a nonlinear system of ordinary differential equations, the SIR model has an important position as a pure and applied mathematics subject. Since in the modelling of real infections the two main parameters depends on social contact and therapeutics procedures, and consequently are strongly determined by public politics, they will change with time and the SIR model will behave as a non autonomous dynamical systems ( [5]). Also, very disputed political decisions based on different interests and beliefs of the authorities increase their stochastic nature. Interesting works has been done before the present outbreak, we cite only some( [6], [7]). More recently( [8]) investigate analytical features of the SIR model and their applications to COVID-19, and ( [9]) comments those results. In a more recent work ( [10]) he presents an analytical parameter estimation of COVID-19 data with a different methodology from the one used in this work. Other interesting recent paper treat the COVID-19 data forecasting problem ( [11]). We will not treat this forecasting problem in this first work.
In section (2) we describe the SIR model and we give a brief description of the parameters. In subsection (2.1) we define the Basic Reproduction Number. In subsection (2.2) we inform more about the data spreadsheets which were used. In Section (3) we derive a fix point equation and define the concept of Local Pandemic Cycle. Section (4) describes how Python3.7 is used to extract the data from JHUCSSE website and produce our results. Section (5) describes the numerical implementation of the Tychonoff regularization for parameters reconstruction. The results are presented in section (6). Some concluding remarks are presented in section (7).

The SIR Model
The equations of the SIR model with time-dependent β(t) and γ(t) are: with the initial condition (S(t0), I(t0), R(t0)) = (S0, I0, R0). The functions S(t), I(t), R(t) respectively represent the susceptible, infected and removed (recovered plus death) number of people at any given time. The shape of these equations allows us to make a parallel with the kinetic nuclear reaction equations which involves reactions and radioactive decay ( [3]).
The parameter N can be interpreted as the total number of people involved in the epidemic outbreak. The sum of the three equations (2.1) establishes N as a time invariant The first parameter is the Contact Rate, β. It establishes the rate of contact per person in a population with N individuals. Since the susceptible fraction, S N , represents the probability of finding a susceptible individual in the population, an infected person have in average β S N contacts with susceptible people.
The second parameter is the removal rate, γ, which controls the decay rate from the infected state to the removed state. These type of parameters are also found in nuclear reaction phenomenology. The probability of an individual leave the infected condition in an infinitesimal increment of time δτ is γδτ . Therefore, the probability of remaining in the infected condition is 1 − γδτ . Thus, in the classical limit, we have the quantification of the probability that in a total time τ an individual remains in the condition of infected This behavior is typical in the nuclear radioactive decay phenomena. Meanwhile in the context of the epidemic outbreak it is observed that individuals are more likely to recover or die in a few days after contracting the infection, this simplification is systematically adopted and useful.
The population number N is normally very large when compared with the confirmed number of cases directly involved in the epidemic, at least in its beginning. Thus, the hypothesis S N ≃ 1 makes the model linear. It is appropriate to define the Effective Value of the Rate of Contact β ef .
The average number of contacts of an infected individual in an infinitesimal time δτ is β ef δτ . Thus 1 − β ef δτ represents the probability that the infection will not be transmitted in the time interval δτ . Since this interval has τ δτ sub-intervals, an infected individual remains unlikely to infect others with probability: lim δτ →0 Consequently the probability of the transmission is 1 − e −β ef τ ([1]).

The basic reproduction number R 0
An individual who remains infected for a time τ will have in average βτ contacts and will infect susceptible individuals who have had contact with him ( [1]). The probability that this individual remain infected in this interval of time is given by the equation (2.3), and the probability of finishing the period of infection at the moment τ will be γe −γτ for all time τ . In this circumstance, the average Basic Reproduction Number of the infection will be: The Basic Reproduction Number R0 := β γ has a direct influence on local evolution of the pandemic. As it will be seen in the next sections, it controls the evolution of the epidemic cycle, as shown in the figures 1 and 2. The control of the Contact Rate between individuals can reduce the basic reproduction number to levels low enough to prevent an epidemic outbreak of great proportions. All this depends of the society's ability to reduce its values to below 1. Different countries are at different stages in the development of the pandemic.
Effective health authorities efforts to contain the outbreak will introduce a trend towards a reduction in the basic number of reproduction by decreasing the Contact Rate β. Further study can be conducted also with network science ([1]).

The COVID-19 data
On the website https://data.humdata.org/dataset/novel-coronavirus-2019-ncov-cases, ( [12]), it is available 3 time series with information used for analysis on the cumulative number of cases of Covid19 registered as confirmed, recovered and deaths for several countries. For the automatic download there is an alternative GitHub link in the website https://raw.githubusercontent.com which is synchronized with the JHUCSSE data. For some countries, there is discrimination against provinces and regions. The combination of the numerical solution of the dynamic SIR equations solved as a deterministic system of ordinary differential equations with parameters β , γ and N allows a temporal characterization of the system states.
Those results can be compared with the observational data in the JHUCSSE worksheets: {conf irmed.csv, recovered.csv, death.csv} . (2.6) In this way, we establish an Observational-Evolution model that can be seen both as a Statistical filtering problem for discrete times and also as a problem of deterministic extrapolation with constant parameters in a long-range time. In this first work we will not explore the extrapolation ( [13]),( [14]).

The Existence of the Outbreak in the SIR Model
The first system equation (2.1) with time constant parameters β and γ can be solve explicitly giving . The combination of these equations gives The replacement of (3.1) in the equation (2.2) provides the following equation with normalized variables This equation (

Fig. 2. Local pandemic cycle in New Zealand. The Local Pandemic Cycle is defined between March and June 2020 by the area delimited by the curves confirmed and removed, respectively
We can see that the rates dr dt and di dt are both null at the beginning and at the end of the outbreak. The evolution of the curves that represents the number of confirmed cases c(t) = r(t) + i(t) and that represents the number of removed cases r(t) delimits a cycle of the state evolution process. The area between the curves can be seen as a measure of the size of the outbreak. This region of the process will be called as Local Pandemic Cycle. And, of course, after a complete cycle, nothing prevents a new outbreak from starting after the final state of the first outbreak, starting a new local pandemic cycle. In the Fig. 2 we can see the formation of a complete first cycle and the adequate control of the disease. The rates dr dt and dc dt are both null at the beginning and at the end of the outbreak between March and June 2020. At this period of time, only the residual number of infected people is observed.
So, the Fig. 2 shows the first New Zealand epidemic cycle in which the result of controlling the R0 parameter to values under 1 led to a low value of rϵ ≃ 310 4886000 ≃ 6.3410 −5 which measures the infected fraction of the population.
Since at the extremes of a cycle the derivatives are zero, we get the following fixed point equation, which is also known as giant component size equation, The numerical solution of this fix point equation is done with the Newton method.
When the influence of the initial disturbance ϵ = I 0 N ≃ 0 is neglected, this equation will always have a zero solution, r(t) = 0, and can, depending of the value R0 = β γ have another non-null solution( [1]). In the case of R0 = 2, the non-null solution is r ≃ 0.7968121301668857, showing that almost 80% of the initially susceptible population will be infected during the cycle formation. This is the size of this outbreak for this R0 parameter. In network science theory, this number quantifies the so-called "giant component" that indicates a phase change in the system.  If the infected population is very small at beginning and quantitatively negligible when compared to the total of susceptible individuals, it is then important the non-null ϵ in the fix point equation, since it gives a quantification of the total fraction of recovered or deaths individuals even when R0 < 1. This is the case of the absence of an outbreak of higher proportions.
Calculations for formation of the "small giant component" are presented in Fig. 2. The log-log graphicshows the final fraction of infected people rϵ for an initial fraction ϵ of infected individuals during a controlled epidemic cycle.

Python 3.7 Implementation of COVID-19 Data Processing
In order to automate the extraction of information, a library was developed to be capable of extracting and processing the time series data (2.6), as well as combining these series with deterministic solutions of the SIR equations. The result is being shown in the graphical that makes up the selection shown in this work. It is focus on the graphs presented mainly in the data referring to Brazil. The system, however, works for any country in that database and can be easily adapted to other databases. The data made available by JHUCSSE were processed in the Python 3.7 language. A reference on Python we quote ( [15]). The Python libraries such as Pandas for extracting information and Skit-Learning ( [16]) for parameters prevision are used. In addition, other libraries such as SciPy, Math and Matplotlib were extensively used.

Estimates for the Contact Rate Parameter β and the Removal Rate Parameter γ
The main statistical tool used for estimating the parameters β and γ was the ridge regression, which implements the Tychonoff regularization for the linear system formed with the regression of the time series data.
The SIR equations (2.1) can be rewritten in terms of the number of confirmed cases up to a time t, C(t) := I(t) + R(t). If we notice that The second equation of the SIR model can be rewritten as: while the equation for the removed people rate remains unchanged. Thus, by integrating these equations between [t − τ, t], we obtain and Defining the β τ and γ τ means as: we have the average values for τ days with respect the total number of infected cases in these days The expression for β τ can be written in terms of a linear factor and a non-linear correction factor: The linear factor can be identified as β ef given by equation (5.6) and the non-linear factor: Therefore we have: (5.7) Note that in the limit τ → 0 we have: This is the inverse of the term that contributes for the system non-linearity. Therefore, the nonlinear correction factor will only be significant for a very high percentage of confirmed cases, what is not observed in the time series data. In this way, for these first pandemic months, the contribution of the non-linear factor is negligible and β ≃ β ef .
The main statistical tool used for estimating the parameters β and γ was the ridge regression, which implements the Tychonoff regularization for the linear system formed with the regression of the time series data. When the regularization considers daily updating, the equations (5.6) and (5.5) become: By the n-days average method we mean the calculation of γ and β with equations (5.5) and (5.6) with τ = n.

Prediction of β and γ mean values using Tychonoff regularization.
The representation for the estimated values β(t) and γ(t) using multi-linear regression is: where J and K are the orders of the two filters and aj , j = 1, ..., J and bj , j = 1, ..., K are the coefficients of the time series values that participate in the regression.
The coefficients are calculated minimizing the functional of Tychonoff where α1 and α2 are regularization parameters.
The implementation of this optimization problem is already done in the Skit-Learn library ( [16], [17]).

Results
The main result of this work is the interpretation of the temporal data evolution in the current COVID-19 pandemic with data based graphs in terms of the SIR model with time dependent parameters.
A second important result is the investigation about the Local Pandemic Cycle concept, with the basic observation that there is a formation of a giant component even when the basic reproduction number is less than one, R0 < 1.
Another important result is the derivation of the giant component size fix point equation (3.3) which allow us to calculate the fraction of number of removed people at the end of an epidemic cycle for a negligible initial disturbance. It is shown by this equation, how the parameter R0 can control the dynamics of the epidemic cycle.
Lastly, it is shown in the work that S(t) N is a good simplification to the model which enable us to compute the systems parameters by ridge regression or n-days average. It is show that these parameters can be used to reconstruct the systems variables and arrive in values with controlled relative error as seen in Fig. 4. A brief summary of the graphics. Fig. 1 shows the temporal evolution of the incomplete local pandemic cycle in Brazil. Those data compare values from JHUCSSE data with numerical values solution of the SIR differential equation system done with parameters estimated from ridge regression of the same data. Fig. 2 shows the formation of a Local Pandemic Cycle in New Zealand between march and July 2020. Since the Basic Reproduction Number has been controlled to be less than one, R0 < 1, the initial infinitesimal fraction of infect people start locally the pandemic but the pandemic die out locally. This shown one strict correlation between the control measures adopted by local authorities and the local control of the pandemic. Fig. 3 shows the fact that every epidemic outbreak has the form of a giant component, even if that component is infinitesimal when compared to the quantities of nations populations. This type of structure appears when actions are made to reduce the Contact Rate reducing the Basic Reproduction Number to values R0 < 1 at the beginning of the epidemic outbreak. An example of this is shown in Fig. 2 and in Fig. 10. Fig. 4 shows typical relative errors occurring when the dynamical systems SIR is solved with the reconstructed parameters. We observe a good agreement between the compiled observational data evolution and our numerical solution of the SIR model with the reconstructed parameters.
Figs. 5 and 6 present estimations for β and γ, respectively, using 14 days average and the ridge regression method and compare it with the 1 day average estimation. The ridge regression preserves oscillations from the data with some smoothing and this permits a more realist adequacy of the SIR model as observed in Fig. 1.   Fig. 7 shows the estimated average Contact Rate β for 14 and 28 days, respectively, and compare it with the reconstruction by ridge regression. We see that the ridge regression preserves the oscillations in the observational data. An excessive smoothing is observed in these 14 and 28 averages.

Conclusions
The results found are conveniently presented in a graphic form to facilitate understanding and use it in decision making, as well as to warn about the seriousness of the consequences of the permissiveness in acceptance of inadequate parameters values, which here means a high level of Contact Rates.
It can be concluded that the ridge regression is an appropriated tool for estimation of parameters for the SIR model and numerical reconstruction of observational data in short range. Besides that Python 3.7 is an adequate computational ambient for treat this kind of data.
By inspection of the graphics, it can be concluded that the n days average can facilitate data inspection due to its smoothing properties.
The immediate lockdown during the pandemic outbreak and social distancing are the main tools for local pandemic control by controlling the Contact Rate β and consequently controlling the Basic Reproduction Number R0 .
Future works involving forecast of investigated data the consequences of parameters in different levels, adequate or not, will be developed.

Peer-review history:
The peer review history for this paper can be accessed here (Please copy paste the total link in your browser address bar) http://www.sdiarticle4.com/review-history/67121