# A Review of Spatiotemporal Models for Count Data in R Packages. A Case Study of COVID-19 Data

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

## 2. Methodology

#### 2.1. The COVID-19 Dataset: Description and Cleasing

#### 2.2. Models

#### 2.2.1. Endemic-Epidemic Models. R Package Surveillance

#### Forecast

#### 2.2.2. Multivariate Covariance Generalized Linear Models. R Package Mcglm

#### Forecasting

#### 2.2.3. Bayesian Hierarchical Generalized Linear Models. Carst Package

#### Forecasting

## 3. Application

#### 3.1. Endemic-Epidemic Models

- Model 1:$$\begin{array}{ccc}\hfill {\mu}_{kt}& =& {e}_{k}{\nu}_{kt}+{\lambda}_{kt}{Y}_{k,t-1}+{\varphi}_{kt}\sum _{q\ne k}{w}_{qk}{Y}_{q,t-1},\phantom{\rule{4pt}{0ex}}\phantom{\rule{4pt}{0ex}}\phantom{\rule{4pt}{0ex}}\phantom{\rule{4pt}{0ex}}{\nu}_{kt},{\lambda}_{k},{\varphi}_{k}>0,\hfill \\ \hfill log({\nu}_{kt})& =& {\alpha}^{\nu}+{\beta}_{1}^{\nu}{x}_{kt},\phantom{\rule{4.pt}{0ex}}\forall k\hfill \\ \hfill log({\lambda}_{kt})& =& {\alpha}^{\lambda},\phantom{\rule{4.pt}{0ex}}\forall t,k\hfill \\ \hfill log({\varphi}_{kt})& =& {\alpha}^{\varphi},\forall k,t\hfill \\ \hfill {w}_{qk}& =& I(q\sim k).\hfill \end{array}$$

- Model 2:$$\begin{array}{ccc}\hfill {\mu}_{kt}& =& {e}_{k}{\nu}_{kt}+{\lambda}_{kt}{Y}_{k,t-1}+{\varphi}_{kt}\sum _{q\ne k}{w}_{qk}{Y}_{q,t-1},\phantom{\rule{4pt}{0ex}}\phantom{\rule{4pt}{0ex}}\phantom{\rule{4pt}{0ex}}\phantom{\rule{4pt}{0ex}}{\nu}_{kt},{\lambda}_{k},{\varphi}_{k}>0,\hfill \\ \hfill log({\nu}_{kt})& =& {\alpha}_{k}^{\nu}+{\beta}_{1}^{\nu}{x}_{kt},\phantom{\rule{4.pt}{0ex}}\forall k\hfill \\ \hfill log({\lambda}_{kt})& =& {\alpha}^{\lambda},\phantom{\rule{4.pt}{0ex}}\forall t,k\hfill \\ \hfill log({\varphi}_{kt})& =& {\alpha}_{k}^{\varphi},\forall t\hfill \\ \hfill {w}_{qk}& =& I(q\sim k).\hfill \end{array}$$

#### 3.2. Multivariate Covariance Generalized Linear Models

#### 3.3. Bayesian Spatiotemporal Models

