Analysis of the Epidemic Curve of the Waves of COVID-19 Using Integration of Functions and Neural Networks in Peru

: The coronavirus (COVID-19) pandemic continues to claim victims. According to the World Health Organization, in the 28 days leading up to 25 February 2024 alone, the number of deaths from COVID-19 was 7141. In this work, we aimed to model the waves of COVID-19 through artificial neural networks (ANNs) and the sigmoidal–Boltzmann model. The study variable was the global cumulative number of deaths according to days, based on the Peru dataset. Additionally, the variables were adapted to determine the correlation between social isolation measures and death rates, which constitutes a novel contribution. A quantitative methodology was used that implemented a non-experimental, longitudinal, and correlational design. The study was retrospective. The results show that the sigmoidal and ANN models were reasonably representative and could help to predict the spread of COVID-19 over the course of multiple waves. Furthermore, the results were precise, with a Pearson correlation coefficient greater than 0.999. The computational sigmoidal–Boltzmann model was also time-efficient. Moreover, the Spearman correlation between social isolation measures and death rates was 0.77, which is acceptable considering that the social isolation variable is qualitative. Finally, we concluded that social isolation measures had a significant effect on reducing deaths from COVID-19.


Introduction
The COVID-19 pandemic caused severe social, economic [1][2][3], and psychological problems around the world, with a huge loss of human life [4].According to the World Health Organization (WHO), up until 25 February 2024, the number of COVID-19 deaths (the cumulative total) was more than seven million, with 7141 in the 28 days leading up until that date (among which 84 were Peruvians) [5].As a result, coronaviruses, the COVID-19 pandemic, and new variants are a notable subject of study in the scientific community [6][7][8][9].In addition, the cumulative number of deaths is the most critical indicator of the impact of the pandemic in most countries, showing typical behavior in the form of waves [10].
A representative or explanatory function of COVID-19 waves would help in the theoretical and practical study of the behavior of its spread.This interest extends to sociology, biology, psychology, economics, mathematics, statistics, and other sciences.Furthermore, predictions are essential for decision-making [11,12]; thus, explanatory models and forecasting mechanisms for COVID-19 waves are extremely useful, for example, regarding the implementation of social distancing by authorities.In addition, they can also be used in the hypothetical emergence of new pandemics [13].
Sigmoidal models adequately represent and describe COVID-19 waves.There are various works based on specific models, such as those by Gompertz, Brody, and von Berta-Informatics 2024, 11, 40 2 of 17 lanffy [7,[14][15][16][17].In particular, the sigmoidal-Boltzmann model has a simple representation as compared to other similar examples (e.g., the Gompertz model), which is convenient considering that the execution time is an important factor in numerical algorithms in nonlinear regression.
The sigmoidal-Boltzmann mathematical model has been used to study the propagation of the number of individuals infected by COVID-19.In this, a method for two waves [18] and later for successive waves was proposed [19].
In addition, artificial intelligence (AI), machine learning (ML), and artificial neural network (ANN) techniques have been used in many areas [20][21][22][23][24][25] for the study of COVID-19 [26][27][28].When a single high-accuracy prediction model is insufficient [29] to model the number of confirmed coronavirus deaths, artificial neural network techniques are used [30].However, there is no previous work on the association between social isolation measures and the rate of death from COVID-19 infections [31].
This research hypothesizes that sigmoid functions fit well to the global cumulative number of deaths.The Peruvian dataset was used; however, similar results would likely be obtained in other countries.
To demonstrate the usefulness of the results, the correlation between social isolation measures and death rates from COVID-19 was additionally analyzed.For this purpose, the variables were adapted, which constitutes a novel contribution.
The most important contributions of this research are as follows: (a) the modeling, analysis, and comparison of the two models (the sigmoidal-Boltzmann and ANN models) of the number of COVID-19 deaths; (b) the calculation and study of the correlation between the social isolation and mortality rate from COVID- 19.
We conclude that the models are novel and fit the data quite well (with a strong and positive correlation).Furthermore, they can be used to accurately predict the spread of COVID-19 with multiple waves, as demonstrated by the case study (Peru).The ANN model produced a slightly better Pearson correlation coefficient and did not require the data to follow an epidemic pattern.However, the ANN required much more time to perform the calculation.On the other hand, the sigmoidal-Boltzmann model is useful to form an explanatory model.The main drawback is that if the data do not follow a sigmoidal pattern, then the model might not fit.However, in practically all countries, COVID-19 registered sigmoidal behavior.Finally, the results demonstrate that social isolation measures had a significant effect on the reduction in deaths from COVID-19, with an acceptable Spearman correlation.
The remainder of this paper is organized as follows: Section 2 presents the "related work".Section 3 describes "the materials and methods".Section 4 shows the main "results", whereas Section 5 discusses "the case study (Peru)".Finally, Section 6 summarizes the main conclusions.

Related Work
We used two versions of the integration of functions method, i.e., the concatenation of functions: the mathematical version and the computational version [14].The novelty was the use of the sigmoidal-Boltzmann model for all COVID-19 waves.This produced better correlation and determination coefficients, i.e., goodness of fit, which summarizes the similarity between the observed values and the values expected under the model.Furthermore, the proposed model was efficient in terms of execution time due to its simple structure as compared to similar examples.
Aferni et al. applied the sigmoidal-Boltzmann mathematical model to study the spread of COVID-19 in different countries for the cumulative number of infected individuals [18] for two waves.Later, they studied the use of sigmoidal models for successive COVID-19 waves [19].A concrete method and computer program are necessary to work with many waves and consider possible pandemics in the future.
No studies consider all COVID-19 waves using integrated functions in the Peruvian case specifically.For Peruvian COVID-19 infection data, one research study used Mitchell's criteria [32], and there are studies using times series [33], which are different methods from those used in this work.
On the other hand, there are many proposals for COVID-19 prediction using artificial neural networks [8,30,34,35].For example, deep learning methods were used in Australia and Iran, and the authors concluded that the results could be useful for organizations working with COVID-19 [36].In Mexico, artificial neural networks and the Gompertz model were used, where the neural networks achieved a better correlation [26] (note: sigmoidal models have the great advantage of reporting parameters of an epidemic/pandemic).ANNs were also used in Brazil and Mexico [37].
In Russia and Brazil, models based on artificial intelligence were used [38].Those studies indicated that forecasting was a critical issue, and the principal recommendation was "total lockdown with more restrictions".Using data from China and other countries, the authors of one study concluded that ANNs were adequate to predict confirmed global infected cases and deaths of COVID-19; they also recommended that people should gather less, especially in places with poor air mobility [34].These recommendations were useful at the beginning of the pandemic, and social isolation was the main strategy used to control the pandemic [39][40][41].
There are many works on the effects of social isolation on human beings but almost no studies regarding the relationship between social isolation and the rate of COVID-19 cases [31].Finally, one study explains that social isolation indices were not associated with the evolution of the pandemic, but sales of hydroxychloroquine (HCQ) and chloroquine (CQ) were significantly correlated with it (in the state of Santa Catarina in southern Brazil) [42].

Materials and Methods
A quantitative methodology was used, with a non-experimental, longitudinal, and correlational design.The study was retrospective with an analytical approach.Nonlinear regression (the statistical numerical method [43]) was used with a correlational hypothesis specific for coronavirus in Peru.Additionally, artificial neural networks were used.

Dataset
The dataset of the cumulative number of deaths for each country can be downloaded from the Johns Hopkins University Center for Systems Science and Engineering data repository [44] https://github.com/CSSEGISandData/COVID-19(accessed on 1 December 2023).It is the only data source for the case study (Peru).
The dataset is a time series composed of 1099 days.The first day corresponds to the first death from COVID-19 and extends until day X = 1099 with Y = 219,539 accumulated deaths.The cumulative number of deaths is counted in thousands for representation purposes (e.g., in graphs).The information is complete, and there are no invalid or outlier data.
Two dummy variables [45] were added that indicate the wave number: the first X 1 was indexed with consecutive numbers (the first wave with 1, the second with 2, the third with 3, and so on), and the second variable X 2 was indexed with powers of 2 (the first wave with 1, the second with 2, the third with 4, . .., the nth with 2 n−1 ).

Inflection Points
The inflection points [46] are limits that indicate the end and beginning of waves.They were calculated as follows: First, the data were fitted to a third-degree polynomial function P(x) = D + A•x + B•x 2 + C•x 3 (using the R statistical software, version 4.3.3).It was an elementary function within the set of functions that had at least one inflection point.In addition, the second derivative was easy to obtain P ′′ (x) = 4•B + 6•C•x.There were other functions, for example, P(x) = x/(1 − x 2 ), with one inflection point and P(x) = x/( 3 ) with three inflection points.Finally, P ′′ (x 0 ) = 0 was solved, and the solution was the inflection point x 0 = −b/(3c) (since it satisfied P ′′′ (x 0 ) ̸ = 0).
In the full scatter plot (the entire time series), concavity changes can be observed in the first two waves, but they are difficult to distinguish in the last two.However, if we zoom in, we can see the concavities.To illustrate, Figure 1 shows the cumulative deaths from day 740 to 874 (the full figure is shown in Section 5).The blue diamond indicates the calculated inflection spots, i.e., the third of fourth.
was easy to obtain P′′ x 4 •  6 •  • x .There were other functions, for example, P x x 1 x ⁄ , with one inflection point and P x  √1 x ⁄ with three inflection points.Finally, ′′  0 was solved, and the solution was the inflection point   3 ⁄ (since it satisfied ′′′  0).In the full scatter plot (the entire time series), concavity changes can be observed in the first two waves, but they are difficult to distinguish in the last two.However, if we zoom in, we can see the concavities.To illustrate, Figure 1 shows the cumulative deaths from day 740 to 874 (the full figure is shown in Section 5).The blue diamond indicates the calculated inflection spots, i.e., the third of fourth.

The Sigmoidal-Boltzmann Function
The sigmoidal-Boltzmann model is a function for a time series [47] and a particular case of the logistic function.

𝐹 𝑥 where x is the number of days since the first case (the independent variable);  and  are the lower and higher asymptotes, respectively; F(x) describes the expected cumulative number of deaths as a function of the day x; it varies from  to  ; Z is the center (halfway between the  and  value); D is the pandemic relaxation constant; e is Euler's number.In order to simplify the work, the model parameters were reduced, and Equation (2) was used in the program: where    is the height.

The Sigmoidal-Boltzmann Function
The sigmoidal-Boltzmann model is a function for a time series [47] and a particular case of the logistic function. where x is the number of days since the first case (the independent variable); I BOTTOM and I TOP are the lower and higher asymptotes, respectively; F(x) describes the expected cumulative number of deaths as a function of the day x; it varies from I BOTTOM to I TOP ; Z is the center (halfway between the I BOTTOM and I TOP value); D is the pandemic relaxation constant; e is Euler's number.
In order to simplify the work, the model parameters were reduced, and Equation (2) was used in the program: where I = I TOP − I BOTTOM is the height.

The Program
All formulas and graphs, including data dispersion and curves, were obtained with a computer program; therefore, the functions are error-free.
The program was built for general purposes.It can be run with data from any country and work with the necessary number of waves.It can even be used in other applications (not necessarily with sigmoidal functions).
Two functions are particularly useful: the first is the function that calculates the model parameters (ModelParam), which was invoked once for each wave of COVID-19; the second function is to export the functions (results) in LaTeX format [48,49], which can be used in a word processor (e.g., Microsoft Word or LaTeX itself); similarly, the functions can be exported to Octave for mathematical analysis.Algorithm 1 explains the modeling procedure.4 Results: Report the model parameters and the correlation coefficient.Additionally, it can be exported in LaTeX format.5 Graphics: Set graphics plot style (e.g., line and color) and save them to a JPG file format.

The Mathematical Version
Let H 1 (x), H 2 (x), . .., H n (x) be functions for n consecutive waves, which are combined into a single function and activated by the following Dp coefficient: , adding feature q to the training data (for example, consecutive numbers) [14], the coefficients are presented in Table 1.
Table 1.Coefficients for five waves.
The way to obtain the coefficients, according to q, is given by the following: where w is the wave number, H w (x) is the sigmoidal function, and x is the day number since the first case.Specifically, for n = 5 waves, the coefficients are as follows: This result is general for five waves and can be applied to any dataset that presents five waves with sigmoidal behavior or otherwise.Peru had five COVID-19 waves.
If q = 2, wave two will be activated, so the formula can be reduced to the following:

Results: The Case Study
Peru is situated in western South America.It is bordered to the north by Ecuador and Colombia, to the east by Brazil and Bolivia, to the south by Chile, and to the west by the Pacific Ocean.Its territory covers more than 1.2 million square kilometers, and it is the 19th largest country in the world.According to estimates from the National Institute of Statistics and Informatics (in Spanish, "Instituto Nacional de Estadística e Informática"), as of 30 June 2020, Peru had 32,625,948 inhabitants.Administratively, it is divided into 24 departments and the constitutional province of Callao.It is considered an emerging economy [50].

Modeling the Number of Deaths with the Sigmoidal-Boltzmann Model
The procedure explained in Section 3 (Materials and Methods) was used to build the model.The calculations were performed on a HP 11th Generation Intel(R) Core™ i7 2.80 GHz.
The sigmoidal-Boltzmann function was used to model the number of deaths from COVID-19 in Peru.Five sigmoidal-Boltzmann functions were obtained, one for each wave.The first death was on 6 March 2020, and the time series extends until 9 March 2023.In Figure 2, we can see the observed data (grey), the Boltzmann_1 function for the initial wave (in solid green), the Boltzmann_2 function for the second wave (in dashed red), the Boltzmann_3 function for the third wave (in solid brown), the Boltzmann_4 function for the fourth wave (in dashed black), and the Boltzmann_5 function for the fifth wave (in solid orange).The blue diamonds indicate the beginning and end of the waves.
In the curve observed in Figure 2 and in the parameters obtained from the sigmoidal-Boltzmann functions, it is possible to appreciate the behavior of the different COVID-19 waves.The first two waves were the largest, i.e., they lasted longer (in days), had a greater number of victims, and had a steeper slope, which denotes greater lethality.Among them, the second wave was the largest.The third wave followed with a significantly reduced propagation parameter; however, it is still possible to appreciate the wave.Finally, thanks to the function's parameters (almost nothing can be distinguished in the figure), the fourth and fifth waves were obtained, which comprised the shortest duration in days and considerably fewer victims.In this situation, the pandemic was considered to be over.
In Peru, the first two waves were large compared to the subsequent three.Each wave followed a characteristic pandemic sigmoidal function behavior.
Figure 2 shows the adjusted sigmoidal-Boltzmann function, with a Pearson correlation R = 0.999 and an R 2 = 0.9998, which are acceptable measurements.The correlation was not equal to zero.
For the case study, two versions were obtained, each with their advantages.For the case study, two versions were obtained, each with their advantages.

216.95
(5) Since the aim was to interpret each wave and/or compare it to the others, factorization was not convenient.
The computational version: The advantage of the two versions is that the functions and parameters for each wave are visible, allowing comparisons.
In Figure 2, the sigmoidal behavior of the curves is indistinguishable due to the size and scale (the ordinate axis represents more than 200,000 deaths, and the abscissa axis represents more than 1100 days).Figure 3 shows the last two waves of the pandemic.On the abscissa axis (horizontal), the same scale was maintained to correctly appreciate the duration of the waves (in days).As can be seen, the fourth and fifth waves only lasted a few days, with the fifth having the shortest duration.The advantage of the two versions is that the functions and parameters for each wave are visible, allowing comparisons.
In Figure 2, the sigmoidal behavior of the curves is indistinguishable due to the size and scale (the ordinate axis represents more than 200,000 deaths, and the abscissa axis represents more than 1100 days).Figure 3 shows the last two waves of the pandemic.On the abscissa axis (horizontal), the same scale was maintained to correctly appreciate the duration of the waves (in days).As can be seen, the fourth and fifth waves only lasted a few days, with the fifth having the shortest duration.

Comparison with Classic Models
In this section, classical models are compared with the Boltzmann model.Fundamentally, the classical models were not able to outperform the Boltzmann model because the waves exhibit sigmoidal behavior with vertical and horizontal inflection points.Table 2 presents the analysis of the most common models.The functions are continuous and can have several inflection points; however, they cannot represent a step sequence of sigmoidal functions.Moreover, they do not flatten at the end and do not have horizontal asymptotes; when "x" tends to infinity, "y" tends to ∞.

Comparison with Classic Models
In this section, classical models are compared with the Boltzmann model.Fundamentally, the classical models were not able to outperform the Boltzmann model because the waves exhibit sigmoidal behavior with vertical and horizontal inflection points.Table 2 presents the analysis of the most common models.
In the spline model, the segment joining points are called nodes.For these, vertical and horizontal inflection points were used.Then, all that remained was to calculate a curve for each segment.
Figure 4 shows the estimated Spline function in red, the cumulative number of confirmed deaths (in thousands) per day (2020-2023).The observed data in black and the vertical lines in blue are the projected nodes (inflection points) that were used to build the model.

Models Model Adjustment to COVID-19 Data
Exponential, logarithmic, square root model.
The functions are not suitable because they have no inflection points and represent a single curve.Note: the observed data represent a sequence of sigmoidal shapes.
The functions are continuous and can have several inflection points; however, they cannot represent a step sequence of sigmoidal functions.Moreover, they do not flatten at the end and do not have horizontal asymptotes; when "x" tends to infinity, "y" tends to ±∞.

Spline model (segmental polynomial fit).
Because in the spline model, the data on the abscissa axis are divided into segments, the problem of the step sequence of sigmoidal functions is solved.However, this model is limited to the polynomial functions that the spline uses in each segment.

Spline model (segmental polynomial fit).
Because in the spline model, the data on the abscissa axis are divided into segments, the problem of the step sequence of sigmoidal functions is solved.However, this model is limited to the polynomial functions that the spline uses in each segment.
In the spline model, the segment joining points are called nodes.For these, vertical and horizontal inflection points were used.Then, all that remained was to calculate a curve for each segment.
Figure 4 shows the estimated Spline function in red, the cumulative number of confirmed deaths (in thousands) per day (2020-2023).The observed data in black and the vertical lines in blue are the projected nodes (inflection points) that were used to build the model.The spline model stood out among the classical models; however, the function did not fit as well as that of the Boltzmann model, and the correlation and determination coefficients were R = 0.9979443 and R 2 = 0.9958928, respectively.Another drawback is that it required ten segments (or nine inflection points), whereas the Boltzmann model only required five segments (specifically, four horizontal inflection points).Finally, the model had no epidemic parameters.

Correlation between Isolation Measures and the Mortality Rate
First, the social isolation measures in the case of Peru will be explained, followed by the procedure for calculating the correlation of the two variables.
The social isolation measures included the use of masks, border closures, police control, and others, as specified in law (Table 3).
In Table 3, group 1 is characterized by strict measures.In group 2, partial permission was granted for outdoor sports activities, as well as the use of beaches, temples, amongst others.Subsequently, for the third decree of group 2, alert levels (moderate, high, exceedingly high, and extreme) were established for the focused application of restrictions in each place.
The first death occurred on 6 March 2020, and the last occurred on 9 March 2023.Within this timeframe, there were two groups of isolation measures: the first began on 16 The spline model stood out among the classical models; however, the function did not fit as well as that of the Boltzmann model, and the correlation and determination coefficients were R = 0.9979443 and R 2 = 0.9958928, respectively.Another drawback is that it required ten segments (or nine inflection points), whereas the Boltzmann model only required five segments (specifically, four horizontal inflection points).Finally, the model had no epidemic parameters.

Correlation between Isolation Measures and the Mortality Rate
First, the social isolation measures in the case of Peru will be explained, followed by the procedure for calculating the correlation of the two variables.
The social isolation measures included the use of masks, border closures, police control, and others, as specified in law (Table 3).
In Table 3, group 1 is characterized by strict measures.In group 2, partial permission was granted for outdoor sports activities, as well as the use of beaches, temples, amongst others.Subsequently, for the third decree of group 2, alert levels (moderate, high, exceedingly high, and extreme) were established for the focused application of restrictions in each place.The first death occurred on 6 March 2020, and the last occurred on 9 March 2023.Within this timeframe, there were two groups of isolation measures: the first began on 16 March 2020 and ended on 30 November 2020; the second began on 1 December 2020 and ended on 31 May 2021.
For the social isolation measures, we assigned a value of one to the days with social isolation measures and zero to the days without social isolation measures, according to Table 3.
In addition, it was necessary to consider the pandemic death rate, not the cumulative number of deaths (as seen in Figure 2).Therefore, the first derivative of the functions F(x, p) was calculated.The new function F ′ (x, p) represents the increase or decrease in the death rate.The ordinate axis is the slope or gradient (velocity).It was positive because successive values of F(x, p) always increased or at least remained the same (the cumulative variable).
A wave can be large according to two main dimensions: the abscissa axis, which indicates the duration in days, and the ordinate axis, which explains the rate of growth of the cumulative number of deaths.
In Figure 5, F ′ (x, p), or the rate of death, is shown in blue, and the days with social isolation measures are shown in shaded bands (group 1 in yellow and group 2 in orange).The first two waves were large, and the subsequent waves were progressively smaller, until they ended up practically flat.Isolation measures were in effect during the first two waves, and there were no isolation measures as the waves became considerably smaller.
As derived from the computational version (the blue curve in Figure 5), the death rate of the change function is as follows: where "Cosh" is the hyperbolic cosine function.

Statistical Results
The statistical report indicates that there was a positive and significant association between the isolation measures and the death rate, i.e., the size of the waves.The alternative hypothesis is as follows: the true rho is greater than 0 (with p-value 2.2  less than the significance level of 0.05).
The Spearman correlation was ρ 0.7653103.It should be highlighted that the Spearman correlation was used for numerical scores and ordinal categorical options (nonparametric correlation) [51,52].
There are a few investigations that aim to find correlations between COVID-19 (deaths, cases, etc.) and other variables, such as COVID-19 occurrences and hospitalizations and Contextual Social Determinants of Health (SDoHs) [9].However, to the best of the authors' knowledge, there are no studies on the correlation between social isolation measures and death rates from COVID-19.
In Figure 5, the curve begins to grow, which shows an exponential increase in the death rate from COVID-19.At the peak, the rate reaches its maximum value, which is interpreted as a change in the death rate (velocity).From this point on, the death rate begins to decrease until it almost flattens.The second wave has a greater height and higher death rates.Therefore, it is more significantly prolonged on the abscissa axis, which shows that it lasted longer in days and finally ended with a trend towards zero.

Discussion
The social isolation measures could be interpreted as "a weight placed on the waves of COVID-19" or a hammer blow that flattened or reduced the growth rate.Without them, the wave would have grown larger and reached higher mortality rates.We must clarify that the decline in the waves may have been due to other causes, and these may be unknown, inaccessible, and/or difficult or impossible to process.
Vaccination began on day 342 (9 February 2021), as counted from the first death (during the second wave).It was applied exclusively to intensive care medical personnel.When the 300,000 doses of vaccines arrived, it was declared "National Vaccination Day against COVID-19 in Peru" (Ministerial Resolution N. 924-2021-MINSA).The second batch of 276,000 doses arrived on day 410 (18 April 2021) (Organización Panamericana de la Salud), and the other groups arrived later.Therefore, the decline in the first wave was not due to vaccines, with vaccines playing a respective role in the later waves.

Statistical Results
The statistical report indicates that there was a positive and significant association between the isolation measures and the death rate, i.e., the size of the waves.The alternative hypothesis is as follows: the true rho is greater than 0 (with p-value = 2.2 × e −16 less than the significance level of 0.05).
The Spearman correlation was ρ = 0.7653103.It should be highlighted that the Spearman correlation was used for numerical scores and ordinal categorical options (nonparametric correlation) [51,52].
There are a few investigations that aim to find correlations between COVID-19 (deaths, cases, etc.) and other variables, such as COVID-19 occurrences and hospitalizations and Contextual Social Determinants of Health (SDoHs) [9].However, to the best of the authors' knowledge, there are no studies on the correlation between social isolation measures and death rates from COVID-19.
In Figure 5, the curve begins to grow, which shows an exponential increase in the death rate from COVID-19.At the peak, the rate reaches its maximum value, which is interpreted as a change in the death rate (velocity).From this point on, the death rate begins to decrease until it almost flattens.The second wave has a greater height and higher death rates.Therefore, it is more significantly prolonged on the abscissa axis, which shows that it lasted longer in days and finally ended with a trend towards zero.

Discussion
The social isolation measures could be interpreted as "a weight placed on the waves of COVID-19" or a hammer blow that flattened or reduced the growth rate.Without them, the wave would have grown larger and reached higher mortality rates.We must clarify that the decline in the waves may have been due to other causes, and these may be unknown, inaccessible, and/or difficult or impossible to process.
Vaccination began on day 342 (9 February 2021), as counted from the first death (during the second wave).It was applied exclusively to intensive care medical personnel.When the 300,000 doses of vaccines arrived, it was declared "National Vaccination Day against COVID-19 in Peru" (Ministerial Resolution N. 924-2021-MINSA).The second batch of 276,000 doses arrived on day 410 (18 April 2021) (Organización Panamericana de la Salud), and the other groups arrived later.Therefore, the decline in the first wave was not due to vaccines, with vaccines playing a respective role in the later waves.

Modeling the Number of Deaths with the ANN
An artificial neural network (ANN) is constructed based on a mathematical structure of layers (the input layer, which is determined from the input variable; the hidden layer; and the output layers), in which information is inserted to model outputs through a learning process [53,54].
Optimal artificial neural networks were used to model the number of deaths in Peru [35,36]  The calculations were completed with the same computer used to develop the sigmoidal-Boltzmann model.All calculations to obtain the ANN model were carried out with Python language programming.
Figure 6 shows the number of deaths (grey) and the estimated data from the artificial neural network (blue).The comparison of these data exhibits a correlation of R = 0.9999 and an explained variance of 99.98% (R 2 ).

Modeling the Number of Deaths with the ANN
An artificial neural network (ANN) is constructed based on a mathematical structure of layers (the input layer, which is determined from the input variable; the hidden layer; and the output layers), in which information is inserted to model outputs through a learning process [53,54].
Optimal artificial neural networks were used to model the number of deaths in Peru [35,36]  The calculations were completed with the same computer used to develop the sigmoidal-Boltzmann model.All calculations to obtain the ANN model were carried out with Python language programming.
Figure 6 shows the number of deaths (grey) and the estimated data from the artificial neural network (blue).The comparison of these data exhibits a correlation of R = 0.9999 and an explained variance of 99.98% (R 2 ).We built a program in Python, the details and architecture of which are presented in the next subsection.
The Procedure and Architecture of the ANN The data were normalized and split: 75% for training (green) and 25% for testing (blue).
The time series from t to t + 2 was the "feature" for a window of three time steps, while the target was from t + 1 to t + 3. The knowledge from t + 1 to t + 2 was used for training.
We used an LSTM (Long Short-Term Memory) ANN model with one input neuron, one-hundred hidden neurons, and one output neuron.A fully connected layer was used in the model.The first component consisted of the hidden states, one for every input time step.The second, which was not utilized, was the memory and hidden states.Finally, 500 epochs were used, with a lookback = 10 (lookback period).We built a program in Python, the details and architecture of which are presented in the next subsection.
The Procedure and Architecture of the ANN The data were normalized and split: 75% for training (green) and 25% for testing (blue).The time series from t to t + 2 was the "feature" for a window of three time steps, while the target was from t + 1 to t + 3. The knowledge from t + 1 to t + 2 was used for training.
We used an LSTM (Long Short-Term Memory) ANN model with one input neuron, one-hundred hidden neurons, and one output neuron.A fully connected layer was used in the model.The first component consisted of the hidden states, one for every input time step.The second, which was not utilized, was the memory and hidden states.Finally, 500 epochs were used, with a lookback = 10 (lookback period).
Since it is a regression problem, Adam's optimizer was used to minimize the mean square error (MSE) as the loss function.We evaluated the model's performance once per 100 epochs, assessing both the training and test data.

Comparison
In the case study (Table 4), the artificial neural network model had a slightly better Pearson correlation coefficient.It did not require the data to follow an epidemic pattern.In general, it was also useful when the behavior of the data series was unknown.However, the ANN model required much more time to perform the calculation than the sigmoidal-Boltzmann model, and it did not report the p-value and other statistics, which are fundamental for statistical inference.Moreover, in some cases (when there were several layers and neurons), it had many coefficients.
On the other hand, the sigmoidal-Boltzmann model was useful to form an explanatory model.Statistical inference could be used, and it could even be used for prediction (with the confidence interval).It also provided with pandemic parameters.The Pearson's product-moment correlation was δ = 0.9999.The procedure is deterministic, i.e., each execution always reports the same result (e.g., parameters, p-value, t-Student, degrees of freedom, amongst others).The drawback is that if the data do not follow a sigmoidal pattern, then the model might not fit.In this case, it is replaced with another function depending on the pattern of the data, and classical models (for example, exponential, logarithmic, square root, and polynomial), advanced models (for example, logistics, Poisson, Negative Binomial, Dirichlet), time series, and others can be used.However, in practically all countries, COVID-19 registered sigmoidal behavior, which represents a future avenue of study.
In terms of similarities, both are useful as representative/competitive models and even serve for predictions.
Finally, there was no absolute winner, with each model exhibiting virtues and disadvantages.We believe that it is better to have two models than one, as there is the option to compare them.

Limitations
The Peru dataset contains the number of deaths at a global level.It is not disaggregated by regions or cities (with the exception of, for example, Australia, Canada, China, and the United Kingdom).In addition, our results are limited to the constraints of the methodology and models.In the case of social isolation measures, we were limited to the adaptations made.The other variables were not available and/or were difficult or impossible to discretize.

Future Research Directions
This work can be extended to other countries and other epidemics/pandemics.To do so, it will be necessary to have access to a dataset, as was the case for COVID-19.For example, this year, Dengue (break-bone fever) has caused waves of infections and even deaths.This methodology could be useful for studying the behavior of the associated variables.In general, it is possible to study different phenomena that present certain patterns in their datasets.

Conclusions
The cumulative number of deaths from COVID-19 was modeled using artificial neural networks and sigmoidal-Boltzmann functions based on daily data from Peru.In addition, according to our pilot study, the results do not lose generality, i.e., similar results would be obtained in other countries.
The models are novel and fit the data reasonably well.Statistically, there was a strong, positive, and very significant correlation between the two variables, and the null hypothesis, i.e., the non-existence of a correlation, was rejected.Furthermore, the models could be used to accurately predict the spread of COVID-19 with multiple waves, as demonstrated in the case study (Peru).
In the case study, the ANN model had a slightly better Pearson correlation coefficient.Moreover, it did not require the data to follow an epidemic pattern.However, the model required much more time to perform the calculation than the sigmoidal-Boltzmann model.
On the other hand, the sigmoidal-Boltzmann model may be useful to form an explanatory model; specifically, the formula provides pandemic parameters.Statistical inference can be used, and it could even be used for predictions.The drawback is that if the data do not follow a sigmoidal pattern, then the model might not fit; however, there are other functions depending on the pattern of the data, and classical models (for example, exponential, logarithmic, square root, and polynomial), advanced models (for example, logistics, Poisson, Negative Binomial, Dirichlet), and time series can be used.
In conclusion, there was no absolute winner, with each model exhibiting advantages and disadvantages.
Additionally, the Boltzmann model was compared with classical models.In this, only the spline model stood out, but the function did not fit as well as that of the Boltzmann model.
The proposed method can be useful for other pandemics and for many general applications that involve certain patterns in the data.The procedure and program only require a change in the type of function.
Finally, the analytical results demonstrate that there was a positive and significant correlation between the isolation measures and the death rate from COVID-19, with an acceptable Spearman correlation considering that the social isolation variable is qualitative.

Figure 1 .
Figure 1.The cumulative number of deaths (in thousands) with respect to the day number (day one is the first death).The observed data (or dataset) are in gray (day 740 to 874), the regression function is in solid red, and the third inflection point is the blue diamond.

Figure 1 .
Figure 1.The cumulative number of deaths (in thousands) with respect to the day number (day one is the first death).The observed data (or dataset) are in gray (day 740 to 874), the regression function is in solid red, and the third inflection point is the blue diamond.

Algorithm 1 . 2
Algorithm for modeling COVID-19 1 Preprocessing: Load data, prepare data structures, scale data, and configure constants and variables.Calculation of model parameters: Translate coordinates and estimate parameters (with an auxiliary function).3 Construction of the Boltzmann function.Build the integrated function (with a loop according to the number of waves).

Figure 2 .
Figure 2. The sigmoidal-Boltzmann model for the cumulative number of confirmed deaths (in thousands) per day (2020-2023).The observed data in grey, the Boltzmann1 function for the initial wave in solid green, the Boltzmann2 function for the second wave (in dashed red), the Boltzmann3 function for the third wave (in solid brown), the Boltzmann4 function for the fourth wave (in dashed black), and the Boltzmann5 function for the fifth wave (in solid orange).The blue diamonds indicate the beginning and end of the waves.

Figure 2 .
Figure 2. The sigmoidal-Boltzmann model for the cumulative number of confirmed deaths (in thousands) per day (2020-2023).The observed data in grey, the Boltzmann1 function for the initial wave in solid green, the Boltzmann2 function for the second wave (in dashed red), the Boltzmann3 function for the third wave (in solid brown), the Boltzmann4 function for the fourth wave (in dashed black), and the Boltzmann5 function for the fifth wave (in solid orange).The blue diamonds indicate the beginning and end of the waves.

Figure 3 .
Figure 3.The sigmoidal-Boltzmann model for the cumulative number of confirmed deaths (in thousands) according to days.The fourth and fifth waves are on the left and right sides, respectively.The observed data are in grey; the Boltzmann function for the fourth and fifth waves is in solid red.

Figure 3 .
Figure 3.The sigmoidal-Boltzmann model for the cumulative number of confirmed deaths (in thousands) according to days.The fourth and fifth waves are on the left and right sides, respectively.The observed data are in grey; the Boltzmann function for the fourth and fifth waves is in solid red.

Figure 4 .
Figure 4.The spline model for the cumulative number of confirmed deaths (in thousands) per day (2020-2023).The observed data are in black, and the spline function is in red.The vertical blue lines are the projected inflection points.

Figure 4 .
Figure 4.The spline model for the cumulative number of confirmed deaths (in thousands) per day (2020-2023).The observed data are in black, and the spline function is in red.The vertical blue lines are the projected inflection points.

N • 044 Group 2 .
Supreme Decree No. 174-2020 and its extensions allow some activities outside the home.

Figure 5 .
Figure 5.Comparison between the death rate function F'(x,p) (in blue) and days with social isolation in shaded bands (yellow and orange).

Figure 5 .
Figure 5.Comparison between the death rate function F ′ (x,p) (in blue) and days with social isolation in shaded bands (yellow and orange).

Figure 6 .
Figure 6.Dataset of the cumulative number of deaths (scaled and in red) according to days and those estimated by the ANN (blue)-Peru (2020-2023).Train data in green and test data in blue.The obtained model could at least represent the number of cumulative deaths caused by the COVID-19 pandemic.We built a program in Python, the details and architecture of which are presented in the next subsection.

Figure 6 .
Figure 6.Dataset of the cumulative number of deaths (scaled and in red) according to days and those estimated by the ANN (blue)-Peru (2020-2023).Train data in green and test data in blue.The obtained model could at least represent the number of cumulative deaths caused by the COVID-19 pandemic.We built a program in Python, the details and architecture of which are presented in the next subsection. 1&q)

Table 2 .
Analysis of classical regression models.

Table 2 .
Analysis of classical regression models.

Table 4 .
Differences between models.