# An Empirical Algorithm for COVID-19 Nowcasting and Short-Term Forecast in Spain: A Kinematic Approach

^{1}

^{2}

^{3}

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

- The number of infections that are occurring today, but will be detected within 14 days. Naturally not all infections that occur now will be registered as cases, but we will have an idea of the current rate of spread of the virus. This nowcast is the one that should help decide which NPIs and restrictions should be adopted immediately.
- The cumulative number of cases that will be recorded within 14 days allows us to deduce, using appropriate ratios, the number of hospital beds, ICU, ventilators, medication, etc., that will be needed in two weeks and the amount of deaths that will occur.

## 2. Empirical Algorithm

- Space (in meters) ≡ cumulative number of cases:$$y=a{x}^{3}+b{x}^{2}+cx+d$$
- Velocity (meters/second) ≡ daily cases:$$\frac{dy}{dx}=v=3a{x}^{2}+2bx+c$$
- Acceleration (meters/second
^{2}) ≡ cases/day^{2}:$$\frac{dy}{d{x}^{2}}=w=6ax+2b$$

- 1.
- On day x, the first predictive equation is calculated, obtaining by linear regression the third-degree polynomial equation that best fits the ${y}^{*}$ values observed for the fourteen values between days ($x-13$) and (x). The coefficients of Equation (2), a, b, c, and d, are obtained. This equation is called the standard equation for day x.
- 2.
- From the standard equation forecast ${\widehat{y}}^{*}$, the values for the days $(x+1),(x+2),\cdots ,$$(x+14)$ are projected. Two alternative predictions are calculated for a pandemic scenario that is worse and better than the standard prediction. These are called the unfavorable prediction and the favorable prediction, respectively. The calculation is performed by applying variations of $\pm 3\%$ to the standard prediction values. Therefore, a range [${\widehat{y}}_{f}^{*}$ - ${\widehat{y}}_{u}^{*}$] is defined. It is worth remarking that the $\pm 3\%$ limit is simply used to calculate the range that imposes the limit that, when trespassed, will require a re-estimation of the model.
- 3.
- 4.
- A new set of predictor equations is calculated in one of these situations:
- (a)
- One observed value ${y}^{*}$ is lower than those of the favorable prediction or exceeds the unfavorable prediction.
- (b)
- During 14 days, the observed values lie in the range [${\widehat{y}}_{f}^{*}$ - ${\widehat{y}}_{u}^{*}$].
- (c)
- One predicted ${y}^{*}$ value is less than the previous day, which denotes a maximum in the equation that would lead to the absurdity that the cumulative number of cases decreases.

- 5.
- The process is restarted in Step 1.

## 3. Data and Results

#### 3.1. The Data

#### 3.2. Prediction Sections Obtained

^{2}).

#### 3.3. Nowcasting and Short-Term Forecasting Results

## 4. Discussion

