{'fraction_non_alphanumeric': 0.026897627629243102, 'fraction_numerical': 0.018774544085211686, 'mean_word_length': 4.40406976744186, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Time Series Analysis and Correlation of Subway Turnstile Usage and COVID-19 Prevalence in New York City

In this paper, we show a strong correlation between turnstile usage data of the New York City subway provided by the Metropolitan Transport Authority of New York City and COVID-19 deaths and cases reported by the New York City Department of Health. The turnstile usage data not only indicate the usage of the city's subway but also people's activity that promoted the large prevalence of COVID-19 city dwellers experienced from March to May of 2020. While this correlation is apparent, no proof has been provided before. Here we demonstrate this correlation through the application of a long short-term memory neural network. We show that the correlation of COVID-19 prevalence and deaths considers the incubation and symptomatic phases on reported deaths. Having established this correlation, we estimate the dates when the number of COVID-19 deaths and cases would approach zero after the reported number of deaths were decreasing by using the Auto-Regressive Integrated Moving Average model. We also estimate the dates when the first cases and deaths occurred by back-tracing the data sets and compare them to the reported dates.


Introduction
New York City (NYC) has been the locus of a major prevalence of coronavirus disease 2019 , caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), in early 2020 [1]. Many people have been hospitalized and also many have lost their lives to this disease. It is not clear when the first cases occurred in the city but the numbers of cases and deaths in the city peaked in mid April 2020 [2]. This pandemic has also brought and continues to bring economical hardship to city dwellers and people worldwide, especially those in the lowest economical strata [3]. Measures taken to contain the spreading of SARS-CoV-2 including social distancing, business shut-downs, and shelter-in-place have significant impact on the economy [4], as up to the time of writing this paper no vaccine or other contagion control method has been developed. Essential workers often have higher risks of exposure to the virus because of the lack of options of working from home.
As city dwellers mainly rely on public transportation, and more notably the subway, to move around, it is expected that a highly contagious virus such as SARS-CoV-2 would easily spread through the fabric of NYC population. It is expected that a crowded NYC subway, as an enclosed environment and a major indicator of people's mobility, would be directly correlated with spreading of SARS-CoV-2.
While the NYC subway was expected to be a major vehicle for the transmission of COVID-19 in NYC in early 2020 [5], the correlation between the subway ridership and COVID-19 prevalence and deaths has not been presented until now. In this paper, we show this correlation on the public turnstile usage data of NYC subway provided by the NYC Metropolitan Transportation Authority (MTA) [6] and the statistics of the confirmed COVID-19 cases and deaths provided by the NYC Department of Health (DOH) [7].
There is a large number of prediction models for the COVID-19 pandemic [8]- [24]. Much of the literature focuses on modeling the prevalence of COVID-19 in different countries and partially enclosed environments, such as cruise ships [8], [11]- [16]. These models use local and regional data to examine the correlation of COVID-19 cases with environmental or social factors. Some models forecast the number of COVID-19 cases according to the population size [18], [22], [25]. Other models estimate the impact of the use of public transit and others study the contagion by airborne transmission [9], [10].
Our analysis leverages on the reported number of deaths for an accurate correlation because the reported number of cases are known to have large errors caused by the lack of testing and possible asymptomatic cases.
In this analysis, we employ long short-term memory (LSTM) neural network for analyzing time series data to: 1) show the correlation between NYC subway turnstile (entry) data and COVID-19 deaths and cases, and Auto-Regressive Integrated Moving Average (ARIMA) to both 2) predict the dates when COVID-19 deaths would approach zero, according to the reported data, and 3) estimate the time when the contagion started in NYC by identifying the dates when the first cases and the first deaths occurred through analysis of the provided data. We compare the estimated dates with the reported dates.
The analysis performed in this paper uses exclusively the mentioned public datasets, and other factors that are not included in the analyzed dataset may have affected the actual counts of cases and deaths. For example, the data analyzed in this paper was recorded while no face coverings were widely considered.
The remainder of this paper is organized as follows. Section 2 describes the models used in this paper for data analysis. Section 3 describes the obtained results. Section 4 provides a discussion and remaining questions. Section 5 presents our conclusions.

Model Description
In this section, we present the data sources and analysis tools used in this paper.

Datasets
The NYC DOH dataset reports the first COVID-19 case on February 29, 2020 and the first death on March 11, 2020. The MTA turnstile usage data [6] includes the number of subway entries and exits per station in NYC, recorded hourly each day. The total number of stations in the dataset is 379. We calculate the average daily entries of NYC subway stations per day for our analysis. We also use the number of daily cases and deaths of the COVID-19 dataset published by the NYC DOH [7].
We consider that there is an incubation and symptomatic period for people who lost their lives to COVID-19. We consider those periods as features to analyze the correlation of the studied data. We call these feature day-shifted subway entries. Shifted here means subway entries from days prior to the reported death's date. This is, for a given day t 0 , the turnstile usage is denoted as x t0 and the turnstile entry of m days before t 0 is denoted as x t0−m . We use x t0 and x t0−m as features to predict the number of deaths and cases for day t 0 , where 1 ≤ m ≤ 25. We use 20% of the NYC DOH data as test data for validation and the rest for training in our analysis.