## 4. Discussion

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Besag, J.; Higdon, D. Bayesian analysis of agricultural field experiments. J. R. Stat. Soc. Ser. B
**1999**, 61, 691–746. [Google Scholar] [CrossRef] - Paradinas, I.; Conesa, D.; López-Quílez, A.; Bellido, J.M. Spatio-temporal model structures with shared components for semi-continuous species distribution modelling. Spat. Stat.
**2017**, 22, 434–450. [Google Scholar] [CrossRef] - Gusev, A. Temporal structure of the global sequence of volcanic eruptions: Order clustering and intermittent discharge rate. Phys. Earth Planet. Inter.
**2008**, 166, 203–218. [Google Scholar] [CrossRef] - Law, J.; Quick, M.; Chan, P. Bayesian spatio-temporal modeling for analysing local patterns of crime over time at the small-area level. J. Quant. Criminol.
**2014**, 30, 57–78. [Google Scholar] [CrossRef] - Choi, J.; Lawson, A.B.; Cai, B.; Hossain, M.M. Evaluation of Bayesian spatiotemporal latent models in small area health data. Environmetrics
**2011**, 22, 1008–1022. [Google Scholar] [CrossRef] [Green Version] - Gómez-Rubio, V.; Palmí-Perales, F.; López-Abente, G.; Ramis-Prieto, R.; Fernández-Navarro, P. Bayesian joint spatio-temporal analysis of multiple diseases. SORT-Stat. Oper. Res. Trans.
**2019**, 43, 51–74. [Google Scholar] - Nelder, J.A.; Wedderburn, R.W. Generalized linear models. J. R. Stat. Soc. Ser.
**1972**, 135, 370–384. [Google Scholar] [CrossRef] - Anselin, L. Local indicators of spatial association—LISA. Geogr. Anal.
**1995**, 27, 93–115. [Google Scholar] [CrossRef] - Hardisty, F.; Klippel, A. Analysing spatio-temporal autocorrelation with LISTA-Viz. Int. J. Geogr. Inf. Sci.
**2010**, 24, 1515–1526. [Google Scholar] [CrossRef] - Cressie, N.; Wikle, C.K. Statistics for Spatio-Temporal Data; John Wiley & Sons: Hoboken, NJ, USA, 2015. [Google Scholar]
- Wikle, C.K.; Zammit-Mangion, A.; Cressie, N. Spatio-Temporal Statistics with R; CRC Press: Boca Raton, FL, USA, 2019. [Google Scholar]
- Anderson, C.; Ryan, L.M. A comparison of spatio-temporal disease mapping approaches including an application to ischaemic heart disease in New South Wales, Australia. Int. J. Environ. Res. Public Health
**2017**, 14, 146. [Google Scholar] [CrossRef] [Green Version] - World Health Organization Coronavirus (COVID-19) Dashboard. Available online: https://covid19.who.int/ (accessed on 1 June 2021).
- Kermack, W.O.; McKendrick, A.G. A contribution to the mathematical theory of epidemics. Proc. R. Soc. Lond. A
**1927**, 115, 700–721. [Google Scholar] [CrossRef] [Green Version] - Fang, Y.; Nie, Y.; Penny, M. Transmission dynamics of the COVID-19 outbreak and effectiveness of government interventions: A data-driven analysis. J. Med. Virol.
**2020**, 92, 645–659. [Google Scholar] [CrossRef] [Green Version] - Kucharski, A.J.; Russell, T.W.; Diamond, C.; Liu, Y.; Edmunds, J.; Funk, S.; Eggo, R.M.; Sun, F.; Jit, M.; Munday, J.D.; et al. Early dynamics of transmission and control of COVID-19: A mathematical modelling study. Lancet Infect. Dis.
**2020**. [Google Scholar] [CrossRef] [Green Version] - Tang, B.; Wang, X.; Li, Q.; Bragazzi, N.L.; Tang, S.; Xiao, Y.; Wu, J. Estimation of the transmission risk of the 2019-nCoV and its implication for public health interventions. J. Clin. Med.
**2020**, 9, 462. [Google Scholar] [CrossRef] [Green Version] - Guirao, A. The Covid-19 outbreak in Spain. A simple dynamics model, some lessons, and a theoretical framework for control response. Infect. Dis. Model.
**2020**, 5, 652–669. [Google Scholar] [CrossRef] - López, L.; Rodo, X. A modified SEIR model to predict the COVID-19 outbreak in Spain and Italy: Simulating control scenarios and multi-scale epidemics. Results Phys.
**2021**, 21, 103746. [Google Scholar] [CrossRef] - Aràndiga, F.; Baeza, A.; Cordero-Carrión, I.; Donat, R.; Martí, M.C.; Mulet, P.; Yáñez, D.F. A Spatial-Temporal Model for the Evolution of the COVID-19 Pandemic in Spain Including Mobility. Mathematics
**2020**, 8, 1677. [Google Scholar] [CrossRef] - Fronterre, C.; Read, J.M.; Rowlingson, B.; Bridgen, J.; Alderton, S.; Diggle, P.J.; Jewell, C.P. COVID-19 in England: Spatial patterns and regional outbreaks. medRxiv
**2020**. [Google Scholar] [CrossRef] - Dunbar, M.B.N.; Held, L. Endemic-Epidemic framework used in COVID-19 modelling. REVSTAT Stat. J.
**2020**, 18, 565–574. [Google Scholar] - Berger, J.O. Statistical Decision Theory and Bayesian Analysis; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2013. [Google Scholar]
- Lawson, A.B. Bayesian Disease Mapping: Hierarchical Modeling in Spatial Epidemiology; CRC Press: Boca Raton, FL, USA, 2018. [Google Scholar] [CrossRef]
- Liang, K.Y.; Zeger, S.L. Longitudinal data analysis using generalized linear models. Biometrika
**1986**, 73, 13–22. [Google Scholar] [CrossRef] - Meyer, S.; Held, L.; Höhle, M. hhh4: Endemic-epidemic modeling of areal count time series. J. Stat. Softw.
**2017**, 77, 1–55. [Google Scholar] - Bonat, W.H. Multiple response variables regression models in R: The mcglm package. J. Stat. Softw.
**2018**, 84. [Google Scholar] [CrossRef] - Lee, D.; Rushworth, A.; Napier, G. Spatio-temporal areal unit modelling in R with conditional autoregressive priors using the CARBayesST package. J. Stat. Softw.
**2018**, 84. [Google Scholar] [CrossRef] [Green Version] - Elhorst, J.P. Dynamic spatial panels: Models, methods, and inferences. J. Geogr. Syst.
**2012**, 14, 5–28. [Google Scholar] [CrossRef] - Liesenfeld, R.; Richard, J.F.; Vogler, J. Likelihood-Based Inference and Prediction in Spatio-Temporal Panel Count Models for Urban Crimes. J. Appl. Econom.
**2017**, 32, 600–620. [Google Scholar] [CrossRef] [Green Version] - Martín, B.; Onrubia, A.; González-Arias, J.; Vicente-Vírseda, J.A. Citizen science for predicting spatio-temporal patterns in seabird abundance during migration. PloS ONE
**2020**, 15, e0236631. [Google Scholar] [CrossRef] - Augustin, N.H.; Borchers, D.L.; Clarke, E.D.; Buckland, S.T.; Walsh, M. Spatiotemporal modelling for the annual egg production method of stock assessment using generalized additive models. Can. J. Fish. Aquat. Sci.
**1998**, 55, 2608–2621. [Google Scholar] [CrossRef] - Beare, D.J.; Reid, D.G. Investigating spatio-temporal change in spawning activity by Atlantic mackerel between 1977 and 1998 using generalized additive models. ICES J. Mar. Sci.
**2002**, 59, 711–724. [Google Scholar] [CrossRef] [Green Version] - Smith, A.; Hofner, B.; Lamb, J.S.; Osenkowski, J.; Allison, T.; Sadoti, G.; McWilliams, S.R.; Paton, P. Modeling spatiotemporal abundance of mobile wildlife in highly variable environments using boosted GAMLSS hurdle models. Ecol. Evol.
**2019**, 9, 2346–2364. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Knorr-Held, L. Bayesian modelling of inseparable space-time variation in disease risk. Stat. Med.
**2000**, 19, 2555–2567. [Google Scholar] [CrossRef] [Green Version] - Ugarte, M.; Goicoa, T.; Militino, A. Spatio-temporal modeling of mortality risks using penalized splines. Environ. Off. J. Int. Environ. Soc.
**2010**, 21, 270–289. [Google Scholar] [CrossRef] - Bauer, C.; Wakefield, J.; Rue, H.; Self, S.; Feng, Z.; Wang, Y. Bayesian penalized spline models for the analysis of spatio-temporal count data. Stat. Med.
**2016**, 35, 1848–1865. [Google Scholar] [CrossRef] - GVA. Portal de Dades Obertes. Available online: https://dadesobertes.gva.es/es/dataset (accessed on 1 June 2021).
- Held, L.; Höhle, M.; Hofmann, M. A statistical framework for the analysis of multivariate infectious disease surveillance counts. Stat. Model.
**2005**, 5, 187–199. [Google Scholar] [CrossRef] [Green Version] - Paul, M.; Held, L. Predictive assessment of a non-linear random effects model for multivariate time series of infectious disease counts. Stat. Med.
**2011**, 30, 1118–1136. [Google Scholar] [CrossRef] - Meyer, S.; Held, L. Power-law models for infectious disease spread. Ann. Appl. Stat.
**2014**, 8, 1612–1639. [Google Scholar] [CrossRef] [Green Version] - Held, L.; Paul, M. Modeling seasonality in space-time infectious disease surveillance data. Biom. J.
**2012**, 54, 824–843. [Google Scholar] [CrossRef] - Bauer, C.; Wakefield, J. Stratified space–time infectious disease modelling, with an application to hand, foot and mouth disease in China. J. R. Stat. Soc. Ser. C
**2018**, 67, 1379–1398. [Google Scholar] [CrossRef] - Cheng, Q.; Lu, X.; Wu, J.T.; Liu, Z.; Huang, J. Analysis of heterogeneous dengue transmission in Guangdong in 2014 with multivariate time series model. Sci. Rep.
**2016**, 6, 33755. [Google Scholar] [CrossRef] [Green Version] - Bracher, J. hhh4underreporting. R Package. 2019. Available online: https://github.com/jbracher/hhh4underreporting (accessed on 1 June 2021).
- Bracher, J. hhh4addon: Extending the Functionality of Surveillance: hhh4. R Package. 2019. Available online: https://github.com/jbracher/hhh4addon (accessed on 1 June 2021).
- Bracher, J.; Held, L. Periodically stationary multivariate autoregressive models. arXiv
**2017**, arXiv:1707.04635. [Google Scholar] - Meyer, S.; Held, L. Incorporating social contact data in spatio-temporal models for infectious disease spread. Biostatistics
**2017**, 18, 338–351. [Google Scholar] [CrossRef] - Bracher, J. hhh4contacts: Age-Structured Spatio-Temporal Models for Infectious Disease Counts. R Package. 2019. Available online: https://github.com/cran/hhh4contacts (accessed on 1 June 2021).
- Gneiting, T. Making and evaluating point forecasts. J. Am. Stat. Assoc.
**2011**, 106, 746–762. [Google Scholar] [CrossRef] [Green Version] - Wei, W.; Held, L. Calibration tests for count data. Test
**2014**, 23, 787–805. [Google Scholar] [CrossRef] - Bonat, W.; Jørgensen, B. Multivariate covariance generalized linear models. J. R. Stat. Soc. Ser. C
**2016**, 65, 649–675. [Google Scholar] [CrossRef] [Green Version] - Martinez-Beneito, M.A. A general modelling framework for multivariate disease mapping. Biometrika
**2013**, 100, 539–553. [Google Scholar] [CrossRef] - Jørgensen, B.; Kokonendji, C.C. Discrete dispersion models and their Tweedie asymptotics. AStA Adv. Stat. Anal.
**2016**, 100, 43–78. [Google Scholar] [CrossRef] [Green Version] - Jørgensen, B.; Knudsen, S.J. Parameter orthogonality and bias adjustment for estimating functions. Scand. J. Stat.
**2004**, 31, 93–114. [Google Scholar] [CrossRef] - Lunn, D.; Spiegelhalter, D.; Thomas, A.; Best, N. The BUGS project: Evolution, critique and future directions. Stat. Med.
**2009**, 28, 3049–3067. [Google Scholar] [CrossRef] - Rue, H.; Martino, S.; Chopin, N. Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations. J. R. Stat. Soc. Ser. B
**2009**, 71, 319–392. [Google Scholar] [CrossRef] - Lee, D. A tutorial on spatio-temporal disease risk modelling in R using Markov chain Monte Carlo simulation and the CARBayesST package. Spat. Spatio-Temporal Epidemiol.
**2020**, 34, 100353. [Google Scholar] [CrossRef] - Polo, G.; Acosta, C.M.; Soler-Tovar, D.; Villamil, J.F.P.; Palencia, N.P.; Penagos, M.; Martinez, J.M.; Bobadilla, J.N.; Martin, L.V.; Durán, S.; et al. Bayesian Spatio-Temporal Modeling of COVID-19: Inequalities on Case-Fatality Risk. medRxiv
**2020**. [Google Scholar] [CrossRef] - Bernardinelli, L.; Clayton, D.; Pascutto, C.; Montomoli, C.; Ghislandi, M.; Songini, M. Bayesian analysis of space–time variation in disease risk. Stat. Med.
**1995**, 14, 2433–2443. [Google Scholar] [CrossRef] - Napier, G.; Lee, D.; Robertson, C.; Lawson, A.; Pollock, K.G. A model to estimate the impact of changes in MMR vaccine uptake on inequalities in measles susceptibility in Scotland. Stat. Methods Med. Res.
**2016**, 25, 1185–1200. [Google Scholar] [CrossRef] [Green Version] - Rushworth, A.; Lee, D.; Mitchell, R. A spatio-temporal model for estimating the long-term effects of air pollution on respiratory hospital admissions in Greater London. Spat. Spatio-Temporal. Epidemiol.
**2014**, 10, 29–38. [Google Scholar] [CrossRef] [Green Version] - Rushworth, A.; Lee, D.; Sarran, C. An adaptive spatiotemporal smoothing model for estimating trends and step changes in disease risk. J. R. Stat. Soc. Ser. C
**2017**, 66, 141–157. [Google Scholar] [CrossRef] [Green Version] - Lee, D.; Lawson, A. Quantifying the spatial inequality and temporal trends in maternal smoking rates in Glasgow. Ann. Appl. Stat.
**2016**, 10, 1427. [Google Scholar] [CrossRef] - Herzog, S.; Paul, M.; Held, L. Heterogeneity in vaccination coverage explains the size and occurrence of measles epidemics in German surveillance data. Epidemiol. Infect.
**2011**, 139, 505–515. [Google Scholar] [CrossRef] [Green Version] - Paul, M.; Held, L.; Toschke, A.M. Multivariate modelling of infectious disease surveillance data. Stat. Med.
**2008**, 27, 6250–6267. [Google Scholar] [CrossRef] - Leroux, B.G.; Lei, X.; Breslow, N. Estimation of disease rates in small areas: A new mixed model for spatial dependence. In Statistical Models in Epidemiology, the Environment, and Clinical Trials; Springer: Berlin/Heidelberg, Germany, 2000; pp. 179–191. [Google Scholar] [CrossRef]
- Held, L.; Meyer, S.; Bracher, J. Probabilistic forecasting in infectious disease epidemiology: The 13th Armitage lecture. Stat. Med.
**2017**, 36, 3443–3460. [Google Scholar] [CrossRef] - Giuliani, D.; Dickson, M.M.; Espa, G.; Santi, F. Modelling and predicting the spatio-temporal spread of Coronavirus disease 2019 (COVID-19) in Italy. BMC Infect. Dis.
**2020**, 20, 700. [Google Scholar] [CrossRef] - Ferstad, J.O.; Gu, A.J.; Lee, R.Y.; Thapa, I.; Shin, A.Y.; Salomon, J.A.; Glynn, P.; Shah, N.H.; Milstein, A.; Schulman, K.; et al. A model to forecast regional demand for COVID-19 related hospital beds. medRxiv
**2020**. [Google Scholar] [CrossRef] [Green Version] - Perone, G. Comparison of ARIMA, ETS, NNAR and hybrid models to forecast the second wave of COVID-19 hospitalizations in Italy. arXiv
**2020**, arXiv:2010.11617. [Google Scholar] [CrossRef] - Reno, C.; Lenzi, J.; Navarra, A.; Barelli, E.; Gori, D.; Lanza, A.; Valentini, R.; Tang, B.; Fantini, M.P. Forecasting COVID-19-associated hospitalizations under different levels of social distancing in Lombardy and Emilia-Romagna, Northern Italy: Results from an extended SEIR compartmental model. J. Clin. Med.
**2020**, 9, 1492. [Google Scholar] [CrossRef] [PubMed] - Goic, M.; Bozanic-Leal, M.S.; Badal, M.; Basso, L.J. COVID-19: Short-term forecast of ICU beds in times of crisis. PLoS ONE
**2021**, 16, e0245272. [Google Scholar] [CrossRef]