^{2}, which caused the speed to multiply by 26 in just over two months (the seven day moving average of daily cases went from 326 to 8529). During this period in Spain, there was a notable absence of decisive interventions to stop the second wave, which is most likely reflected in the fact that the data fit the cubic equation very well. It was not until 20 August when the Spanish health authorities recognized that the situation was worrying: “… do not be fooled. If we still allow transmission to continue upwards, we will have many hospitalized, many admitted to the intensive care units (ICU), and many deceased”, declared the director of the Centre for Coordination of Health Alerts and Emergencies of the Spanish Ministry of Health [26].

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Giráldez, F. Por qué los Humanos no Entendimos lo que Estaba Pasando? Available online: comunidaddeloslibros.com (accessed on 20 November 2020).
- BMJ. BMJ Newsroom: UK’s Response to Covid-19 “Too Little, Too Late, Too Flawed”, 15/15/2020; BMJ: London, UK, 2020. [Google Scholar]
- Silv, M. COVID-19: Too little, too late? Lancet
**2020**, 395, 755. [Google Scholar] [CrossRef] - MSF. Poco, Tarde y Mal. El Inaceptable Desamparo de Las Personas Mayores en Las Residencias Durante la COVID-19 en España; Technical Report; Médicos Sin Fronteras: Geneva, Switzerland, 2020. [Google Scholar]
- Johns Hopkins University of Medicine. Animated Maps—Johns Hopkins Coronavirus Resource Center; Johns Hopkins University of Medicine: Baltimore, MD, USA, 2020. [Google Scholar]
- Nicola, M.; Alsafi, Z.; Sohrabi, C.; Kerwan, A.; Al-Jabir, A.; Iosifidis, C.; Agha, M.; Agha, R. The socio-economic implications of the coronavirus pandemic (COVID-19): A review. Int. J. Surg.
**2020**, 78, 185–193. [Google Scholar] [CrossRef] [PubMed] - Baldwin, R.; Mauro, B.W.D. Economics in the Time of COVID-19; Centre for Econnomic Policy Research Press: London, UK, 2020; pp. 105–109. [Google Scholar]
- Eurostat. GDP and Employment Flash Estimates for the Second Quarter of 2020: GDP Down by 12.1% and Employment Down by 2.8% in the Euro Area—Product—Eurostat; Eurostat: Luxembourg, 2020. [Google Scholar]
- Sachs, J.; Schmidt-Traub, G.; Kroll, C.; Lafortune, G.; Fuller, G.; Woelm, F. The Sustainable Development Report. The Sustainable Development Goals and COVID-19; Technical Report; Cambridge University Press: Cambridge, UK, 2020. [Google Scholar]
- Sachs, J.D.; Abdool Karim, S.; Aknin, L.; Allen, J.; Brosbøl, K.; Cuevas Barron, G.; Daszak, P.; Espinosa, M.F.; Gaspar, V.; Gaviria, A.; et al. Lancet COVID-19 Commission Statement on the occasion of the 75th session of the UN General Assembly. Lancet
**2020**, 396, 1102–1124. [Google Scholar] [CrossRef] - Matrajt, L.; Leung, T. Evaluating the Effectiveness of Social Distancing Interventions to Delay or Flatten the Epidemic Curve of Coronavirus Disease. Emerg. Infect. Dis.
**2020**, 26, 1740–1748. [Google Scholar] [CrossRef] - Chaccour, C. COVID-19: Five Contrasting Public Health Responses to the Epidemic. Available online: https://www.isglobal.org/ (accessed on 17 March 2020).
- Lai, S.; Ruktanonchai, N.W.; Zhou, L.; Prosper, O.; Luo, W.; Floyd, J.R.; Wesolowski, A.; Santillana, M.; Zhang, C.; Du, X.; et al. Effect of non-pharmaceutical interventions to contain COVID-19 in China. Nature
**2020**, 585, 410–413. [Google Scholar] [CrossRef] - Orea, L.; Álvarez, I.C. How effective has the Spanish lockdown been to battle COVID-19? A spatial analysis of the coronavirus propagation across provinces. Available online: https://navarra.opennemas.com/media/navarra/files/2020/04/16/dt2020-03.pdf (accessed on 30 December 2020).
- Bank of England. Central Bank Digital Currency. Opportunities, Challenges and Design; Technical Report March; Bank of England: London, UK, 2020. [Google Scholar]
- Schmid, F.; Wang, Y.; Harou, A. Arcimís: Guías Generales Para la Predicción Inmediata: Resumen; Technical Report; AEMET: Madrid, Spain, 2019.
- Kapetanios, G.; Papailias, F. Big Data & Macroeconomic Nowcasting: Methodological Review. In Economic Statistics Centre of Excellence (ESCoE) Discussion Papers; ESCoE: London, UK, 2018. [Google Scholar]
- Bregler, C. Kinematic Motion Models. In Computer Vision; Ikeuchi, K., Ed.; Springer: Boston, MA, USA, 2014; pp. 437–440. [Google Scholar] [CrossRef]
- Vazquez, A. Polynomial Growth in Branching Processes with Diverging Reproductive Number. Phys. Rev. Lett.
**2006**, 96, 038702. [Google Scholar] [CrossRef][Green Version] - Susser, M.; Adelstein, A. An introduction to the work of William Farr. Am. J. Epidemiol.
**1975**, 101, 469–476. [Google Scholar] [CrossRef] - Centro de Coordinación de Alertas y Emergencias Sanitarias. Actualización n° 1 a 211. Enfermedad Por el Coronavirus (COVID-19); Centro de Coordinación de Alertas y Emergencias Sanitarias: Madrid, Spain, 2020. [Google Scholar]
- Gerli, A.; Centanni, S.; Miozzo, M.; Sotgiu, G. Predictive models for COVID-19-related deaths and infections. Int. J. Tuberc. Lung Dis.
**2020**, 24, 647–650. [Google Scholar] [CrossRef] - Sotgiu, G.; Gerli, A.G.; Centanni, S.; Miozzo, M.; Canonica, G.W.; Soriano, J.B.; Virchow, J.C. Advanced forecasting of SARS-CoV-2-related deaths in Italy, Germany, Spain, and New York State. Allergy
**2020**, 75, 1813–1815. [Google Scholar] [CrossRef] - Akhtar, I.U.H. Understanding the CoVID-19 pandemic Curve through statistical approach. medRxiv
**2020**. [Google Scholar] [CrossRef] - Amar, L.A.; Taha, A.A.; Mohamed, M.Y. Prediction of the final size for COVID-19 epidemic using machine learning: A case study of Egypt. Infect. Dis. Model.
**2020**, 5, 622–634. [Google Scholar] [CrossRef] - Fernando Simón Enciende la Alarma: “Las Cosas No Van Bien. Está Fuera de Control en Algunos Puntos”. Available online: https://www.elespanol.com/ (accessed on 20 August 2020).
- Lauer, S.A.; Grantz, K.H.; Bi, Q.; Jones, F.K.; Zheng, Q.; Meredith, H.R.; Azman, A.S.; Reich, N.G.; Lessler, J. The Incubation Period of Coronavirus Disease 2019 (COVID-19) From Publicly Reported Confirmed Cases: Estimation and Application. Ann. Intern. Med.
**2020**, 172, 577–582. [Google Scholar] [CrossRef][Green Version] - Equipo COVID-19. Situación de COVID-19 en España a 16 de Septiembre de 2020, Equipo Covid-19 and RENAVE. Available online: https://www.isciii.es/QueHacemos/Servicios/VigilanciaSaludPublicaRENAVE/EnfermedadesTransmisibles/Paginas/InformesCOVID-19.aspx (accessed on 16 September 2020).
- García-Basteiro, A.; Alvarez-Dardet, C.; Arenas, A.; Bengoa, R.; Borrell, C.; Del Val, M.; Franco, M.; Gea-Sánchez, M.; Otero, J.J.G.; Valcárcel, B.G.L.; et al. The need for an independent evaluation of the COVID-19 response in Spain. Lancet
**2020**. [Google Scholar] [CrossRef]

