{'fraction_non_alphanumeric': 0.024791260528929267, 'fraction_numerical': 0.019200353109942253, 'mean_word_length': 4.957055214723926, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A systematic framework for spatiotemporal modelling of COVID-19 disease

Spatiotemporal modelling of infectious diseases such as COVID-19 involves using a variety of epidemiological metrics such as regional proportion of cases or regional positivity rates. Although observing their changes over time is critical to estimate the regional disease burden, the dynamical properties of these measures as well as cross-relationships are not systematically explained. Here we provide a spatiotemporal framework composed of six commonly used and newly constructed epidemiological metrics and conduct a case study evaluation. We introduce a refined risk model that is biased neither by the differences in population sizes nor by the spatial heterogeneity of testing. In particular, the proposed methodology is useful for the unbiased identification of time periods with elevated COVID-19 risk, without sensitivity to spatial heterogeneity of neither population nor testing. Our results also provide insights regarding regional prioritization of testing and the consequences of potential synchronization of epidemics between regions.


Introduction
COVID-19 disease is caused by the novel coronavirus SARS-CoV-2 which was first discovered in late 2019 in Wuhan, Hubei Province, China. The main signs of infection include respiratory symptoms, fever, cough and breathing difficulties 1 . Spatiotemporal analysis plays a critical role in estimating the disease burden in specific regions 2 , and it has been studied in many countries, including China 3,4 , Spain 5 , Italy 6,7 , Israel 8 , Brazil 9 and United States 10,11 . It is important to note that comparisons between regions may be challenging, and this is not only because of differences in population sizes but also differences in health policies (e.g. testing regimes) that can change over time 10 . Indeed, one of the most common limitations raised when using spatiotemporal approaches relates to the lack of incorporation of the spatial heterogeneity of testing [12][13][14] . This omission may be misleading to public health officials in terms of an adequate public health response in regions with relatively high or low testing capabilities. From among many measures applicable in the spatiotemporal modelling of the COVID-19 disease, the following attracted the greatest attention: local 6 and global 15 cumulative number of cases, different versions of population-based relative risk (observed cases/expected cases) 13,16 , testing rates (tests/population) 17 , local 17 and global 15 positivity rates (confirmed cases/tests) 17,18 and population-based positivity (confirmed cases/population) 14,18 . Although potentially useful, the above measures were not investigated for their suitability in dynamical modelling of infectious disease. In particular, to the best of our knowledge, their dynamical properties and crossrelationships were not systematically explained. However, this has crucial importance for guiding the public health response: for example, it may be decided that an uninterrupted increase in cumulative version of population-based relative risk 13 entails the introduction of specific non-pharmaceutical interventions (NPIs) 19 in specific regions. Moreover, from the definition of these measures it follows that all of them are sensitive to spatial heterogeneity of either population or testing or both in their identification of elevated COVID-19, leading to bias.
This study is intended to offer a systematic contribution regarding a variety of spatiotemporal epidemiological measures independently used in both comparative 13,17,18 and non-comparative 15 contexts. We reveal dynamical properties and prove relationships between the commonly used and newly constructed epidemiological metrics with a case study application. The proposed methodology has the potential to enhance the framework of infectious disease modelling and provides insights into how a more harmonized management of the crisis can be achieved.

Simultaneous standardisation with respect to population and testing
The notion of relative risk is often used to investigate the spatial distribution of cases 16,20,21 and is inherently related to the concept of indirect standardisation 21 . It involves calculating the standardised incidence ratio (SIR) which accounts for the differences in population sizes among regions. Typically, this value depends on individual daily infection rates and is calculated as the ratio between the observed number of cases (infections) in a region and the expected number of cases based on the regional population. Values greater than one suggest an elevated risk compared to the population average which may indicate infection clusters or a greater number of vulnerable groups 16 . To alleviate the impact of daily fluctuations and create a framework for comparing the present state with historical reference, a cumulative model can be applied 13 , which we refer to as the cumulative standardised incidence ratio (CSIR). It is calculated for a specific day as the ratio of the confirmed number of cases since the outbreak of the pandemic, including day , to the expected cumulative number of cases on day . We mathematically show that from a dynamical viewpoint it is equivalent to the regional cumulative proportion of cases; that is, for a specific day and region , it may decrease or increase depending on whether the proportion of cases for on day is lower or greater than the cumulative proportion for on day − 1. The limitation of using this risk estimate to compare regions is that it is only unbiased if there is spatial homogeneity regarding testing intensity. To overcome this problem, we first applied an analogous procedure for the data related to regional testing. Namely, we calculated a quantity that we refer to as the cumulative standardised testability ratio (CSTR). It is calculated as the proportion of observed tests to expected tests in a given region. It is important to note that the resulting value can be interpreted as an estimate of the relative safety. This is because the greater the quantity is, the more efficiently NPIs can be applied. We then divided the CSIR by the CSTR to get a refined estimate of the relative risk, which we call the weighted cumulative standardized incidence ratio (WCSIR). It follows that the WCSIR remains unchanged from the CSIR only if the CSTR is equal to one, that is, the number of tests is equal to the expected number of tests. Otherwise, the relative risk increases or decreases depending on whether the CSTR is smaller than or greater than one, respectively. The resulting risk estimate is therefore biased neither by differences in population sizes nor by differences in amount of testing in specific regions. In other words, the WCSIR measure allows testing intensity to be heterogeneous and we mathematically prove that it captures the change in relative risk by honouring the following expectations: 1) For a specific region, a risk measure should decrease if the regional infection rate (regional infected/global infected) decreases and the analogous test rate (regional tests/global tests) increases.
2) For a specific region, a risk measure should decrease if the cumulative global positivity rate (GPR) (cumulative positive/cumulative tests) increases, while the analogous local positivity rate (LPR) decreases.
As such, we anticipate our study to be a starting point for considering more sophisticated models of relative risk. For example, even if the dynamics of the regional proportion of cases show a positive trend for a given region, our methodology can classify this region as one with decreasing risk if the local and global positivity ratios are in opposite directions (i.e. are decreasing and increasing respectively).