**Figure 1.**(

**a**) Valencian Community (red area) in relation to the whole of Spain; (

**b**) The 24 health departments of the Valencian Community included in this analysis and number of habitants (per 100,000 people) per department.

**Figure 2.**Distribution of mean daily incidence (per 100,000 people) in the 24 health departments of the Valencian Community. The mean daily incidence is computed for one week periods: (

**a**) 5–11 July 2020; (

**b**) 20–26 September 2020, and (

**c**) 4–11 December 2020.

**Figure 3.**Temporal trend of COVID-19 for (

**a**) new daily positive cases; (

**b**) daily hospitalizations per health department, where each point represents the data of one of the 24 health departments; (

**c**) incidence of new daily positive cases (number of positives divided by the population size of each department and multiplied by 100,000); (

**d**) incidence of daily hospitalizations; (

**e**) lowess smoothing of the time series: daily positive cases (red) and daily hospitalizations (blue) with a mean confidence interval of 95% (grey); (

**f**) Cross-correlogram, between daily new positives and daily hospitalizations. It shows the Pearson correlation between both series as a function of the displacement (days) of daily positives relative to the daily hospitalizations.

**Figure 4.**Data dependency with respect to the day of the week: (

**a**) Daily positives versus day of the week; (

**b**) daily hospitalizations versus day of the week; (

**c**) mean of daily positives in the last 4 days versus day of the week.