**Figure 1.**Second pandemic wave in Spain: fit by linear regression of the observed cumulative number of cases to a third-degree polynomial, $y=0.08307{x}^{3}+42.281{x}^{2}-$ 16,584x + 1,524,253 (red curve), from 12 July ($x=140$) to 19 September ($x=210$).

**Figure 2.**Percentages of daily cases out of total weekly cases on each day of the week. Nineteen week averages between 1 June and 11 October (Spain).

**Figure 3.**Cumulative number of cases in Spain from 23 February until 20 September. The arrow marks an inflection point at 15 June, which theoretically separates the two pandemic waves. Data source: Centro de Coordinación de Alertas y Emergencias Sanitarias (CCAES).

**Figure 4.**T-6 predictive segment calculated on 23 August between 10 and 23 August (x = 169 to 182). The black circles represent the 14 values used to obtain the curve ${y}^{*}$ by linear regression. The rhombuses are the observed ${y}^{*}$ values since 24 August. The ${\widehat{y}}_{u}^{*}$ and ${\widehat{y}}_{f}^{*}$ curves were obtained by increasing and reducing the values of ${y}^{*}$ by 3%. The standard equation: ${\widehat{y}}^{*}=-3.658{x}^{3}+$ 2061.89${x}^{2}-$ 380,298.77$x+$ 23,354,382.14; ${R}^{2}=0.9999$.

**Figure 5.**Predictive arcs (red line) calculated from 15 June (x = 113) to 17 October (x = 237). The black circles represent all the observed values of cumulative number of cases for a seven day average.

**Figure 6.**Arrays of observed and forecasted values between 15 June and 17 October (${\widehat{y}}^{*}$ vs. ${y}^{*}$).

**Figure 8.**Favorable and unfavorable scenarios versus observed curve of the seven day average of the cumulative number of cases: ${y}^{*}$ (dashed line), ${\widehat{y}}^{*}$ 14 days (green), and ${\widehat{y}}^{*}$ seven days (red).

**Table 1.**Characteristics of the sections of the standard prediction, using arcs of cubic curves, indicating for each one the date on which it was constructed, the duration in days, the relative error (${e}_{r}$) range, the coefficient of determination (${R}^{2}$), the curvature, the average velocity of propagation (v), and the average acceleration (w).

Section | Date | Days | ${\mathit{\u03f5}}_{\mathit{r}}$ Min | ${\mathit{\u03f5}}_{\mathit{r}}$ Max | ${\mathit{R}}^{2}$ | Curvature | vAverage | wAverage |
---|---|---|---|---|---|---|---|---|

T-1 | 14 June | 14 | −3.21% | −0.05% | 0.9728 | CONCAVE | 968 | 94.4 |

T-2 | 28 June | 14 | −0.05% | 0.39% | 0.9880 | CONVEX | 346 | −3.7 |

T-3 | 12 July | 14 | 0.00% | 1.38% | 0.9994 | CONCAVE | 1082 | 72.7 |

T-4 | 26 July | 14 | −0.37% | 0.38% | 0.9984 | CONCAVE | 2892 | 106.6 |