Case study motivation
On March 4 th , 2020, the first confirmed case was registered in Poland 22 . Four days later, cases were identified in the densely populated Silesian region 23 . As of August 17, 2020, 57,286 cases were verified in Poland, with 18,874 cases (34.8%) attributed to the Silesian region 24 . The core of the Silesian region is referred to as the Katowice conurbation, a polycentric area consisting of 16 towns and approximately 2 million people with a population density of 1,485 per km 2 (24). The largest urban centre is Katowice with 280 thousand inhabitants 25 . The concentration of public health efforts in Silesia follows from its large proportion of the population employed in industry (28.7%), compared to the mean-country value of 20.6%. Of those employed in industry in the area, 16.7% are employed in mining and exploration, which is also the largest value in Poland (mean-country value of 4.6 %) 26 .
After the first case in Poland was identified, NPIs were introduced, including cancelling mass events and closing borders, schools, and universities among other measures 27,28 . These interventions helped flatten the curve of total infected individuals and delayed the peak of the disease burden (Fig. 1). However, the lockdown measures applied were ultimately insufficient in terms of containing the spread of the disease in the densely populated and relatively industrially oriented Silesian region. Because it is difficult to apply social distancing recommendations 1 in crowded mine shafts, it is hypothesized that the spread of COVID-19 in the Silesian region was facilitated by miners who might have acted as asymptomatic carriers. This has critical importance as it has been demonstrated that asymptomatic carriers play a vital role in the spread of the novel coronavirus 29 and undocumented infectious cases can facilitate rapid dissemination 30 . Indeed, according to partial results related to 50,053 screening tests within a group of mines conducted between May 7, 2020 and June 25, 2020 as a proxy for the whole mining population, nearly 98 percent of the infected mine employees did not indicate any symptoms 31,32 . As of August 11, 7,934 miners were tested positive for COVID-19 which yields nearly 44% of infections in Silesian region 33 . Although the time period related to screening tests in mines resulted in greater population-based relative risk for Silesia, two major problems remain: 1) whether the decision on screening tests was a result of an already deteriorating epidemiological situation in Silesiawith the beginning of this deterioration being unknown and 2) whether in other regions with relatively low testing capabilities the risk related to COVID-19 disease exists but is undetected.
We evaluated the proposed methodology on infection and testing rates that were provided by