**Figure 5.**Temporal trend of COVID-19 for daily positives (red line) and daily hospitalizations (blue line) in the eight health departments used as an illustration, with a time lag of 9 days in the daily positive cases, and a smoothing of 4 days. The eight health departments have been labeled with consecutive capital letters from (

**A**–

**H**).

**Figure 6.**Temporal trend of the observed values (in blue) jointly with fitted values from model 2.2 (in brown) with their confidence intervals at 95% for forecasts (in green) and fitted values (in orange) for the eight health departmens. The eight health departments have been labeled with consecutive capital letters from (

**A**–

**H**).

**Figure 7.**Observed values (in blue) together with fitted values (in brown) and predictions (in green). The eight health departments have been labeled with consecutive capital letters from (

**A**–

**H**).

**Figure 8.**Fitted and predicted values in brown and green together with the observed counts in blue with the CARadaptative model with both covariates: positive cases at lags of 9 and 5 with their confidence intervals at 95% for fitted values (in orange). The eight health departments have been labeled with consecutive capital letters from (

**A**–

**H**).

ST.CARlinear [60] | Spatially varying linear time trends model |

ST.CARanova [35] | Spatial and temporal autoregressive main |

effects and independent interaction model | |

ST.CARsepspatial [61] | Common temporal trend but varying spatial surfaces model |