T-5 | 9 August | 14 | −0.83% | 1.15% | 0.9966 | CONCAVE | 4846 | 90.7 |

T-6 | 23 August | 14 | 0.03% | 3.30% | 0.9984 | CONCAVE-CONVEX | 6893 | −35.4 |

T-7 | 6 September | 13 | 0.08% | 3.38% | 0.9965 | CONVEX | 8078 | −136.8 |

T-8 | 19 September | 14 | −3.29% | 0.06% | 0.9970 | CONCAVE | 12,785 | 276.7 |

T-9 | 3 October | 13 | −0.08% | 3.31% | 0.9937 | CONVEX | 7734 | −219.9 |

Section | Calculation Day | Forecast For: | ${\widehat{\mathit{y}}}^{*}$ | ${\mathit{y}}^{*}$ | ${\mathit{e}}_{\mathit{r}}$ |
---|---|---|---|---|---|

T-1 | 14 June | 21 June | 247,367 | 245,510 | −0.76% |

T-2 | 28 June | 5 July | 250,586 | 250,529 | −0.02% |

T-3 | 12 July | 19 July | 259,508 | 260,450 | 0.36% |

T-4 | 26 July | 2 August | 289,618 | 288,548 | −0.37% |

T-5 | 9 August | 16 August | 344,827 | 342,503 | −0.68% |

T-6 | 23 August | 30 August | 434,097 | 438,028 | 0.90% |

T-7 | 6 September | 13 September | 558,756 | 564,592 | 1.03% |

T-8 | 19 September | 26 September | 708,587 | 704,672 | −0.56% |

T-9 | 3 October | 10 October | 841,119 | 847,748 | 0.78% |

Section | Calculation Day | Forecast For: | ${\widehat{\mathit{y}}}^{*}$ | ${\mathit{y}}^{*}$ | ${\mathit{e}}_{\mathit{r}}$ |
---|---|---|---|---|---|

T-1 | 14 June | 28 June | 256,043 | 248,069 | −3.21% |

T-2 | 28 June | 12 July | 252,933 | 253,917 | 0.39% |

T-3 | 12 July | 26 July | 268,568 | 272,331 | 1.38% |

T-4 | 26 July | 9 August | 312,108 | 313,303 | 0.38% |

T-5 | 9 August | 23 August | 380,721 | 385,135 | 1.15% |

T-6 | 23 August | 6 September | 481,845 | 498,302 | 3.30% |

T-7 | 6 September | 20 September | 612,775 | 638,020 | 3.96% |

T-8 | 19 September | 3 October | 803,787 | 778,216 | −3.29% |

T-9 | 3 October | 17 October | 886,367 | 923,150 | 3.98% |

Date | Observed Cumulative Cases | Nowcasts Cumulative Infections | ||
---|---|---|---|---|

Cumulative Number of Cases | Average 14d Daily Cases | Favorable- Unfavorable | Average 14 Days Daily Infections | |

28 June 2020 | 248,069 | 354 | 245,345–260,450 | −215–1238 |

12 July 2020 | 253,917 | 418 | 260,511–276,626 | 1083–1150 |

26 July 2020 | 272,331 | 1315 | 302,745–321,471 | 3017–3203 |

9 August 2020 | 313,303 | 2927 | 369,300–392,143 | 4754–5048 |

23 August 2020 | 385,135 | 5131 | 467,390–496,301 | 7006–7440 |

6 September 2020 | 498,302 | 8083 | 594,392–631,159 | 7007–9633 |

19 September 2020 | 626,918 | 9187 | 779,674–827,901 | 13,723–14,572 |

3 October 2020 | 778,216 | 10,807 | 859,776–912,958 | 6810–7232 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Orihuel, E.; Sapena, J.; Navarro-Ortiz, J. An Empirical Algorithm for COVID-19 Nowcasting and Short-Term Forecast in Spain: A Kinematic Approach. *Appl. Syst. Innov.* **2021**, *4*, 2.
https://doi.org/10.3390/asi4010002

**AMA Style**

Orihuel E, Sapena J, Navarro-Ortiz J. An Empirical Algorithm for COVID-19 Nowcasting and Short-Term Forecast in Spain: A Kinematic Approach. *Applied System Innovation*. 2021; 4(1):2.
https://doi.org/10.3390/asi4010002

**Chicago/Turabian Style**

Orihuel, Enrique, Juan Sapena, and Josep Navarro-Ortiz. 2021. "An Empirical Algorithm for COVID-19 Nowcasting and Short-Term Forecast in Spain: A Kinematic Approach" *Applied System Innovation* 4, no. 1: 2.
https://doi.org/10.3390/asi4010002