A method for forecasting the number of hospitalized and deceased based on the number of newly infected during a pandemic

In this paper we propose a phenomenological model for forecasting the numbers of deaths and of hospitalized persons in a pandemic wave, assuming that these numbers linearly depend, with certain delays \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\tau >0$$\end{document}τ>0 for deaths and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\delta >0$$\end{document}δ>0 for hospitalized, on the number of new cases. We illustrate the application of our method using data from the third wave of the COVID-19 pandemic in Croatia, but the method can be applied to any new wave of the COVID-19 pandemic, as well as to any other possible pandemic. We also supply freely available Mathematica modules to implement the method.

www.nature.com/scientificreports/ total number of people diagnosed with the disease for a particular period 12 ; a mathematical model to determine the maximally allowed daily growth rates that lead away from exponential increase toward stable and declining numbers 13 ; a method to predict the number of deaths 14 . In Ref. 15 based on data for the first wave of the COVID-19 pandemic in the United States (US) and in the European Economic Area countries (EEA), a mathematical model using the Gauss model function was proposed for forecasting the necessary capacity of hospitals in the US and the EEA. In Ref. 16 a framework was designed for assessing the predictive validity of COVID-19 mortality forecasts. The authors in Ref. 17 study the factors associated with observed trends in the in-hospital mortality rates in the US during the first nine months of the COVID-19 pandemic. Especially, often used in the literature was the logistic growth model and its generalizations 10,11,[18][19][20] . For example, in Ref. 20 it was analyzed the growth behavior of the top 25 most affected countries by means of a local slope analysis and three distinct patterns were identified which individual countries follow depending on the strictness of the lock-down protocols: rise and fall, power law, and logistic. Furthermore, in Ref. 11 the authors proposed a new logistic model that is well-suited for power-law epidemic growth. It was shown that this model consistently makes accurate predictions of peak heights, peak locations and cumulative saturation values for incomplete epidemic growth curves.
Our paper is organized as follows. In the next section we propose a new method for forecasting, during a pandemic, the numbers of hospitalized and deceased based on the number of new cases. In "Application of the method to COVID-19 pandemic" we apply the proposed method to the third wave of COVID-19 pandemic in Croatia. Some conclusions are given in "Conclusions", and in "Data and computer code availability" we describe our freely available software developed for the proposed method.

Forecasting the numbers of deceased and hospitalized persons
Assume that in time of an epidemic we have at our disposal data (t i , n i , d i , h i ) , i = 1, . . . , m , on the numbers of confirmed new cases (n i ) , newly deceased (d i ) , and the total numbers of hospitalized persons (h i ) on day t i , during a certain observed period [t 1 , t m ].
Hypothesizing that the number of deceased on the day t depends on the number of new cases at some previous day t − τ , τ > 0 , and that the number of newly hospitalized on the day t depends on the number of new cases on some previous day t − δ , δ > 0 , we will try to estimate the numbers of deceased in the upcoming period [t m , t m + τ ] , and of hospitalized in the upcoming period [t m , t m + δ] , thus giving important indicators for monitoring and fighting the pandemic.
In order to operationalize these assumptions using the available data, we will first determine the corresponding growth model function for the newly reported cases.
Due to different methodologies and dynamic of daily testing throughout the week, the daily data on new cases are not reliable (i.e. contain some random errors). Therefore, instead of using the daily data, we will estimate the values of parameters a, b, and c of the growth model function based on the cumulative numbers N i = i s=1 n s , i = 1, . . . , m , of new cases during the same period [t 1 , t m ] . The derivative t → � ′ (t) will be used as the model function for the daily new cases in the period [t 1 , t m ].
For the growth model function one can choose any of the well-known growth model functions: logistic or generalized logistic model function (see e.g. Refs. 21,22 ), Gompertz model function (see e.g. Ref. 23 ), or Weibul model function (see e.g. Ref. 24 ). According to a large number of references on modeling the COVID-19 pandemic (see e.g. Refs. 11,19,20 ), in this paper we will use the ordinary Logistic model function which is the solution to the differential equation describing the following law: The growth rate of the number of cases at the moment t is t proportional to the total number of cases at that moment, y(t), and the number of potentially new cases, (a − y(t)).
The unknown parameters a, b, c will be determined by solving the nonlinear least squares problem 25,26 The obtained parameters will be denoted a ⋆ , b ⋆ , and c ⋆ , and the model function will be the function t → y(t; a ⋆ , b ⋆ , c ⋆ ).
The simple global optimization problems (GOP) (3) can be solved using the Mathematica module NonlinearModelFit 27 .
Forecasting the number of deceased. As we already said, the dependence of the number of deceased on the number of new cases is based on the following assumptions:  (2) y ′ = c y (a − y), a, c > 0, www.nature.com/scientificreports/ Knowing the model function of the cumulative number of new cases, i.e. knowing the parameters a ⋆ , b ⋆ , c ⋆ , the function of daily deceased can be expressed by (see also similar models in Refs. 24,28,29 ) The parameters u, α and τ of the model function ϕ will be determined using data (t i , d i ) , i = κ, . . . , m , on the numbers of deceased as the following GOP (data for the deceased are for κ , say 15, days later since we assume that the deaths before that belong to the previous pandemic wave): The solution to this problem will be denoted (u ⋆ , τ ⋆ , α ⋆ ) : τ ⋆ is the average period (in days) between new cases and the corresponding deaths, and α ⋆ represents the proportion of deceased among the new cases reported τ ⋆ days earlier.
Since in general, the number τ ⋆ won't be an integer, we will denote by τ = ⌊τ ⋆ ⌉ the nearest integer. Therefore, the number of deceased during the period [t m+1 , t m +τ ] of τ days can be calculated using the formula This procedure should be repeated, by adding new data, each day.