ST.CARar [62] | Spatially autocorrelated autoregressive of order 1 time series model |

ST.CARadaptive [63] | Spatially adaptive smoothing model for localized spatial smoothing |

ST.CARlocalized [64] | Spatiotemporal clustering model |

**Table 2.**Estimations, goodness of fit measures and contribution of the endemic and autoregressive components to the global fit. RMSEf is the RMSE of fitted values and RMSEp the RMSE of predictions.

Model 1.1 | Model 1.2 | |||
---|---|---|---|---|

Estimate | Std. Error | Estimate | Std. Error | |

${\alpha}^{\lambda}$ | 0.985 | 0.006 | 0.985 | 0.006 |

${\alpha}^{\varphi}$ | 0.002 | 0.0008 | 0.002 | 0.0008 |

${\alpha}^{\nu}$ | 4.061 | 0.709 | 4.085 | 0.7117 |

${\beta}_{1}$ | 1.019 | 0.003 | 1.005 | 0.019 |

${\beta}_{2}$ | - | - | 1.014 | 0.0153 |

Log-likelihood: | −8559.39 | −8558.74 | ||

AIC: | 17,126.78 | 17,127.48 | ||

BIC: | 17,151.64 | 17,158.56 | ||

RMSEf | 0.54 | 0.53 | ||