Unweighted risk
The SIR analysis reveals that in the Silesian region (12 KAT) the relative risk values were largely greater than one since mid-April and on five days in late April and early May this value was greater than 3, all before the decision to screen for COVID-19 in mines ( Fig. 2A). In the 28 days after implementation of this testing policy, SIR values were always greater than 3, with maximum value 6.92 on May 12 th and fluctuations between 4 and 6. However, greater than expected number of cases since mid-April suggest that the outbreak might have originated earlier than the decision to test miners. Indeed, CSIR curves show a rising trend prior to the decision to implement screening tests in mines in Silesia largely after the Easter holiday (Fig.   2B). The nearly monotonously rising trajectory of both CSIR between mid-April and mid-June denotes the progressive relative deterioration of the epidemiological situation in Silesia for this time period.

Weighted risk
However, as discussed above, the estimates of relative risks presented in Fig. 2 are biased by the regional differences in testing intensity. Figure 3 shows that throughout the epidemic the highest testing intensity was observed for the Warszawa region (7 WAR), with lowest positions occupied by the Opole (8 OPO) and Rzeszów (9 RZE) regions.
According to the WCSIR model ( Fig. 4; Fig. 5 lowest part) the Opole region (8 OPO) was the least safe region during the height of the epidemic in Poland (11)(12)(13)(14)(15)(16)(17)(18), and at the end of the study period occupies second position, with a significant distance to the third ranked Rzeszów region (9 RZE). Although positive differences between CSIR and WCSIR for both Silesia (12 KAT) and Opole (8 OPO) can be observed (Figs. 4,5), for the Silesia region this difference is smaller and the corresponding curves are more or less parallel (Fig. 4). This is not the case for the Opole region, whose CSIR and WCSIR curves show a greater difference and a diverging pattern in mid-May: while the WCSIR was increasing during May 13-18 with a simultaneous decrease in CSTR, an increase in CSIR was observed only between  This means that the weighted risk estimate may increase even if the unweighted risk decreases.

Dynamical patterns
A more comprehensive analysis of the relationship between cumulative measures (CSTR, CSIR, WCSIR and the LPR-GPR tandem (Fig. 6)) can be conducted by plotting daily values of two selected measures on a Cartesian plane (Figs. 7-10, Supplementary Figs. 2-4). In summary of all sixteen regions, we highlighted six potentially distinct trajectories that emerged. Fig. 7A shows the ideal situation when CSIR and WCSIR decrease together throughout the period, as exemplified by the Wrocław region (1 WRO). This pattern can be summarised that although sometimes CSTR is increasing, the CSIR is decreasing (Fig. 8A). The second pattern for Warszawa (7 WAR) region shows that the decreasing value of CSIR is associated with an increasing value of WCSIR and LPR (Figs. 7B, 9B). The trajectory of the Opole region (8 OPO) region represents the third pattern: while the CSIR was approximately constant, the WCSIR was rising fast (Fig. 7C), confirming the divergent pattern in mid-May observed in Figure 4.
We note however that the LPR and WCSIR show a decreasing trend since June (Figs. 7C, 9C) in Opole region. Figure 7D shows the fourth pattern with an undesireable change of the trajectory of the relationship, as typified by the Rzeszów region (9 RZE) since mid-June. For Silesia (12 KAT) (Fig. 7E) we observe the fifth pattern of a plateau in the relationship after initial growth of CSIR and WCSIR. This may be due to largely decreasing LPR since June when it reached a maximum value of 10.25% (Fig. 6)