Remark 1
Because of numerical sensitivity of the GOP (5), we will solve this problem similarly as was done in Refs. 30,31 : first we determine the initial approximation using the global optimization algorithm DIRECT 32-34 , and then we apply the Newton optimization method 25,26 by using Mathematica module NonlinearModelFit. The same will be done to solve the GOP (9).
Forecasting the number of hospitalized. The connection between the numbers of hospitalized and of newly infected is more complicated than in the case of deceased. Namely, the total number h i of hospitalized on day t i can be defined as where ν i is the number of those admitted to hospital on day t i , ρ i is the number of released from hospital on day t i , and d i is the number of patients who died on day t i . Note that ν i − ρ i − d i denotes the change (the growth or decrease) of the number of hospitalized patients on day t i . We will assume the following: (i) there is a time delay δ between new cases and new hospitalizations; (ii) The number of hospitalized linearly depends on the derivative optimal parameters obtained by solving the nonlinear least squares problem (3) on the basis of cumula- Based on these assumptions and knowing the growth model function t → �(t; a ⋆ , b ⋆ , c ⋆ ) for the cumulative number of new cases, the estimated number of hospitalized can be expressed as (see also similar models in Refs. 28,29 ) where the parameters u, v, and δ of the model function ψ will be determined using data (t i , h i ) , i = κ, . . . , m , on the numbers of hospitalized persons, as the following GOP: where data for the hospitalized persons are for κ , say 15, days later since we assume that hospitalizations before that belong to the previous wave. The solution to this problem will be denoted (u ⋆ , v ⋆ , δ ⋆ ) . The number δ ⋆ is the average period (in days) between new cases and the corresponding hospitalizations.
The number h i of hospitalized on the day t i , i > m , can now be estimated as Comparing (7) and (10), we have Therefore, the change (the growth or decrease) ν i − ρ i − d i of the number of patients hospitalized on day t i , i > m , can be expressed as the value ψ ′ (t i , u ⋆ , v ⋆ , δ ⋆ ). Important points of the function ψ ′ are its maximum M which is reached at www.nature.com/scientificreports/ and its null point T 0 = (t 0 , 0) . One can say that the number of hospitalized has a progressive growth until the moment t M , and a degressive growth after that, and that the number of hospitalized decreases after the moment t 0 .
Since in general, the number δ ⋆ is not an integer, we will denote by δ = ⌊δ ⋆ ⌉ the nearest integer. Therefore, the predicted numbers of hospitalized during the next period of δ days are This procedure should be repeated, by adding new data, each day.
We also developed software support for the proposed method in form of Mathematica modules, see "Data and computer code availability".

Application of the method to COVID-19 pandemic
We will test our proposed method on data for the third wave of COVID-19 pandemic in Croatia, predicting the numbers of hospitalized and of deceased persons.