RMSEp | 6.13 | 6.18 | ||

endemic | 1.39% | 1.47% | ||

epi.own | 97.28% | 97.21% | ||

epi.neigbors | 1.33% | 1.32% |

Poisson | NegBin1 | NegBinM | |
---|---|---|---|

Log-likelihood: | −8539 | ||

AIC: | 17,177.99 | 31,554.37 | 31,309.46 |

BIC: | 17,488.74 | 31,566.80 | 31,464.84 |

**Table 4.**Goodness of fit measures and contribution of the endemic and autoregressive components to the global fit. RMSEf is the RMSE of fitted values and RMSEp the RMSE of predictions.

Model 2.1 | Model 2.2 | |
---|---|---|

Log-likelihood: | −8539 | −8538.49 |

AIC: | 17,177.99 | 17,178.98 |

BIC: | 17,488.74 | 17,495.94 |

RMSEf | 0.71 | 0.69 |

RMSEp | 5.76 | 5.78 |

endemic | 1.89% | 2.04% |

epi.own | 94.73% | 94.60% |

epi.neigbors | 3.38% | 3.36% |

**Table 5.**Goodness of non-nested models, defined from different matrix linear predictors $h(\Omega ({\tau}_{t}))$.

$\mathit{h}(\mathsf{\Omega}({\mathit{\tau}}_{\mathit{t}}))=$ | |||
---|---|---|---|