Forecasting Models
To analyze the turnstile usage data and its correlation to COVID-19 deaths and cases, we use linear regression and LSTM. Linear regression is a statistical method for finding the relationship between a dependent variable and independent variables or features [26]. In this paper, we use a linear regression model with L1 regularization to find the precedence of features. We adopt multiple linear regression with x j independent variables. The estimated valueŷ in the linear regression model follows: where β j represents the model weights or regression coefficients and ε is the residuals error. L1 regularization is equal to the absolute sum of the model weights multiplied by a shrinkage value (λ). L1 regularization is formulated as λ j |β j | and the regression model goal is to minimize: where y i is the actual data point and x ij is the value of the independent variables for each data point. LSTM is a recurrent neural network (RNN) model [27] capable of learning both recent sequences of inputs and historical data. LSTM is mainly used to model time-series data to learn the time evolution of sequences of data [28]. We use a SavitzkyGolay filter to smooth out the prediction results from LSTM [29].
The ARIMA model is used to forecast the time-series data [30]. ARIMA consists of three models: auto-regressive (AR), integration, and moving average (MA). It uses three hyper parameters: p, d, and q, where p is the order of autoregressive model, d is the degree of difference, and q is the order of moving average [30]. The ARIMA(p, d, q) equation is defined as where α is the coefficient of discrete time linear equation of AR, L is a time lag operator defined as LX t = X t−1 , X t is the observed value at time t, β is the coefficient for the noise term, ε, in MA [31].

Performance Metrics
The performance of the prediction models is evaluated using R 2 score, mean absolute error (MAE), and root mean square error (RMSE). Coefficient of determination or R 2 score is the proportion of variation explained by independent variables [26]. R 2 score is calculated as where SS R is the residual sum of squares and SS T is the total sum of squares. SS R is calculated as where y i are the actual values andŷ i are the predicted values. SS T is calculated as where y i is the actual value andȳ is the mean of actual values. R 2 shows the variance of residuals (or prediction errors) in the predicted data points divided by the variance of data points from the average of all data points. R 2 represents the performance of a model as compared to randomly guessed predictions that are equal to the average of all data. The closer R 2 is to 1, the predictions are closer to the actual values. MAE is defined as the average of sum of residuals, or where n is the number of observations. When MAE is close to 0, the model has a high accuracy in predicting data points. We use MAE to measure the training and validation losses of LSTM. If training loss is significantly lower than validation loss, the model is overfitting the training data, which means the model is learning complex patterns of training data that may not generalize in predicting unseen test data and it results in poor performance. If validation loss is significantly lower than training loss, the model is underfitting the training data, which means that the model is unable to learn important patterns of the training data, and it results in poor performance of the model. As the training progresses if the losses grow apart, then we should stop the training and improve the model to avoid overfitting and underfitting [32]. RMSE is defined as In other words, RMSE is the standard deviation of residuals. With normally distributed data points, one can expect 68% of predicted points to be with one RMSE from the mean and 95% to be within two RMSE from the mean of the actual data. Figure 1 shows the average number of subway station entries and the reported number of COVID-19 deaths and cases each day starting from March 1, 2020 to May 15, 2020. The figure shows that the number of deaths peaked on April 7, 2020 before it started to decline. The number of cases peaked on April 6, 2020. The trend of the deaths curve trails the cases curve with a few days delay between March 15, 2020 to April 15, 2020. To find the correlation between NYC subway turnstile entries data and the number of reported COVID-19 deaths, we start from present day's turnstile usage data and then move it backwards m days and use the historical data from the previous days to find the correlation between the number of COVID-19 deaths and subway entries. Figure 2 shows the calculated R 2 score in each test. The x-axis represents the independent variables of each test. For example, 1 shifted day (one day prior) in this figure shows the R 2 score obtained by the linear regression model for the turnstile usage of a single day and one day prior as a feature and the corresponding number of deaths reported on that day. The y-axis shows the R 2 score of the regression model between COVID-19 deaths on day t 0 and the subway entries on days t 0 and t 0 − m. We calculated R 2 score for 0 ≤ m ≤ 25, where we use the turnstile usage of prior 25 days.
From the R 2 scores shown in Figure 2, we looked into those shifted days with high R 2 scores as candidates for features. We tested different combinations and the ones that produced the lowest MAE were selected. These selections are shown in Table 1.
Feature set A consists of subway entries of the current day and 14 days prior (i.e., with one shifted-day data; that with the largest R 2 ). Feature set B consists of subway entries of the current day, 13, and 14 days prior (i.e., feature with two shifted-day data). Feature set C consists of subway entries of current day, 10, 12, 13, 14, and 17 days prior (i.e., feature with five shifted-day data, those with the highest R 2 s). Feature set D adds two new features to Feature set C: the difference between subway entries of prior 8 and 13 days and that of prior 13 and 18 days (i.e., feature with two shifted days and difference from Friday to Monday for a weekly difference). We added these two new features with the speculation that changes in average subway ridership from Friday to Monday may also be indicators of trends. Feature set E includes shifted days with high R 2 but also shorter shifted days that have large R 2 (i.e., short and average incubation/symptomatic periods). Feature set F includes the combinations of the current date and prior-day data of up to 25 days (i.e., it includes all considered incubation/symptomatic periods in this paper that once they are added are 1 to 25 days). This set is selected for completeness and as a reference.