COVID-19 pandemic in Croatia.
We will use the daily data on new cases (Fig. 1a), deaths (Fig. 1b), and hospitalized ( Fig. 1c) in Croatia, available at https:// covid. ourwo rldin data. org/ data/ owid-covid-data. xlsx, starting with February 20, 2021 when the third wave of the pandemic in Croatia was declared. This will be the first day, numbered t 1 = 1 . June 7 will be considered the last day of that pandemic wave.
Since we assumed that the numbers of deceased and of hospitalized lag behind the number of new cases by several days, we will consider data on new cases starting from February 20, 2021, and data on deceased and hospitalized starting from March 8, 2021, i.e. 15 days later, presuming that the deaths and hospitalizations between these dates were still related to the previous wave of the pandemic.
Our model is conceived so that we look at the current data every day, and according to these data estimate the probable future numbers of deaths and hospitalized.
Let (t i , n i , d i , h i ) , i = 1, . . . , m , be the pandemic data available on the day t m . In order to test our method, we divide this data into two parts: the training data (t i , n i , d i , h i ) , i = 1, . . . , T , and the testing data (t i , n i , d i , h i ) , i = T + 1, . . . , m . The training data will be used to estimate the optimal parameters, and the testing data to evaluate the accuracy of our method.
Forecasting the number of deceased. Using our data, it turned out that the estimated numbers of deceased in the period [T, T +τ ] closely followed the numbers of actual deaths for almost every T > 50 . The relevant calculations using the supplied software (see "Data and computer code availability") were carried out for every T ∈ [50, 75] (April 10 through May 5). The average delay τ for such T's was 12.84 with standard deviation 1.77, and the proportion of the deceased among new cases τ days earlier was 1.74% on average, with standard deviation 0.08.
As an illustration we first consider training data in the period of progressive growth of new cases with T = T 1 := 55 , i.e. April 15 (see the first dashed vertical line in Fig. 2a).
The optimal parameters (a ⋆ 1 , b ⋆ 1 , c ⋆ 1 ) of the logistic model function will be determined using the training data (t i , N i ) , i = 1, . . . , T 1 , of the cumulative numbers of new cases, while the optimal parameters u ⋆ 1 , α ⋆ 1 and τ ⋆ 1 defining the function ϕ given by (4), will be determined using the training data (t i , d i ) , i = κ, . . . , T 1 , for the deceased during the same period, by solving the GOP (5). The obtained results are shown in Table 1.
Using the testing data for the deceased, the same table shows the number of actual deaths during τ 1 = ⌊τ ⋆ 1 ⌉ = 17 days starting on April 16, and the number predicted by the formula (6). Note that for this 17-day period the prediction differs little from the actual number of deceased. Furthermore, the proportion of deceased among new cases from 17 days earlier is α ⋆ 1 ≈ 2% (see Table 1). Figure 2a shows the graph of the model function ϕ given by (4) (blue curve), where the function was determined beforehand as the logistic model function for the cumulative number of new cases. The red dots represent the actual daily numbers of deaths during the first 17 days after April 15 (732 deaths in total). Visualized are also the 90% , 95% , and 99% confidence bands for the fit of the function ϕ , justifying the obtained results. The vertical dashed lines bound the range of data between T and [T +τ ]. www.nature.com/scientificreports/ In a similar way we will analyze the training data in a period which includes the beginning of decrease of numbers of new cases with T = T 2 := 65 , i.e. April 25 (see the first dashed vertical line in Fig. 2b). The optimal parameters (a ⋆ 2 , b ⋆ 2 , c ⋆ 2 ) of the logistic model functions in this case, as well as the parameters u ⋆ 2 , α ⋆ 2 , τ ⋆ 2 of the corresponding function ϕ are also shown in Table 1.
Using the testing data for the deceased, the same table shows the number of actual deaths during τ 2 = ⌊τ ⋆ 2 ⌉ = 11 days starting on April 26, and the number predicted by the formula (6). Furthermore, the proportion of deceased among new cases from eleven days earlier is α ⋆ 2 ≈ 1.7%. Figure 2b shows the graph of the model function ϕ , where the function was determined as before. The red dots represent the actual daily numbers of deaths during the first eleven days after April 25 (483 deaths in total). Visualized are also the 90% , 95% , and 99% confidence bands for the fit of the function ϕ , justifying the obtained results.
Forecasting the number of hospitalized persons. The parameters of the model function (8) will be determined based on the training data (t i , N i ) , i = 1, . . . T , of cumulative numbers of new cases. After that, the optimal parameters u ⋆ , v ⋆ , and δ ⋆ of the model function ψ which, according to formula (8), relate the number of hospitalized to the number of new cases, will be estimated by solving the GOP (9) based on the training data (t i , h i ) , i = κ, . . . , T , of hospitalized persons. This GOP will again be solved as was described in Remark 1. In this way one obtains numbers predicting the numbers of hospitalized for the next δ days starting with day t T+1 . These numbers have to be compared with numbers of actually hospitalized during the same period. This comparison can be carried out using various measures, see e.g. Ref. 35 , and we will use the Mean Absolute Percentage Error (MAPE).
Applying the aforementioned software, described later in "Data and computer code availability", to our data for T ∈ [45, 75] (April 5 through May 5), shows that for T ≥ 48 the MAPE ≤ 10% , inferring that the forecast is acceptable. Delays drop from 21, and after T = 62 stabilize at 11.
As an illustration, similarly as in "Forecasting the number of deceased", we first consider training data in the period of progressive growth of new cases with T = T 1 := 50 (April 10), and then the training data in a period which includes the beginning of decrease of numbers of new cases with T = T 2 := 70 (April 30).
The optimal parameters of the logistic model function for the cumulative number of new cases for T = T 1 := 50 are a ⋆ = 86231.7 , b ⋆ = 45.49 , and c ⋆ = 0.085 . Solving the GOP (9) for T = T 1 := 50 we obtain the optimal parameters u ⋆ 1 = 638.94 , v ⋆ 1 = 0.900 , and δ ⋆ 1 = 17.35 of the model function ψ given by (8), and therefore the average delay equals δ 1 = 17 . Figure 3a shows the graph of the model function ψ (blue curve). Red dots represent the actual numbers of hospitalized during the 17-day period following April 10. Visualized are also 90% , 95% , and 99% confidence bands for the fit of the function ψ , justifying the obtained results. The measure MAPE = 3% infers a high degree of agreement between our forecast and the actual number of hospitalized during the 17-day period from April 11 to April 28, which is also visible in Fig. 3a. The maximum of the derivative ψ ′ is, according to (12), reached on April 7, and its null point is on April 22 (see Fig. 3b). This means   www.nature.com/scientificreports/ we obtain the optimal parameters u ⋆ 2 = 557.34 , v ⋆ 2 = 0.758 , δ ⋆ 2 = 10.71 , and the average delay is δ 2 = 11 . The measure MAPE = 3.0% infers a high degree of agreement between our forecast and the actual numbers during the 11-day period starting on April 30, which is also visible in Fig. 4a. The maximum of the derivative ψ ′ is reached on April 7, and its null point is on April 25 (see Fig. 4b), meaning that until April 7 the growth of the number hospitalized is progressive, then until April 25 digressive, and after April 25 the number of hospitalized drops.