${\mathbf{\tau}}_{\mathbf{0}}{\mathbf{I}}_{\mathbf{K}\times \mathbf{K}}$ | ${\mathbf{\tau}}_{\mathbf{0}}{\mathbf{I}}_{\mathbf{K}\times \mathbf{K}}+{\mathbf{\tau}}_{\mathbf{1}}{\mathbf{Z}}_{\mathbf{1}}$ | ${\mathbf{\tau}}_{\mathbf{0}}{\mathbf{I}}_{\mathbf{K}\times \mathbf{K}}+{\mathbf{\tau}}_{\mathbf{1}}{\mathbf{Z}}_{\mathbf{1}}+{\mathbf{\tau}}_{\mathbf{2}}{\mathbf{Z}}_{\mathbf{2}}$ | |

plogLik | −13,540.43 | −10,448.25 | −10,444.49 |

df | 28 | 29 | 30 |

pAIC | 27,136.86 | 20,954.5 | 20,948.98 |

pKLIC | 27,138.46 | 20,958.28 | 20,954.1 |

pBIC | 27,311.06 | 21,134.92 | 21,135.62 |

RMSEf | 13.72 | 13.62 | 11.39 |

RMSEp | 16.46 | 11.77 | 11.6 |

**Table 6.**Deviance information criterion (DIC), effective number of parameters (pd), RMSE of fitted values (RMSEf), and RMSE of predictions (RMSEp) for each model and scenario.

$\mathit{CARar}$ | $\mathit{CARadaptative}$ | |||
---|---|---|---|---|

Case 1 | Case 2 | Case 1 | Case 2 | |

DIC | 18,730.92 | 18,741.31 | 18,671.93 | 18,678.58 |

pd | 793.5918 | 787.9688 | 780.8599 | 770.0481 |

RMSEf | 1.939859 | 2.027429 | 1.970366 | 2.059419 |

RMSEp | 5.610704 | 5.854628 | 5.861029 | 5.402237 |

**Table 7.**Medians of the posterior distribution of each parameter and 95% credible intervals for each model and scenario.

CARar Case 1 | CARar Case 2 | CARadaptative Case 1 | CARadaptative Case 2 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|

Median | 2.5% | 97.5% | Median | 2.5% | 97.5% | Median | 2.5% | 97.5% | Median | 2.5% | 97.5% | |

Intercept | 5.7011 | 5.5108 | 5.7307 | 5.6233 | 5.2602 | 5.6621 | 5.6955 | 5.6223 | 5.7247 | 5.6107 | 5.3673 | 5.6532 |

Posit9 | 0.0022 | 0.0011 | 0.0108 | 0.0027 | 0.0018 | 0.0100 | 0.0022 | 0.0012 | 0.0054 | 0.0028 | 0.0018 | 0.0081 |

Posit5 | - | - | - | 0.0025 | 0.0014 | 0.0097 | - | - | - | 0.0026 | 0.0017 | 0.0075 |

tau2 | 0.0225 | 0.0197 | 0.0313 | 0.0222 | 0.0193 | 0.0313 | 0.0136 | 0.0099 | 0.0206 | 0.0128 | 0.0094 | 0.0198 |

rho.S | 0.9432 | 0.8767 | 0.9591 | 0.9666 | 0.9349 | 0.9784 | 0.9652 | 0.9225 | 0.9774 | 0.9671 | 0.9206 | 0.9792 |

rho.T | 0.9895 | 0.9811 | 0.9949 | 0.9376 | 0.8420 | 0.9548 | 0.9898 | 0.9836 | 0.9952 | 0.9890 | 0.9824 | 0.9946 |

tau2.w | - | - | - | - | - | - | 171.0751 | 98.3797 | 289.3351 | 177.6793 | 104.1783 | 293.4227 |

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 (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Ibañez, M.V.; Martínez-Garcia, M.; Simó, A.
A Review of Spatiotemporal Models for Count Data in R Packages. A Case Study of COVID-19 Data. *Mathematics* **2021**, *9*, 1538.
https://doi.org/10.3390/math9131538

**AMA Style**

Ibañez MV, Martínez-Garcia M, Simó A.
A Review of Spatiotemporal Models for Count Data in R Packages. A Case Study of COVID-19 Data. *Mathematics*. 2021; 9(13):1538.
https://doi.org/10.3390/math9131538

**Chicago/Turabian Style**

Ibañez, Maria Victoria, Marina Martínez-Garcia, and Amelia Simó.
2021. "A Review of Spatiotemporal Models for Count Data in R Packages. A Case Study of COVID-19 Data" *Mathematics* 9, no. 13: 1538.
https://doi.org/10.3390/math9131538