1 Introduction

The number of daily infections has been used by policymakers to determine whether current policies should be strengthened or mitigated. The ultimate goal of COVID-19 policy is to reduce the number of daily deaths due to COVID-19 without weakening economic activity. Therefore, the policy performance should be daily evaluated for updating the current policy. However, the traditional tools that predict the number of people infected (cases) each day do not provide a good indicator for policymakers because the number will not be correct unless every person is tested multiple times each day.

R, the reproduction number with the number of cases has been used by many policymakers worldwide (Kucharski 2020; Zhang et al. 2020; Caicedo-Ochoa 2022). R is the average number of people who contract a disease and are subsequently infected (David Adam 2020). Therefore, R is an imprecise estimate that rests on assumptions (David Adam 2020; Maruotti et al. 2021; Shaw and Kennedy 2021).

This paper proposes a good indicator of the pandemic by the number of daily deaths instead of the number of cases. The number of daily deaths due to COVID-19 is a really good indicator for policymakers (Takefuji 2021). However, the average lag between daily COVID-19 cases and deaths was 8 days (Jin 2021).

This paper presents a new open-source tool, dailydeath that can serve as a good indicator for policymakers by predicting the number of daily deaths for the next seven days. When using the proposed tool, policymakers need to consider an eight-day lag with a standard deviation of 4 days (Jin 2021).

The Python program, deathdaily can generate a graph of a country on the number of daily deaths due to COVID-19 where it is composed of two lines: a black colored line as true number and a blue colored line for prediction with nth-degree polynomial regression. The legend in the generated graph contains important parameters: the country name, the number of days to be used for prediction, the nth-degree polynomial regression, and R-squared (r2). r2 is commonly used as a statistical measure of how close the data is to the fitted regression line.

The prediction from the latest day of data to 7 days ahead using historical data is based on a curve fitting function. The curve fitting function requires two determinants, the size of the data (number of days) and the "n" of the nth degree polynomial regression.

The latest data on daily death is automatically scraped and downloaded from the following jhu web site: https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/jhu/new_deaths.csv

The user needs to provide three determinants to the deathdaily tool: the name of the country, the size of the data (days), and the "n" of the nth degree polynomial. The higher the degree polynomial, the better the curve fitting will be. However, curve overfitting does not necessarily mean good prediction. The proposed deathdaily can show the trend of daily deaths in the very near future by the user changing the size of days and the nth degree polynomial. The user is allowed to change three determinants to observe the calculated prediction.

R-squared (r2) can let you know if n in an nth order polynomial should be smaller or not. The data size can also affect the curve fitting of the polynomial regression. Due to the nature of curve fitting, data from the most recent days may have a stronger impact on prediction than data from older days. The larger the data size and the smaller the polynomial degree, the more underfitting the prediction. Conversely, the smaller the data size and the larger the polynomial degree, the more the prediction is overfitting. This is the result of prediction using two determinants, data size and polynomial degree, and validation is up to the user. There is no automated algorithm for finding the optimal determinants. If an automated algorithm existed, future states could be predicted.

Deathdaily is available in public and can be easily installed by the PyPI package. According to PyPI stats with https://pepy.tech/project/deathdaily, the deathdaily has been downloaded by 15,964 users worldwide. This fact shows that its applicability and usefulness was justified.

2 Deathdaily

According to PYPL (2022) and TIOBE (2022), Python is the best open-source development language. The proposed deathdaily is written in Python. The deathdaily.py program consists of two modules: one that scrapes the Internet for the most recent data set on the number of daily deaths, and another with an nth-degree polynomial regression given to predict the number of daily deaths for the next 7 days.

In statistics, polynomial regression is a form of regression analysis that models the relationship between an independent variable x and a dependent variable y as an nth degree polynomial in x. Polynomial regression is commonly used to observe trends and tendencies in a variety of applications(Zhang and Jiang 2021; Lee et al. 2011; Liu et al. 2019; Davies et al. 2021). In deathdaily.py as shown in Fig. 1, polynomial regression is implemented by polyfit function and poly1d function in numpy library (np):

Fig. 1
figure 1

Deathdaily.py Python program

model = np.poly1d(np.polyfit(x[valid],y[valid],degree)).

np.poly1d is a one-dimensional polynomial class. The nth-degree polynomial regression model can be built. The prediction y can be given by y = model(x) where x is an independent variable as shown in Fig. 1.

For r-squared calculation, sklearn.metrics library is used where r2_score function can give the value of r-squared as shown in Fig. 1.

from sklearn.metrics import r2_score

In the data preprocessing, the new_deaths.csv file contains an erroneous minus sign (-), so we remove the minus signs with the following Python commands:

sp.call("cat new_deaths.csv|sed '2,$s/,-/,/g' > new",shell = True).

sp.call("mv new new_deaths.csv",shell = True).

data = pd.read_csv("new_deaths.csv").

3 Results of running deathdaily

Dataset new_deaths.csv on daily deaths due to COVID-19 can be scraped from the following site: https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/jhu/new_deaths.csv

In order to run deathdaily, you must install it by the following PyPI packaging command:

$ pip install deathdaily

The author picked countries such as Germany, the US, France, and the UK to justify the proposed claim.

Then, run deathdaily

$ deathdaily Germany 200 5

The above command is to produce a graph of Germany using 200 days from the executed day with the 5th-degree polynomial regression.

Figure 2 shows the result on Germany. Germany is observed to be in the midst of resurgence. Germany is 68.9% fully vaccinated as of Dec.6, 2021.

Fig. 2
figure 2

Result with deathdaily Germany 2005

Figure 3 shows the strong resurgence in the US. Figure 3 was generated by the following command:

Fig. 3
figure 3

Result with deathdaily ‘United States’ 2005

$ deathdaily ‘United States’ 2005

The US is 59.9% fully vaccinated as of Dec.6, 2021. The pandemic situation in the US is getting worse.

Figure 4 shows that France is observed to be in the midst of resurgence with 70.2% fully vaccinated.

Fig. 4
figure 4

Result with deathdaily France 2005

Figure 5 depict that the UK is observed to be in the midst of resurgence with 69.2% fully vaccinated.

Fig. 5
figure 5

Result with deathdaily ‘United Kingdom’ 2008

4 Discussion

The number of daily deaths due to COVID-19 clearly shows the pandemic situation. We need to use deathdaily to detect symptoms of resurgence. The proposed program is not only easy to install by PyPI packaging, but also provides the number of daily deaths in a country and its forecast for the week ahead. Although investigated countries except the US with 59.9% are near 70% fully vaccinated as of Dec.6, 2021, symptoms of resurgence are observed in vaccinated countries. Policymakers should be able to determine whether the current policy should be strengthened or updated. Or they should challenge a new policy with excellent countries suppressing the pandemic such as New Zealand, Taiwan, Australia, South Korea, and Iceland (Takefuji 2021a). These countries use digital fences for isolating infected carriers from uninfected individuals. Scoring individual policies is reported for poor policymakers to learn the good strategies from the excellent countries (Takefuji 2021b).

5 Conclusion

The proposed deathdaily is currently used by 15,964 users in the world and the first open-source software for predicting the number of daily deaths in a country. Using the deathdaily, symptoms of resurgence were observed in vaccinated countries. Policymakers should be able to determine whether the current policy should be strengthened or mitigated. Or they should challenge a new policy with excellent countries suppressing the pandemic such as New Zealand and Taiwan.

The higher the number of cases, the higher the number of deaths. In the future, the number of daily cases can be used to improve the prediction quality of deathdaily.