Correlation between NYC Subway Usage and the Number of COVID-19 Deaths
We applied the feature sets described in Table 1 to LSTM to predict the number of deaths and cases. We compared the predicted number of deaths and cases using different features with the actual reported data. Figures 3(a)  and 3(b) show the MAE and the prediction of the number of deaths, respectively, of the LSTM model with Feature set A. The R 2 score for Feature set A is 0.36 and the RMSE is 78.06. Figures 3(c) and 3(d) show the results for Feature set F. These results show that Feature set F produces the most accurate prediction with an R 2 score of 0.96 and an RMSE of 25.66. These two features show the best and worst performance of the predictions, as shown in Table 2. This table summarizes the R 2 scores and the RMSEs for Feature sets A -F for deaths and cases.
We also used Feature sets A-F to predict the number of cases. Figure 4(a) shows the MAE and training and validation losses for feature set A. Here, the validation loss is slightly higher than the training loss. But both losses become steady after 100 epochs. The LSTM predictions on Feature set A (Figure 4(b)) follow the trend of the actual data. However, the predicted cases are less accurate than the predicted deaths because the reported cases are not accurate enough as compared to the reported deaths. The R 2 score on test data is 0.49 and the RMSE for all predicted data points is 851.85, which explains the observed discrepancies. Figure  4(c) shows the training and validation losses of LSTM predicting number of cases by using Feature set F. Here, both losses are lower than those with Feature set A, which shows the high performance of LSTM in predicting cases. Additionally, the LSTM prediction in Figure 4(d) follows the actual data closely. Table 2 also summarizes the R 2 scores and RMSE for each feature set. We observe a higher R 2 score does not necessarily lead to a more accurate prediction results as indicated in the cases prediction. The RMSEs for the case predictions are much higher than that of the deaths predictions. This further confirms the lack of accuracy in the reported cases.

Estimation of Trends and Dates of Minimum Cases and Deaths
We use ARIMA analysis on the number of deaths to find the estimated date that the number of deaths in NYC reached zero. Figure 5(a) shows that on May 16, 2020, the lower band of 95% confidence interval of forecasts reaches zero. However, the upper bound does not cross zero value. That trend seems to indicate that the number of deaths could also grow again. Figure 5(c) shows the ARIMA forecast of the progression of the number of COVID-19 cases in NYC after May 15, 2020. The forecast follows the decreasing trend of the number of cases. The red arrow here shows the date that the upper band of 95% confidence interval crosses zero.
To find origin date of the first case in NYC, we used ARIMA to forecast the trend of COVID-19 cases in reverse  chronological order, as Figure 5(d) shows. The lower and upper band of 95% confidence interval of ARIMA forecast shows that the first case of COVID-19 in NYC may have occurred between January 28, 2020 and February 24. Table 3 shows the first reported COVID-19 cases (Feb. 29, 2020) and deaths (Mar. 11, 2020) in NYC DOH dataset.

Discussion
The reporting of cases has been affected by the deployment and execution of testing for SARS-CoV-2. The effective and widespread testing offers better identification of the cases and their locations. But because of the limitation of testing capabilities at the beginning of the pandemic, the reported COVID-19 cases may not be accurate enough for modeling and thus resulting in larger errors. Therefore, the reported deaths data have been used to forecast and estimate  the correlation between subway usage and the reported numbers of cases and deaths in this paper. The estimations performed with ARIMA are based on the provided data with no additional information. The discrepancies on the estimated dates and the reported dates are the product of the model using solely past data.
Public health suggestions on the use of face covering and social distancing are not considered in the models to reflect the multi-variant effects in linear regression. The use of face covering at some point can lead to different results. Comparisons of NYC data with those of other cities that experienced an early face-covering measure is of interest for 'DWHV 1XPEHURIGHDWKV 'HDWKV )RUHFDVW FRQILGHQFHLQWHUYDO forecasting future prevalence or containment of the spread of this virus.

Conclusions
We used data on the NYC subway turnstile usage published by the Metropolitan Transportation Authority of New York City during the heavy prevalence of COVID-19 in the city and the data of confirmed cases and deaths reported by NYC Department of Health to investigate their correlation.
Here, we show that by considering different incubationsymptomatic periods for subway users after traveling by subway as features, there is a strong correlation between the reported number of COVID-19 deaths and the number of NYC subway passengers through long short-term memory analysis for the first time. We have also shown that the ARIMA model can predict the dates when the numbers of deaths and cases are reduced to zero and estimate the possible dates of when the first case and death occurred at the beginning of the pandemic in NYC. This analysis is performed by using the reported cases and deaths data.