Discussion
In this article, we highlighted the properties and relationships between commonly used and newly constructed epidemiological measures applicable in spatiotemporal infectious disease relative risk modelling. We stressed the role of including information on testing intensity in estimating the relative risks of COVID-19 infection, with a case study in Poland. The weighted approach is particularly useful when spatial homogeneity in testing intensity cannot be assumed, which was the case in our example. For instance, as of August 17, the Warszawa region was tested nearly 4.5 times more intensely (CSTR=1.66) than the Rzeszów region (CSTR=0.37). Given these disproportions, inferring the epidemic dynamics from the confirmed number of cases is not justified 34 . We also show the official statements regarding the Silesia region as the most tested (CSTR never greater than 1, as of August 17) 35 , the epidemiologically safest region 36 , or epidemiologically unexceptional (both CSIR and WCSIR>1) 37 to be false.
The refined results could be utilized by authorities and health crisis managers to introduce more integrated NPI policies for adjacent regions that can be epidemiologically synchronized 38,39 . In our case, the similarity between WCSIR values and relatively high positivity rates throughout the study period suggest that this synchronization may be the case for the Opole and Silesia regions. As of now in these regions, differences in organising public gatherings remain: for example in the Opole region, church authorities allowed the organisation of city-wide processions at the Feast of Corpus Christi (June 11) 40 , whereas in Silesia mass gatherings of this kind were forbidden 41 . Because public gatherings played a vital role in the spread of the 1918 influenza pandemic 19,42 , it is now necessary to stress the significance of the joint effect of testing and infection rates to prevent downplaying the epidemiological risk in poorly tested regions.
We moreover illustrated that incorporating the historical data for calculating the relative risk can be beneficial to better identify time periods related to investigated trends. Using a cumulative model of relative risk, we demonstrate that systematic growth in infections already started in mid-April, three weeks before the decision to implement screening tests in mines in Silesia. This is particularly concerning as the lack of screening tests at the time of potentially greater, yet unknown, mobility corresponding to Easter may have facilitated the local spread of the disease among these mostly asymptomatic and thus undetected carriers. We note however that the epidemiological deterioration did not affect all mines equally and it was highly variable throughout the study period: while at the end of June the positivity ratio calculated for a group of several mines did not exceed 4% (1,862 confirmed cases/50,053 tests) 32 , one month later a screening test conducted for one mine from this group revealed about 35% population-based positivity (156 confirmed cases/452 employees) 43 . Surprisingly, the systematic deterioration and highest positivity ratio in May for Silesia coincides with a temporal concentration of increase in one particular mine in which the population-based positivity increased from about 5% (245/4,982 employees, as of May 14) to 28% (as of May 24), to 33% (as of July 29).
The investigation of COVID-19 spread in similar conditions was already carried out in the densely populated region of Buenos Aires with 13 million inhabitants in 41 districts 44 . This research was based on analysing anonymized mobile phones and it revealed that the spread of the disease was radial in nature: from the central city of Buenos Aires, through the suburban districts, to the neighbouring regions. There are however two major differences underlying the spread of the disease in Buenos Aires versus the Silesian region. While the first difference is related to a very specific spatial structure of the Silesian region, the second points at the greater role of industry rather than population density in the spread of the disease. Other studies have likewise shown that population density 14,45 , age structure 14 , and socioeconomic status 10,18,46 among other variables affect COVID-19 transmission patterns, but this study adds knowledge regarding how the area's relative dominance in an economic sector can play a role in the transmission. We note however that the mining industry should be only regarded as a proxy of the infectious potential of large industrial plants and indeed similar events were registered in other regions (e.g. in 15 POZ region in meat-processing company in early August -313 confirmed cases/800 employees) 47 . Given these plants may attract employees from more distant localities, they have the potential to synchronize the epidemics at the sub-regional level, sometimes trespassing the administrative borders of a higher level 39 . Therefore, particular attention should be paid if this synchronization may be the case for administrative regions with different testing capabilities.
The main limitation of this study follows from the incompleteness of official data related to testing data that are publicly available only since May 11 th (see details in Methods). For the time period between March 26 and May 11, the results of weighting approaches and positivity ratios are estimated with greater uncertainty and we urge more caution in interpreting estimates at the beginning of the time period. The confirmed yet unexplained underreporting for Silesia resulting in about an 8% (as of July 9) underestimate of cases as well as limited reliability of testing data for Kielce region 48 poses additional interpretation difficulties 49 . An additional limitation is that there may be other unknown differences in testing regimes influencing the results. For example, poorly tested regions may decide that only very suspicious cases will be tested which will result in a relatively high positivity ratio 15 . We also did not include information on recovered individuals, defined as those with two subsequent negative tests 50 which underestimates the positivity ratios for the time period in which the number of recovered increases. It should also be stressed that the theorem regarding the dynamics of WCSIR has the form of an implication, so one is not allowed to establish a causal relationship between a decrease of WCSIR and either of the alternatives in the implication given.
Because testing capabilities are always limited, the obtained results after weighting could also be used to consider regional prioritization in the availability of tests. For example, from Table   1 it could be inferred that the following regions are in particular need for increasing the intensity of testing: Opole (8 OPO: + 170.53%) and Rzeszów (9 RZE: + 171.41%). A more meaningful analysis of testing capabilities should however always involve the temporal aspect (Fig. 3) and the relationship between the epidemiological indices that we proposed and developed throughout time (Figs. 7-10, Supplementary Figs. 2-4). Therefore, we support calls for the radical increase in the identification of positive cases and accompanying isolation as well as encourage behavioural changes and increase awareness of the disease to help reduce the spread of COVID-19 30,51 . We also believe that this method holds promise to guide efforts in countries without a robust health care infrastructure and to counter a misinterpretation of the perception of a high relative risk in densely tested areas compared to areas with low apparent relative risk due to limited testing availability, when in fact a high risk of COVID-19 may simply be undetected.