Conclusions
In our paper we propose a phenomenological model for forecasting the number of deaths and hospitalizations in a pandemic wave, assuming that the number of deaths linearly depends, with a certain delay τ > 0 , on the number of new cases, and similarly, that the number of hospitalizations linearly depends on the number of new cases with another delay δ > 0 . The predictions should be carried out every day using daily data on new cases, deaths and hospitalized from the beginning of the pandemic wave. For this purpose we devised dedicated Mathematica notebooks, freely available at http:// models. mathos. unios. hr/.
The method is tested and illustrated using data on the third wave of the COVID-19 pandemic in Croatia, but the method can be applied to any new wave of the COVID-19 pandemic, as well as to any other possible pandemic.
In the meantime, since the first version of this paper was written, numerous results appeared where various authors dealt with the same problem differently (see e.g. Refs. 1,11,[18][19][20]. The basic strength of our approach is its simplicity based on our previous work [21][22][23]29 , and using efficient numerical methods for finding optimal parameters of the model (see Remark 1), which is also based on our previous work. Besides daily data on deaths and hospitalized, our model uses data on confirmed infected cases. But provided that a good method for detecting or some other way for coming up with actual numbers of infected persons were found, the data on confirmed cases in our model could easily be replaced by the data on actually infected, making the predictions equally simple and fast, but considerably more accurate and reliable. Our model could be enhanced by using also the vaccination data.  www.nature.com/scientificreports/

Data and computer code availability
All evaluations were done using our own Mathematica modules Dead[] and Hospitalized[], freely available at http:// models. mathos. unios. hr/. Both modules call the data set Data.txt, also available at this url, containing the numbers of new cases, deceased, and hospitalized during the third wave of the COVID-19 pandemic in Croatia. The module Dead[] outputs the forecast for cumulative numbers of deceased for the next τ days and the proportion of deceased among cases reported τ days earlier (see "Forecasting the number of deceased"). The results are given for the logistic and Gompertz model functions. The module can also output the following: • the bar charts of the new cases and of the deceased; • optimal parameters of the corresponding logistic and Gompertz model functions of cumulative numbers of new cases, their graphs, characteristic points and saturation levels, see Refs. 22,23 ; • optimal parameters of the relating function ϕ given by (4), its graph, confidence bands for the fit, characteristic points and the proportion of the deceased using the logistic and Gompertz model functions; The module Hospitalized[] outputs the forecast for numbers of hospitalized during the next δ days (see "Forecasting the number of hospitalized"). The results are given using the logistic model function. Additionally, the module can also output the following: • the bar charts of the new cases and of the hospitalized; • optimal parameters of the logistic model function of cumulative numbers of new cases, its graph, and the characteristic points, see Ref. 22 ; • optimal parameters u ⋆ , v ⋆ , and δ ⋆ of the relating function ψ given by (8), its graph, confidence bands for the fit, and the characteristic points; • the value of MAPE.