Materials
We collected daily data on infections in Poland starting March 4, 2020 until August 17, 2020 from the Ministry of Health in Poland. From a technical viewpoint, the data are stored in a data frame in which columns represent days, while rows are administrative regions. A limitation of using this data is that reporting inaccuracies were not always adequately described. Although we applied 18 corrections, sometimes the dates corresponding to false positive cases or detected duplicates of confirmed cases were not provided. The inaccuracies and the corresponding metadata including dates of errors and applied corrections are summarised in Supplementary   Table 1.
The data on regional testing are available for the time period between March 26, 2020 and August 17, 2020. The reports from May 11, 2020 onward were provided by the Ministry of Health in Poland on a weekly basis in the form of cumulative number of tests conducted for every region. It should be noted, however, that these cumulative data do not include the full day of publishing but are restricted to a specific hour of the day. For example, cumulative regional data on testing published on August 17 cover the time period between March 4 and August 17, 1:00 p.m. We also used official fragmentary reports as well as an unofficial incomplete report for March 26, 2020 from a news source (Supplementary Table 2). For days preceding March 26, 2020 no data on regional testing are publicly available, therefore we excluded this period from the analysis. There is concern about limited reliability of testing data for Kielce region for which about 241 000 tests were erroneously registered 52 . Although the correction was applied on August 8 52 , the historical data were not officially corrected. We therefore subtracted the superfluous number of tests evenly throughout the time period for the Kielce region. Population census data were obtained from the official repository Demographic Yearbook of Poland 53 .

Estimating relative risk
To estimate the relative risk in regions of interest we used the concept of indirect standardisation 20,21 . The general formula for estimating the relative risk can be written as follows: , where and denote the observed and the expected number of cases respectively.
Given a specific region , to obtain it is first necessary to calculate a global ratio = For the CSIR, we assume that, for a specific day , the observed number of cases in region is the sum of the observed number of cases in for days ∈ [1, ]. Similarly, to calculate the corresponding ratio we assume that the observed number of cases is the sum of all cases that From this it follows that the current value of CSIR is to a large extent governed by the past (cumulative cases from days 1 up to − 1) and the contribution of present day weakens with time. This explains why the curves are smooth: the present has a smaller effect than the past.
To sum up, the past contributes primarily to the present state and, with time, its role in shaping the present increases.
Similarly, the information on the number of tests conducted for each region can be employed to estimate the relative safety (not to be confused with the safety perspective presented in Supplementary Fig. 5). The corresponding Cumulative Standardised Testability Ratio (CSTR) was calculated in an analogous procedure to that of the CSIR. If we denote , −1 as the cumulative number of tests conducted for region up to day − 1, , as the number of tests conducted for on day and = 1000. Then, to obtain the approximate value of CSTRs for individual days, relrisk function was used. We note that the assumption of constant intercept may not be realistic but we are not ready to commit to the idea of the best interpolation method in case of differences in temporal resolution between data on infections and testing. To avoid edge-effects that are inherent for the interpolation method, statistical approaches including bestfitting curves could be employed. However, the main disadvantage of the statistical procedure is that one cannot expect that the official data of cumulative number of tests will be honoured at nodes.
From a methodological viewpoint, we note that the curves presented here could also be viewed as a measure of relative safety in the form of 1 . This safety perspective provides a better visualization of regions with lowest values of relative risk that in the CSIR or WCSIR models are difficult to distinguish ( Supplementary Fig. 5).
Local and global positivity ratios (LPR and GPR) Because the relationship between local and global dynamics of the cumulative proportion of positive cases exerts influence on the dynamics of WCSIR, we provide formulas for these measures: , The computational objectives corresponding to functions included in the computer code are summarised in Table 2. We used the following R packages: dplyr 54 , ggplot2 55 , Then, ). (30) Assuming that condition ( ) holds, we get: which is equivalent to Assuming that condition ( ) holds, we get: