Using Real-Time Google Search Activity to Target Emergency Fiscal Stimulus

May 26, 2023

John Kearns

Abstract

In the aftermath of the COVID-19 pandemic, the U.S. Congress transferred nearly $1 trillion USD to state and local governments between April 2020 and March 2021 to support vaccination efforts, keep schools open, and sustain economic recovery. As of March 2023, much of this money remained unspent, raising questions about the underlying process of determining the size and distribution of aid. This paper explores how Google search data and machine learning models can work in real-time to assist policy makers in evaluating fiscal policy proposals. These results are among the first pieces of evidence that economic models can feasibly integrate alternative sources of data to provide real-time estimates of economic activity at the state level. The author’s models provide reliable and accurate estimates of state and local fiscal need and indicate the states that need relief the most months ahead of official estimates. The more tailored models presented in this paper could lead to more equitable and effective outcomes at a fraction of the cost to taxpayers when used to inform emergency fiscal stimulus distribution in the future.

 

Data and code is available at https://github.com/johnkearns617/Fintech-Trends-and-State-and-Local-Finance


Introduction

 

U.S. state and local governments received an unparalleled $900 billion across four pandemic relief bills passed by Congress between 2020 and 2021 in order to promote COVID-19 vaccinations, keep schools open, support small business, prevent layoffs, and ensure a long-term recovery (US Department of the Treasury 2022). In other words, relief aid was intended to limit the spread of the virus and the economic impact that would follow. Though economic and public health crises needed quick and decisive action, researchers are beginning to examine whether the aid was poorly targeted (Borawski and Schweitzer 2021; CRFB 2022; Clemens and Veuger 2020a). Policy decisions made in the early stages of the pandemic have important ramifications not just for the immediate recovery but for the long-term economic outlook of the United States. For example, failure to provide aid to states most affected by COVID-19 risks avoidable regional stagnation. Overestimating the amount of fiscal stimulus required, on the other hand, could contribute to entrenched inflation and subsequent financial shocks in the following years (de Soyres et al. 2022). This paper provides context on the extent to which pandemic aid to state and local governments was poorly targeted in aggregate terms or towards states who needed the most. I suggest a new technique to target relief that is more attuned to local conditions. 

Over the course of the pandemic, fiscal support has been distributed through a variety of methods, including general aid to states and local governments and aid appropriated for specific functions (e.g., additional funding for Medicaid, earmarked funds for testing and vaccination programs). More than 55% of total aid was appropriated as general aid, which was allocated through formulas designed at the discretion of Congress (Clemens and Veuger 2021). In the absence of more granular data, government officials relied on initial estimates of unemployment and economic activity to inform these formulas, and therefore the distribution and magnitude of aid. In the initial stages of the pandemic, estimates implied that state and local government would have shortfalls equaling to $960 billion USD in 2020 and 2021. However,  dramatic rebounds in the economy rendered tax revenue shortfalls, independent of direct transfers to state and local governments, smaller than anticipated. 

Figure 1 presents estimates of the total decline in tax revenue (independent of relief aid) of state and local governments from Q1 2020 through Q4 2021 using forecasts published in May 2020 and February 2021, which were proxies for expectations of policymakers, and observed data from May 2022. Over time, as economic trajectories became more clear, the estimated need of state and local governments was revised downwards. Conclusions on the amount of aid needed were also dependent on the sources of data used (Clemens and Veuger 2020). Estimates using unemployment data (the blue bars in Figure 1) to predict shortfalls were roughly double those using more granular income data (the redbars). Initial decisions on forecasting assumptions and data sources can lead to inaccurate assessments of the economic trajectory and therefore inefficient policy responses.  For example, as will be shown, the decision to use unemployment data biased revenue forecasts downwards and drove policymakers to react very strongly.

 

Figure 1: Updates to estimated total state and local government revenue shortfalls between 2020 Q1 and 2021 Q4 

Bar chart
Note: This chart presents changes in estimated state and local government revenue shortfall throughout the pandemic. The Bartik (2020) estimates use unemployment projections to estimate shortfall, while Clemens and Veuger (2020b) use projections of national income statistics to forecast aggregate revenue shortfalls. May 2020 forecast uses expectations of unemployment or income data through Q4 2021. Realized paths of unemployment and income are used as of May 2022 to estimate the actual shortfall of state and local governments compared against pandemic-era estimates. 

 

While Figure 1 suggests that the federal government did not precisely size aid commensurate with total need, the distribution of aid per capita that favored small states also suggests that the government did not target aid in a way that was consistent with the goals of the relief legislation. For example, under the CARES Act, Clemens and Veuger (2021) show that more aid per capita was associated not with the number of COVID-19 deaths or decline in state economic activity, but with the number of representatives a state has in Congress per person.[1]

Distribution based on the number of representatives a state has in Congress may fail to achieve broader economic goals as it did not correlate strongly with the extent that some states needed more money per person to weather particularly severe outbreaks of viral and economic contagion. For instance, despite having almost triple the number of COVID-19 deaths per capita than Vermont, New York received only $3,500 per person in aid while Vermont received $5,900 per person in aid. Inequalities in aid distribution could have contributed to further inequalities in economic and health outcomes at a time when policymakers aimed to stabilize conditions. 

Further, estimates suggest that the impact of federal relief aid on achieving its goals of preventing layoffs, promoting vaccination, and jump starting an economic recovery have so far been small and statistically insignificant (Clemens, Hoxie, and Veuger 2022). Meanwhile, the magnitude of fiscal policy has likely contributed to the high levels of inflation in the United States relative to the global average (de Soyres et al. 2022). The poor targeting of fiscal policy has wide-reaching ramifications at the state and national levels.

The objective of this paper is to evaluate the capacity of alternative data and machine learning models to guide decisions on the size and distribution of fiscal relief. Namely, I focus on using Google Trends data to predict state Gross Domestic Product (GDP). The utilization of Trends data has been demonstrated as a subtle but statistically significant predictor of GDP in cases at the national level, as described in the literature review below. Trends data is powerful because it is constantly updated as opposed to administrative data that are updated less frequently and takes longer to become available. Unlike other indicators of internet activity, Google Trends data is publicly available and provides direct insights into the private worries and interests of consumers in a state by the hour. It would therefore stand to reason that it may be especially useful during the COVID-19 crisis. 

In this paper, I develop 3 models to predict year-over-year state-level GDP growth. These models are run iteratively from Q1 2016 through Q4 2019 to forecast economic activity in the next quarter as if in ‘real-time.’ The average within-state error, the RMSE, is used to evaluate the models. The final pre-pandemic model iteration is then used to forecast each quarter between 2020 and mid-2022, once again evaluating by mean within-state error. 

My findings are as follows:

  • Several Google Trends search categories were found to be significant predictors of economic activity both before and during the COVID-19 pandemic, including ‘Auto Financing’, ‘Property Inspection’, and ‘Concerts.’
  • The best-performing model forecasted a decline in government revenue in the spring of 2020 of $57 billion, compared to an actual deficit of $52 billion. Estimates available at the time of writing the CARES Act suggested shortfalls between $100 and $200 billion and growing. The models in this paper more closely match the experience of states during the pandemic, months ahead of the release of official economic statistics.
  • While the model struggled to identify the true size of the recession in a state, it was successful in identifying which states were relatively worse off. Predicted GDP declines in Q2 2020 are very strongly correlated with observed GDP declines.
  • These results are useful as a guide for evaluating the equity of the distribution of relief aid. An allocation of aid proportional to real-time estimates of local revenue shortfalls is correlated with indicators of need rather than with congressional representatives per capita.

The plan of the paper is as follows. Section 2 reviews recent research on this topic, and Section 3 describes the data. Section 4 outlines the methodologies used, and Section 5 presents results and discussion of model predictions. Section 6 concludes with a summarization of findings and caveats of the analysis.

 

Literature Review

 

The COVID-19 pandemic caused alternative high-frequency economic indicators to become popular in academic and media circles. Traditional measures of economic activity, such as Gross Domestic Product (GDP) and personal income are released only at a quarterly frequency. The pandemic hit during March 2020, but we didn’t receive official statistics until July to know how deep a recession the United States was facing. Yet, policy makers needed immediate estimates of economic shocks throughout the country.

Researchers have since taken many approaches to this issue. The Federal Reserve Bank of Atlanta’s (2022) GDPNow model uses monthly indicators like industrial production, unemployment, and labor force participation to ‘nowcast’ GDP. However, while industrial production is a generally well-correlated proxy for GDP, its utility in identifying sudden shocks in service economies is limited. Further, even clear ‘nowcasts’ would not have been available until at least May 2020, in the case of the pandemic. Other panel data analyses have examined mobility data that are derived from cell phone apps such as Google Maps and have been shown to be strongly correlated with GDP (Chen and Spence 2020; Baker et al. 2020; International Monetary Fund 2020; Maloney and Taskin 2020; Gooslbee and Syverson 2021). While successful, granular mobility data is not available publicly.  

Prior to the pandemic, there had been a small but growing literature combining search data with machine learning models to generate GDP forecasts at the national level. Studies span OLS and regularized autoregressive (Heneiken 2019), mixed-frequency (Nakazawa 2022) and machine learning models (Buell et al. 2021).[2] A majority of this literature finds modest yet statistically-significant improvements in forecast error with models utilizing Google Trends data. Choi and Varian (2009) find that Google Trends significantly improved predictions for male unemployment through the Great Recession. 

This work seeks to add to several pieces of this literature: (1) research analyzing economic trends at the sub-national level in the United States; and (2) research on the relationship between Google Trends and economic activity during normal and crisis periods. To date, this is among the first works applying Google Trends data at the U.S. state level during the COVID-19 pandemic. 

 

Data

 

This section presents a brief background on the data source and lays out how the main outcome variable (state GDP) and main explanatory variables (unemployment, labor force participation, and Google search term popularity by state) were constructed. Appendix Table 1 below outlines summary statistics for a selection of explanatory variables.

 

State GDP and traditional economic indicators

I use seasonally-adjusted and year-over-year changes in state real GDP, unemployment, and labor force participation at a quarterly frequency from the Bureau of Economic Analysis and the Federal Reserve Bank of St. Louis FRED database.

 

Google Trends

Google Trends data are directly accessible through the web. The relative frequency of search terms or categories are available at the national, state, and city level for the United States at daily, weekly, and monthly frequencies.[3]

Google provides 1,132 aggregate categories that group individual search terms. I pulled search intensity for each U.S. state for 218 categories identified by Nakazawa (2022) as most relevant to economic activity. This includes searches for fast food, clothing, and plastics and polymers, for example. A full list of categories can be found in Appendix Table 2. One assumption to use Google Trends in economic analysis is that search activity is a proxy for consumers’ and businesses’ behavior; the more interest there is in fast food, the more likely consumers are to be purchasing fast food and contributing to economic activity. However, the link between search interest and categories like online video may not be so clear-cut if, for instance, people are watching YouTube because they have been laid off and have more leisure time. For simplicity, this analysis assumes that relationships between search categories and economic activity did not significantly reverse direction during the pandemic. If, for example, people are searching for fast food because they are afraid to go to a restaurant, the model may draw incorrect conclusions. As will be seen in the results below, this problem does not seem significant enough to generate systematic errors and it is unclear which direction the results would be biased. 

As in Figure 2 below, one can see the real-time surge in fast food interest in March 2020 without waiting for retail statistics to be published several months later. Google data is unique in that the data is available in real-time and does not suffer from the significant lags associated with official state GDP.  

 

Figure 2: Adjusted Google Trends indices for New Jersey and Alabama

Adjusted Google Trends indices for New Jersey and Alabama
Note: This figure shows the fast food and outsourcing Google Trends search indexes for New Jersey and Alabama after filtering and smoothing procedures have been applied. The red line denotes March 12, 2020, the first day in which distancing restrictions were enacted in the US.

 

 

Methodology

In this section, I present brief details on the models used to integrate Google Trends data with more traditional economic indicators. See the technical appendix for a more extensive econometric description of the methods, including the description of additional models. I conclude this section with an overview of how I evaluate the efficacy of the models.

 

Initial data transformations

All Google Trends data used throughout this paper are seasonally adjusted and smoothed to reduce sampling variability, unless otherwise noted. Figure 2 presents some examples of Google trends indexes after cleaning and processing. Moving forward I use the year-over-year percent change for Google Trends categories and arithmetic annual changes in unemployment and labor force participation rates.

 

Traditional OLS autoregressive (AR) models

Following Heikkinen (2019), I begin with a simple model to act as a baseline against which to measure my forecasts. The most basic model, the AR(1) (for which the 1 stands for one quarterly lag), regresses GDP growth in a certain quarter on the growth from last quarter. I extend this AR(1) specification to include contemporaneous economic controls and the year-over-year growth in the 218 Google Trends categories. The advantages of an AR(1) model include that its coefficients are easy to estimate and interpret. However, with the number of Google Trends categories included, this method may not be able to correctly run larger extensions. Additionally, an AR(1) model trained on pre-pandemic data may not be flexible enough to capture the swings in economic growth during the pandemic. 

 

ARMAX (Autoregressive Moving Average with Extra Input) model

The ARMAX model adds more complexity to the simple AR model by adding the error from the previous period as a ‘moving average’ term. This addition uses this term to correct for previous misses, which ends up being crucial for estimating during the pandemic  For this context, one would expect ARMAX to perform better than the regular AR model. It is still not the most flexible model, compared to machine learning algorithms.

 

Random forest

Random forests are a type of machine learning algorithm that can be used for predictive modeling. The basic idea behind a random forest is to create multiple combinations based on random subsets of the explanatory variables and observations in the data. Each tree makes a prediction about the target variable, which in this case would be GDP growth, based on the specific combination of variables. When we have many trees making predictions, we can combine their predictions to come up with a more accurate overall prediction. This is because each tree may capture different patterns or relationships between the variables, and combining their predictions helps to smooth out the noise.

Random forests are particularly useful in situations where there are many potential explanatory variables, as they can handle high-dimensional data without overfitting–which occurs when models hew too closely to the specific training data and lose generalizability. They are also relatively easy to interpret, since we can look at the importance of each variable in the model and how it contributes to the overall prediction. The random forest model is more flexible than an AR(1) or ARMAX specification because it does not assume a specific equation to estimate.

  

Model evaluation

We employ two statistics to evaluate the models explained above. The pseudo out-of-sample error speaks to the ability of the model to explain next quarter’s GDP given all the data that came before. This error, also called the RMSE, is estimated for each quarter before and during the pandemic.A high RMSE represents a bad fit, while a low RMSE represents a good fit. The statistic estimates GDP growth prediction errors using the final pre-pandemic model ‘as if’ experiencing the pandemic in real time. The statistic can be thought of as the average error in a quarter for one state. For instance, a recession RMSE of 1.0 would indicate an average difference between actual and predicted growth of 1 percentage point. The best model will provide the lowest average error.

 

Results and discussion

 

Correlates of economic activity

In lieu of presenting initial regression results in tabular form, I begin by outlining which Google Trends categories were found to be most important. The intuitive nature of regularized OLS or ARMAX coefficients allows us also to identify which Google Trends categories are most correlated with economic activity in normal and pandemic times. Figure 3 presents the coefficient of the significant variables from the ARMAX model trained on pre-pandemic data. The chart shows, for example, that a one percentage point increase in relative search interest for women’s clothing year-over-year is associated with a 0.03 percentage point increase in GDP growth. In other words, the bars in green identify terms that people search for when times are good, and red bars are words that people search for when times are bad. 

The terms most strongly associated with economic growth are women’s clothing, cosmetic procedures, and vehicle brands. These are all goods that could be viewed as luxury items on which people will spend discretionary income. The terms most strongly associated with economic decline include auto financing and online video.

 

Figure 3: Significant correlates with economic activity, pre-pandemic

Significant correlates with economic activity, pre-pandemic

Note: This figure presents the coefficients on Google Trends from the ARMAX model that were significant at the 10% confidence level or lower. The coefficient on women’s clothing should read as “for a one percentage point increase in the growth rate of relative interest in women’s clothing, state GDP growth is expected to increase by 0.02 percentage points.” This is an estimate of the elasticity between Google search interest and economic activity.

 

Figure 4 shows the most important terms for the model when trained with pandemic data. A few more interesting results are borne out. Air travel and real estate are among the categories that are most strongly related with economic growth. The initial crisis was marked by the failure of many airlines, just as the pandemic recovery saw a very strong housing market (Buckley 2023; Winck 2021) . Real estate prices, in particular, have historically moved closely with GDP (Blake 2020). On the other hand, home improvement, enterprise technology, and game systems are all strongly related to economic decline. Figure 5 identifies the search terms that are found to be significant in both the pre-pandemic and pandemic models. 

 

Figure 4: Significant correlates with economic activity, post-pandemic

Significant correlates with economic activity, post-pandemic
Note: This figure presents the coefficients on Google Trends from the ARMAX model that were significant at the 10% confidence level or lower. The coefficient on home improvement should read as “for a one percentage point increase in the growth rate of relative interest in home improvement, state GDP growth is expected to decrease by nearly 0.06 percentage points.” It is this an estimate of the elasticity between Google search interest and economic activity.

 

Figure 5: Consistently significant correlates with economic activity

Consistently significant correlates with economic activity
Note: This figure shows the coefficients on Google Trends categories from the pre-pandemic model that were found to be significant both before and during the COVID-19 pandemic.

 

Pre-pandemic forecast error

The second column of Table 2 reports the average within-state RMSE for the 12 quarters between 2017 and 2019. The interpretation of the RMSE for the baseline AR(1) model, for example, is that the nowcast using only lagged GDP growth was off by 1.027 percentage points on average. The best model will have the lowest RMSE. Note that the model that does not limit the number of included variables, the AR(1) with additional covariates, performs the worst among the models. The random forest, which is more able to incorporate many related covariates, provides the best pre-pandemic estimates, but the baseline AR(1) is not much worse. At least when times are stable, an AR(1) process is a good approximation.

 

Table 2: Model Nowcast RMSE

Model

Pre-Pandemic RMSE

Post-Pandemic RMSE

AR(1)   (OLS)

1.027

5.128

AR(1) + Econ. Indicators + Google Trends (OLS)

3.051

6.071

Random Forest (ML)

0.958

4.848

Stepwise ARMAX (ML)

3.031

3.939

Note: Numbers in bold denote the best- and worst-performing models.

 

Pandemic forecast error

However, when looking at a period of time with substantial volatility, the AR(1) models perform much worse than both the more flexible models (third column of Table 2). Overall, we see that the performance of all models during the pandemic is much worse than before, which should be expected because the pandemic was sudden and unprecedented, rupturing economic relationships in ways unlike even previous recessions. We also see that the machine learning (ML) models perform categorically better than the OLS models. This aligns with expectations since machine learning models should have the flexibility to model the highly non-linear relationship between search activity and economic activity. The ARMAX model performs the best during the pandemic. The two best performing models (random forest and ARMAX) have average errors around 4 percentage points, which are larger than that of comparable government forecasts at the onset of the pandemic.

 

Figure 6: Nowcasts for AR(1), random forest, and stepwise ARMAX models

 

Nowcasts for AR(1), random forest, and stepwise ARMAX models

Note: The series in blue denotes the actual path of real state GDP for New Jersey, while red denotes the predicted path of GDP from my models.

 

Estimations of aggregate state fiscal need

Despite the errors in identifying the size of economic contractions, an ARMAX model that uses Google Trends data may provide a forecast that is more attuned to local economic conditions than either aggregate unemployment or income data. More accurate numbers available to policy makers would reduce the likelihood of over-allocating funds to state and local governments, freeing up resources for the federal government to use elsewhere during a national emergency. 

To evaluate the ARMAX model’s capacity to inform decision-making on the magnitude of aid transfers, I compare the path of tax revenues implied by the ARMAX model using data up to the end of Q2 2020, mirroring the available information to Congress while crafting the CARES Act. I also include two pandemic-era forecasts using national unemployment data (Bartik 2020) and national personal income forecasts (Clemens and Veuger 2020b) and the path of actual tax revenue. I note that actual tax revenue for Q3 2020 onwards reflects endogenous responses to federal fiscal and monetary policy. In brief, I use the ARMAX model to predict the GDP for each state in dollars. I then use sales and income tax revenue elasticities (i.e., how much tax revenues are expected to decline when GDP declines) to get the impact on government finances. See the appendix for more methodological details. 

My estimate of total revenue shortfall for state and local governments from Q1 2020 through Q4 2021 comes to $299 billion USD, compared to $391 billion USD using national forecasts of aggregate income and $774 billion USD using forecasts of unemployment. In contrast, actual revenue (the gray line) by the end of 2021 was $280 billion USD above levels expected prior to the pandemic. Of course, policymakers had no way of knowing that the economy would rebound as strongly as it did, and the strength of government balance sheets may have been due in large part because the CARES Act and other bills supported the economy.

 

Figure 7: Real-time estimates of state and local fiscal need during Q2 2020

fall in sales and income tax revenue

Note: The figure plots the fall in sales and income tax revenue for state and local governments over the first quarters of the COVID-19 pandemic. Each forecast is made using only data available by the end of Q2 2020, proxying for the information available to policymakers when writing the CARES Act. Actual tax revenue data comes from the US Census Bureau.

 

Nonetheless, how does the experienced shortfall at the end of Q2 2020 match up with real-time forecasts that policymakers would have to rely on when crafting the CARES Act (and setting precedent for subsequent relief to state and local governments in the legislation to follow)? The forecast using unemployment data estimates a $200 billion USD shortfall and rising. This sort of funding gap would demand significant government intervention. National income models put the shortfall at roughly half of this $200 billion USD gap, while my model augmented with Google Trends data estimates a $57 billion USD gap that was growing at a relatively slower rate than implied by the other models. This estimate, although subject to uncertainty, matches the actual $52 billion USD shortfall. The forecast using Google Trends would suggest relatively more restraint–especially during negotiations for later legislation–in distributing aid to state and local governments, more closely mirroring the financial conditions that were realized by the end of June 2020.

Why is it important that alternative models could have redirected policymakers’ attention and shifted the magnitude of aid in the CARES Act? One can reasonably argue that the aid given to state and local governments would still be beneficial to the economy. From a financial perspective, if state and local governments receive more aid than they needed to cope with the immediate demands of the pandemic, or more aid than they could feasibly distribute in the short-term, some of this aid would remain unspent. Some news stories suggest that portions of the ARPA money, in particular, remain unallocated (Reitmeyer 2022). From a more normative perspective, each dollar allocated to state and local governments could be viewed as a dollar not allocated to another equally-pressing problem. One could imagine a number of other places, from additional funds for ramping up vaccine programs to supporting front-line workers and low-income households, that could have benefitted from increased attention. The results summarized in Figure 7 indicate that the ‘marginal return,’ the value of each additional dollar spent, was low. 

 

Identification of recession intensity

Having discussed the relevance of alternative data for policy decisions on the size of fiscal packages, are the models also valuable by identifying which states were most negatively impacted by the pandemic in real-time? 

Yes.

Figure 7 plots the actual year-over-year growth in state GDP in early 2020 against the predictions from the ARMAX model, each dot representing a state-quarter observation. The x-axis denotes the observed GDP growth for a state in a given quarter, and the y-axis denotes the predicted GDP growth from the ARMAX model. The 45 degree line plots a perfect prediction; dots above this line represent underpredictions of GDP declines, while dots below the line are overpredictions. First, we see that almost all predictions understate the decline in GDP, and this error is highest during the second quarter of 2020 when the economic effects of the pandemic were strongest. The error appears to be uniform across states, so minor changes to the specification could help correct for this. 

 

Figure 7: Actual and predicted GDP growth during the pandemic

Actual and predicted GDP growth during the pandemic
Note: A dot above the 45 degree line shown represents an underprediction of state GDP growth. Despite tending to underpredict the recession, the model accurately identifies the states with the sharpest and shallowest recessions. Each dot is a state-quarter observation.

 

Even though declines were unpredicted, the correlation between ARMAX predictions and observed growth is quite strong. The correlation coefficient between the two series is 0.75, compared to 0.47 and 0.48 for the AR(1) and random forest models, respectively. Even though the model could not pin down the exact decline in economic activity, it is able to accurately identify which states were suffering the deepest recessions. Thus, the use of Google Trends data could allow us to determine state-specific variations in fiscal need without greatly sacrificing overall accuracy. In turn, if aid allocations could be tied more closely to empirically-estimated declines in economic activity, distribution of funds could be made more effective or equitable.

 

Equity of aid distribution during COVID-19

Defining equity is difficult and inherently political, but given Deputy Secretary Adeyemo’s goals of promoting vaccination, preventing layoffs, and ensuring long-term recovery, I will define an equitable allocation as one that is most closely correlated with actual declines in GDP and rates of COVID-19 deaths during Q2 2020. I compare three different allocations of funding, holding the size of aid constant. First is the actual distribution of aid per capita across states, which has been shown to be biased towards small states (Clemens and Veuger 2021). Second is one where each state receives the same amount of aid per capita ($2,527 USD in aid to state and local governments per person). The third allocation utilizes the estimates of state fiscal need from the previous section. 

To come up with the distribution of the $900 billion USD in total aid under this third mechanism, I first assume that there is a baseline level of aid that each state is owed. The lowest amount of aid per resident allocated during the pandemic was the $1,804 USD sent to Utah per person. I take this figure as the lowest politically-acceptable amount of aid to be given to a state. The remaining pot of money (roughly $300 billion USD) is distributed according to a state’s share of total revenue decline. For example, the ARMAX model expected that Illinois’ GDP would decline by 3.96 percent between Q1 2020 and Q4 2021. This would translate into roughly $11 billion USD in lost tax revenue. This $11 billion USD loss is 3.68 percent of the aggregate $299 billion USD loss across all states. Therefore, Illinois would receive 3.68 percent of the remaining pot of money, another $870 USD per person. The implicit assumption in this mechanism is that the state that suffered more economically should receive more. 

Table 4 presents the correlation of the distributed aid per capita according to these three frameworks with actual decline in GDP in Q2 2020, total COVID-19 deaths per capita in Q2 2020, and the number of congressional representatives per capita. A value of 1.00 would indicate that the variable is positively related with the amount of money a state received, while a value of -1.00 indicates perfect negative correlation. A value of 0.00 means the variable and aid received are statistically unrelated. An equitable allocation may be a distribution that correlates with damage from disaster, rather than with congressional representation, by which some get more of a voice than others in a time when lives are at stake.  As seen in the first row, the actual distribution of aid is strongly correlated with the number of congressional representatives a state has per capita.

 

Table 4: Correlation between allocations of aid per capita and indicators of need

Allocation Mechanism

Actual Real Q2 2020 GDP Decline

Actual Q2 2020 COVID-19 Deaths per Capita

Representatives per Capita

Actual

-0.14

0.07

0.90

Equal

0.17

0.11

0.03

Model-informed

-0.61

0.45

-0.09

Note: This table presents the correlation between different allocations of aid per capita to state and local governments and GDP declines and COVID-19 deaths in Q2 2020 and the number of congressional representatives per capita. Values close to 1 or -1 indicate variables that are strongly correlated with aid per capita under a given allocation mechanism. The actual allocation of aid is highly correlated with relative political representation, i.e., states with more representatives per person received more aid per person. Distributing aid in proportion to estimated revenue shortfall is uncorrelated with political representation but more closely related with real post-hoc estimates of COVID-19 and recession intensity.

 

Looking at the shortfall-proportional allocation of aid, it is highly correlated with both actual declines in real GDP, which weren’t officially released until September 2020 at the state level, and the level of COVID-19 deaths in early 2020. Thus, by using Google Trends data in a flexible model, one could establish a more equitable distribution of money without needing to wait for official indicators of GDP decline and revenue shortfall.

 

Conclusion

 

Overall, this paper examined the efficacy of several predictive methods integrating Google Trends data to forecast GDP growth during the COVID-19 pandemic. Extensions for using the best-performing models to inform policy decisions regarding the magnitude and distribution of aid outline the feasibility of the application of machine learning methods and Google Trends data at the state-level to better estimate state-specific fiscal need during future recessions. In turn, this could make disaster relief more equitable and responsive to financial, and more importantly, human needs.

With respect to the Trends data themselves, only certain categories of the hundreds tested had statistically significant correlations with economic activity. Women’s clothing, cosmetic procedures, and vehicle brands, all ‘luxury’ items, presented significant positive associations with GDP pre-pandemic; conversely, during the pandemic, enterprise technology and gaming consoles were negatively correlated with GDP. The results of this analysis present interesting correlations between search behavior and economic activity at the state level.

In terms of model performance, I find that during normal times the Google data was bad for prediction. However, during the COVID-19 recessionary period, when other sources of economic information were erratic and incomplete,  the combination of time series modeling (the autoregressive moving average model, or ARMAX) and the most important Google Trends variables was sufficient to identify economic shocks in real-time with moderate success.

Given the influence the first estimates of state and local revenue shortfalls had on the overall size of aid packages in the CARES Act and other bills, integration with data modeling could help policy makers allocate funding for different priorities should another sudden economic crisis arise. Nowcast results during Q2 2020 imply a total revenue shortfall at the end of that quarter of $57 billion USD, almost matching the actual decline in revenue of $52 billion USD. This estimate portrays a different level of need compared with other real-time forecasts between $100 and $200 billion USD. Had more information been available to policy makers at the outset of the pandemic, aid may have been reallocated towards other goals and later inflationary pressures may have been more limited.

These estimates are also shown to have utility in informing policy decisions on the magnitude and relative distribution of state and local government relief aid during the pandemic. While models struggled to predict the correct level of GDP decline across states, estimates for Q2 2020 were highly correlated with observed patterns in later-released official data (a 0.75 correlation coefficient). This speaks to the model’s ability to identify which states would have the biggest drops in GDP, months ahead of official estimates.

The novel extension of this paper is identifying the variation in need specific to individual states. The combination of the ARMAX model and Google Trends data allow us to identify GDP declines in real-time at the state level. Making aid proportional to estimated need connects fiscal support directly to actual GDP declines and COVID-19 deaths, supporting states and local governments most in need. Providing clear, open-source, and publicly-available data on estimates of state fiscal need can provide guardrails for policy makers and erect barriers against purely political biases in aid apportionment.

These results still have several important caveats. The Trends data require a great deal of smoothing and still may benefit from more filtration. The models have also been trained only on data from a strong economic expansion. The applicability to other recessions or economic context remains an open question. Having identified which models are most useful for combining Google Trends and economic data, future work should focus on optimizing the ARMAX and random forest models.

Still, these first results provide evidence that alternative sources of data at the state level can be feasibly integrated into economic models to provide real-time estimates of economic activity, especially during periods of crisis. The ARMAX nowcasts provide reliable and accurate estimates of state and local fiscal need. A more tailored model could be used to inform emergency fiscal stimulus in the future, leading to more equitable and effective outcomes at a fraction of the cost to taxpayers.The deciding factor in disaster relief should not be where has more politicians but where the money can do the most good.

 

*This article was edited by Yiping Li (Princeton University) and Emili Sabanovic (Georgia Tech University).


About the Author

John

John is a Master in Public Affairs candidate at Princeton University with concentrations in economic policy and urban policy. He graduated with a joint BA in Economics from the College of William & Mary and the University of St. Andrews in Scotland. Prior to Princeton, John worked as a research associate at the American Enterprise Institute on a portfolio spanning monetary policy, international economics, and public finance. While at AEI, he contributed to several journal articles on the economic impact of COVID-19 and the evaluation of relief aid to state and local governments during the COVID-19 pandemic.

 


Notes

1. For example, a state like Wyoming, which has 3 congressional delegates for its 577,000 residents (5.2 representatives per million people), received much more aid than a state like New York, which has 1.5 representatives per million residents. (Return to Note)

2. For further sources on OLS and AR models, see Eichenauer et al. (2022), Seabold and Coppola (2015), Varian and Choi (2009), Austin et al. (2021), and Medeiros and Pires (2021). For mixed-frequency, see Wolosko (2020) and Bantis et al. (2022). For machine learning, see Richardson et al. (2018) and Hopp (2022). (Return to Note)

3. As Austin et al. (2021) explain, an individual Google Trends index is calculated in the following way: “Assume there are 10,000 searches in week 1 in a region and that 1,000 are related to restaurants. The level of interest in restaurants is therefore 1,000/10,000=.1. Assume that each week we measure the level of interest in restaurants (e.g., week 2=.08, week 3=.09).” The relative search interest number is then scaled up to be within a range from 0 to 100, with 100 being the highest level of interest within a given time frame. Figures are determined using a sample of search activity for a given time period and location. In this example, weeks 1, 2, and 3 are represented by index values of 100, 80, and 90, respectively. See the technical appendix for a more extended description of issues relating to the construction of the Google Trends index. (Return to Note)


References

Austin, Paul A., Marco Marini, Alberto Sanchez, Chima Simpson-Bell, and James Tebrake. 2021. Using the Google Places API and Google Trends Data to Develop High Frequency Indicators of Economic Activity. International Monetary Fund.

Baker, Scott R, Robert A Farrokhnia, Steffen Meyer, Michaela Pagel, and Constantine Yannelis. 2020. “How Does Household Spending Respond to an Epidemic? Consumption during the 2020 COVID-19 Pandemic.” The Review of Asset Pricing Studies 10 (4): 834–62. https://doi.org/10.1093/rapstu/raaa009.

Bantis, Evripidis, Michael P. Clements, and Andrew Urquhart. 2022. “Forecasting GDP Growth Rates Using Google Trends in the United States and Brazil.” SSRN Scholarly Paper. Rochester, NY. https://doi.org/10.2139/ssrn.3860194.

Bartik, Timothy J. n.d. “An Updated Proposal for Timely, Responsive Federal Aid to State and Local Governments during the Pandemic Recession | Research Highlights | Upjohn Institute.” Accessed December 23, 2022. https://www.upjohn.org/research-highlights/updated-proposal-timely-responsive-federal-aid-state-and-local-governments-during-pandemic-recession.

Blake, Neil. 2020. “What the Past Relationship between GDP Growth and Property Total Returns Tells Us about the Likely Impact of the COVID-19.” CBRE. 2020. https://www.cbre.co.uk/insights/articles/what-the-past-relationship-bet….

Borawski, Garrett, and Mark E. Schweitzer. 2021. “How Well Did PPP Loans Reach Low- and Moderate-Income Communities?” Economic Commentary, no. 2021–13 (May). https://doi.org/10.26509/frbc-ec-202113.

Buckley, Julia. 2023. “How the Pandemic Killed off 64 Airlines.” CNN. February 11, 2023. https://www.cnn.com/travel/article/pandemic-airline-bankruptcies/index….

Buell, Brandon, Carissa Chen, Réda Chérif, Hyeon-Jae Seo, Jiawen Tang, and Nils Wendt. 2021. Impact of COVID-19 : Nowcasting and Big Data to Track Economic Activity in Sub-Saharan Africa. IMF Working Papers. [Washington, D.C.] : International Monetary Fund.

Chen, Long, and Michael Spence. n.d. “Five Lessons from Tracking the Global Pandemic Economy.” CEPR. Accessed December 9, 2022. https://cepr.org/voxeu/columns/five-lessons-tracking-global-pandemic-economy.

Clemens, Jeffrey, Philip G. Hoxie, and Stan Veuger. 2022. “Was Pandemic Fiscal Relief Effective Fiscal Stimulus? Evidence from Aid to State and Local Governments.” NBER Working Papers, NBER Working Papers, , June. https://ideas.repec.org//p/nbr/nberwo/30168.html.

Clemens, Jeffrey, and Stan Veuger. 2020a. “Implications of the Covid-19 Pandemic for State Government Tax Revenues.” National Tax Journal 73 (3): 619–44. https://doi.org/10.17310/ntj.2020.3.01.

———. 2020b. “The COVID-19 Pandemic and the Revenues of State and Local Governments: An Update.” American Enterprise Institute Economic Perspectives, September. https://www.aei.org/wp-content/uploads/2020/09/The-COVID-19-Pandemic-and-the-Revenues-of-State-and-Local-Governments.pdf?x91208.

———. 2021. “Politics and the Distribution of Federal Funds: Evidence from Federal Legislation in Response to COVID-19.” NBER Working Papers, NBER Working Papers, , May. https://ideas.repec.org//p/nbr/nberwo/28875.html.

Combes, Stéphanie, and Clément Bortoli. 2016. “Nowcasting with Google Trends, the More Is Not Always the Better.” In Proceedings of the 1st International Conference on Advanced Research Methods and Analytics. Universitat Politècnica València. https://doi.org/10.4995/CARMA2016.2016.4226.

CRFB (Committe for a Responsible Federal Budget). n.d. “COVID Money Tracker.” Committee for a Responsible Federal Budget. Accessed December 22, 2022. https://www.crfb.org/project/covid-money-tracker.

Deb, Pragyan, Davide Furceri, Jonathan D. Ostry, and Nour Tawk. 2022. “The Economic Effects of COVID-19 Containment Measures.” Open Economies Review 33 (1): 1–32. https://doi.org/10.1007/s11079-021-09638-2.

Eichenauer, Vera Z., Ronald Indergand, Isabel Z. Martínez, and Christoph Sax. 2022. “Obtaining Consistent Time Series from Google Trends.” Economic Inquiry 60 (2): 694–705. https://doi.org/10.1111/ecin.13049.

Elvidge, Christopher D., Jeffrey Safran, Benjamin Tuttle, Paul Sutton, Pierantonio Cinzano, Donald Pettit, John Arvesen, and Christopher Small. 2007. “Potential for Global Mapping of Development via a Nightsat Mission.” GeoJournal 69 (1/2): 45–53.

Federal Reserve Bank of Atlanta. 2022. “GDPNow.” GDPNow. December 9, 2022. https://www.atlantafed.org/cqer/research/gdpnow.

Federal Reserve Bank of St. Louis. 2022. “Federal Reserve Economic Data | FRED | St. Louis Fed.” December 9, 2022. https://fred.stlouisfed.org/.

Fezzi, Carlo, and Valeria Fanghella. 2020. “Real-Time Estimation of the Short-Run Impact of COVID-19 on Economic Activity Using Electricity Market Data.” Environmental and Resource Economics 76 (4): 885–900. https://doi.org/10.1007/s10640-020-00467-4.

Gibson, John, and Geua Boe-Gibson. 2021. “Nighttime Lights and County-Level Economic Activity in the United States: 2001 to 2019.” Remote Sensing 13 (14): 2741. https://doi.org/10.3390/rs13142741.

Google LLC. 2022. “Google Trends.” Google Trends. December 9, 2022. https://trends.google.com/trends/?geo=US.

Goolsbee, Austan, and Chad Syverson. 2021. “Fear, Lockdown, and Diversion: Comparing Drivers of Pandemic Economic Decline 2020.” Journal of Public Economics 193 (January): 104311. https://doi.org/10.1016/j.jpubeco.2020.104311.

Heikkinen, Joni. 2019. “NOWCASTING GDP GROWTH USING GOOGLE TRENDS.” Jyväskylä University School of Business and Economics. https://jyx.jyu.fi/bitstream/handle/123456789/66363/URN:NBN:fi:jyu-201911144867.pdf?isAllowed=y&sequence=1.

Hopp, Daniel. 2022. “Performance of LSTM Neural Networks in Nowcasting Global Trade during the COVID-19 Crisis.” Statistical Journal of the IAOS 38 (2): 563–76. https://doi.org/10.3233/SJI-210911.

International Monetary Fund. 2020. “World Economic Outlook, October 2020: A Long and Difficult Ascent.” International Monetary Fund. October 2020. https://www.imf.org/en/Publications/WEO/Issues/2020/09/30/world-economic-outlook-october-2020.

Maloney, William, and Temel Taskin. 2020. Determinants of Social Distancing and Economic Activity during COVID-19: A Global View. World Bank, Washington, DC. https://doi.org/10.1596/1813-9450-9242.

Medeiros, Marcelo C, and Henrique Pires. n.d. “The Proper Use of Google Trends in Forecasting Models,” 19.

Milani, Fabio. 2021. “COVID-19 Outbreak, Social Response, and Early Economic Effects: A Global VAR Analysis of Cross-Country Interdependencies.” Journal of Population Economics 34 (1): 223–52. https://doi.org/10.1007/s00148-020-00792-4.

Nakazawa, Takashi. n.d. “Constructing GDP Nowcasting Models Using Alternative Data,” 39.

Reitmeyer, John. 2022. “More than $1B in Federal COVID-19 Aid Unspent in NJ.” NJ Spotlight News. November 14, 2022. https://www.njspotlightnews.org/2022/11/federal-covid-19-aid-remains-unspent-in-nj-advocates-prioritize-homelessness-prevention-small-business/.

Richardson, Adam, Thomas Mulder, and Tugru l Vehbi. 2018. “Nowcasting New Zealand GDP Using Machine Learning Algorithms.” SSRN Electronic Journal. https://doi.org/10.2139/ssrn.3256578.

Roidt, Mario, Christopher M. Chini, Ashlynn S. Stillwell, and Andrea Cominola. 2020. “Unlocking the Impacts of COVID-19 Lockdowns: Changes in Thermal Electricity Generation Water Footprint and Virtual Water Trade in Europe.” Environmental Science & Technology Letters 7 (9): 683–89. https://doi.org/10.1021/acs.estlett.0c00381.

Seabold, Skipper, and Andrea Coppola. 2015. Nowcasting Prices Using Google Trends: An Application to Central America. Policy Research Working Papers. The World Bank. https://doi.org/10.1596/1813-9450-7398.

Soyres, François de, Ana Maria Santacreu, and Henry Young. 2022. “Fiscal Policy and Excess Inflation during Covid-19: A Cross-Country View,” July. https://www.federalreserve.gov/econres/notes/feds-notes/fiscal-policy-and-excess-inflation-during-covid-19-a-cross-country-view-20220715.html.

Sun, Jie, Liping Di, Ziheng Sun, Jieyong Wang, and Yingdan Wu. 2020. “Estimation of GDP Using Deep Learning With NPP-VIIRS Imagery and Land Cover Data at the County Level in CONUS.” IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing 13: 1400–1415. https://doi.org/10.1109/JSTARS.2020.2983331.

Tebrake, Paul A. Austin, Marco Marini,Alberto Sanchez,Chima Simpson-Bell,James. n.d. “Using the Google Places API and Google Trends Data to Develop High Frequency Indicators of Economic Activity.” IMF. Accessed December 9, 2022. https://www.imf.org/en/Publications/WP/Issues/2021/12/17/Using-the-Google-Places-API-and-Google-Trends-Data-to-Develop-High-Frequency-Indicators-of-510876.

US Department of the Treasury. 2020. “Coronavirus Relief Fund.” U.S. Department of the Treasury. April 17, 2023. https://home.treasury.gov/policy-issues/coronavirus/assistance-for-stat….

US Department of the Treasury. 2022 “Treasury Issues Final Rule for State and Local Fiscal Recovery Funds Program to Support the Ongoing COVID Response.” U.S. Department of the Treasury. Accessed December 22, 2022. https://home.treasury.gov/news/press-releases/jy0550.

Varian, Hal R., and Hyunyoung Choi. 2009. “Predicting the Present with Google Trends.” SSRN Scholarly Paper. Rochester, NY. https://doi.org/10.2139/ssrn.1659302.

Verschuur, Jasper, Elco E. Koks, and Jim W. Hall. 2021. “Global Economic Impacts of COVID-19 Lockdown Measures Stand out in High-Frequency Shipping Data.” PLOS ONE 16 (4): e0248818. https://doi.org/10.1371/journal.pone.0248818.

Winck, Ben. n.d. “The Fed Is Watching Housing ‘carefully’ and Hopes Builders Catch up to the Red-Hot Market, Chair Powell Says.” Business Insider. Accessed May 5, 2023. https://www.businessinsider.com/jerome-powell-housing-market-boom-diffe….

Woloszko, Nicolas. 2020. “Tracking Activity in Real Time with Google Trends.” OECD Economics Department Working Papers 1634. Vol. 1634. OECD Economics Department Working Papers. https://doi.org/10.1787/6b9c7518-en.

Zhao, Naizhuo, Ying Liu, Guofeng Cao, Eric L. Samson, and Jingqi Zhang. 2017. “Forecasting China’s GDP at the Pixel Level Using Nighttime Lights Time Series and Population Images.” GIScience & Remote Sensing 54 (3): 407–25. https://doi.org/10.1080/15481603.2016.1276705.


Appendix

Appendix A: Charts and Figures

Appendix Table 1: Summary statistics for select variables, Q1 2016 through Q2 2022

Appendix Table 1: Summary statistics for select variables, Q1 2016 through Q2 2022

Note: This table presents summary statistics for year-over-year percentage change in real state GDP and seasonally-adjusted and smoothed Google Trends indices for plastics, auto financing, property inspections, and home improvement; and the levels and year-over-year arithmetic changes in unemployment rate and labor force participation rate. High-frequency variables are all averaged at the quarterly level.

 

Appendix Table 2:  Google Search Trend Categories

TravelGuides&Travelogues

Bed&Bath

Eyewear

Magazines

TicketSales

Plastics&Polymers

Scooters&Mopeds

InternetSoftware

Bankruptcy

BuildingMaterials&Supplies

Watches

Printing&Publishing

Resumes&Portfolios

Toys

CivilEngineering

AutoFinancing

UrbanTransport

Investing

VehicleWheels&Tires

ConstructionConsulting&Contracting

HomeFinancing

ApparelServices

MovieListings&TheaterShowtimes

Photographic&DigitalArts

Renewable&AlternativeEnergy

Optoelectronics&Fiber

Hotels&Accommodations

FormalWear

Cycling

Aviation

CarRental&TaxiServices

ClothingAccessories

KnowledgeManagement

HomeInsurance

MaritimeTransport

InvestmentBanking

ElectronicComponents

Luggage&TravelAccessories

AutoInsurance

RailTransport

Uniforms&Workwear

LiveSportingEvents

SpecialtyTravel

ComputerDrives&Storage

Agrochemicals

PropertyInspections&Appraisals

Commercial&InvestmentRealEstate

ClassicVehicles

MultimediaSoftware

Coatings&Adhesives

Headwear

AthleticApparel

ISPs

Business&ProductivitySoftware

Dyes&Pigments

Distribution&Logistics

FuelEconomy&GasPrices

Import&Export

Cable&SatelliteProviders

Outdoors

CasualApparel

Electricity

Gadgets&PortableElectronics

ShoppingPortals&SearchEngines

LuxuryGoods

TouristDestinations

Holidays&SeasonalEvents

Apartments&ResidentialRentals

SmallBusiness

Footwear

HealthInsurance

RealEstateListings

PhoneServiceProviders

Pets

Welfare&Unemployment

EventPlanning

Test&Measurement

CommunicationsEquipment

Textiles&Nonwovens

Bus&Rail

VehicleFuels&Lubricants

Coffee&Tea

MobilePhones

Webcams&VirtualTours

ComputerComponents

Outsourcing

PropertyDevelopment

Beer

Photo&VideoServices

PhysicalAssetManagement

TravelAgencies&Services

Oil&Gas

Wine

E-Books

QualityControl&Tracking

Mobile&WirelessAccessories

DiningGuides

Liquor

Trucks&SUVs

Writing&EditingServices

ComputerServers

PersonalAircraft

WaterSupply&Treatment

Packaging

JobListings

HardwareModding&Tuning

CommercialLending

Art&CraftSupplies

Moving&Relocation

Costumes

EnterpriseTechnology

Consulting

Laundry

Weddings

Men'sClothing

EducationalSoftware

CarElectronics

Homemaking&InteriorDecor

OperatingSystems

Outerwear

Custom&PerformanceVehicles

AutomotiveIndustry

Spas&BeautyServices

DesktopComputers

Sleepwear

Hybrid&AlternativeVehicles

Bicycles&Accessories

HairCare

ComputerPeripherals

Women'sClothing

CreditCards

SwapMeets&OutdoorMarkets

Off-RoadVehicles

E-CommerceServices

RecreationalAviation

DebtManagement

Campers&RVs

HomeImprovement

Currencies&ForeignExchange

CorporateEvents

CollegeFinancing

CommercialVehicles

Fashion&Style

VehicleBrands

TV&VideoEquipment

OnlineGames

Engine&Transmission

AirTravel

RetailTrade

CleaningAgents

TVCommercials

AutoExterior

Cruises&Charters

AnimalProducts&Services

Swimwear

Signage

AutoInterior

SoftwareUtilities

Concerts&MusicFestivals

Undergarments

Timeshares&VacationProperties

CosmeticProcedures

WeightLoss

GameSystems&Consoles

HomeStorage&Shelving

FilmFestivals

Wholesalers&Liquidators

Pharmacy

Freeware&Shareware

Doctors'Offices

MobileApps&Add-Ons

TobaccoProducts

Hospitals&TreatmentCenters

VentureCapital

Fire&SecurityServices

RecordingIndustry

VehicleSpecs,Reviews&Comparisons

Pharmaceuticals&Biotech

Poker&CasinoGames

Urban&RegionalPlanning

Film&TVIndustry

Parking

SportingGoods

Kitchen&Dining

WebPortals

BusinessFinance

Microcars&CityCars

HomeFurnishings

NuclearEnergy

Metals&Mining

Boats&Watercraft

Carpooling&Ridesharing

IndustrialMaterials&Equipment

FoodService

Housing&Development

WebApps&OnlineTools

PublicStorage

Freight&Trucking

CareerResources&Planning

Nursery&Playroom

PowerSupplies

DomesticServices

EntertainmentMedia

ElectromechanicalDevices

Laptops&Notebooks

BookRetailers

TVShows&Programs

Candy&Sweets

Children'sClothing

FastFood

DataSheets&ElectronicsReference

RiskManagement

ElectronicAccessories

PropertyManagement

WasteManagement

Mail&PackageDelivery

HomeAppliances

OnlineVideo

   

Note: This table presents the 218 search categories that Nakazawa (2022) found most strongly related with economic activity in Japan.

 

Appendix Table 3: RMSE comparisons to prior literature

Model

RMSE

AR(1) [Kearns (2023)]

1.03 (5.66***)

Random Forest [Kearns (2023)]

0.96 (5.34***)

ARMAX [Kearns (2023)]

3.03 (4.82***)

Heikkinen AR(1)

1.699

Nakazawa Elastic Net

0.77

Woloszko

2.14

CBO Average

3.52***

*** Denotes pandemic-specific RMSE

 

The models that perform the best across the two evaluation metrics are the AR(1) model that includes traditional economic indicators, the random forest model, and the ARMAX model. And while these models perform the best among my set, their predictive ability is limited compared to similar models from previous studies. Other authors found more improvement with Google Trends data than I identified. However, it should be noted that any sub-national analysis would be expected to perform worse than a comparable national analysis because the data used to create Google Trends and traditional economic indicators are more volatile and limited. The models do not outperform Congressional Budget Office forecasts. The CBO model does not explicitly use Google Trends data, but it most likely utilizes some amount of high-frequency data that is unavailable to the public.

 

Appendix Figure 1: Volatility in smoothed Google Trends series

Volatility in smoothed Google Trends series

Note: This figure presents the unadjusted Google Trends index (in blue) and smoothed series (in red) for ‘Holidays and Seasonal Events’ for Rhode Island. Despite our smoothing procedure, the highly seasonal process that spikes around Christmas is so powerful that the Kalman Filter is unable to smooth properly. Thus, we also apply a LOESS function to smooth even further.

 

Appendix B: Technical appendix

Pulling Google Trends Data

We pull weekly Google Trends data for the 218 categories identified by Nakazawa (2022) and listed in Appendix Table 1. I access the official Google Trends API through the R package gtrendsR. Because the API will only report weekly historical data if the search period requested is no more than 5 years, I break the query for each state into two parts (from 2015 through 2019, and 2020 onwards). Code iterates over each state-category pair.

The Google API requires a few seconds between each query, so the code pauses for 5 seconds after each request. Additionally, Google limits a single IP address to 1500 queries per 24 hours, limiting the practical amount I could collect for this project. I pull data across three different machines. See the code implementation in my Google Folder.

There are several issues that one must correct to use the data. First, there are strong seasonal patterns (Seabold and Coppola 2015). The quality of the seasonal adjustment and smoothing will impact the model results. Second, it is important to note that the index is not of search volumes but of relative search interest benchmarked to a specific date in a five-year window (Eichenauer et al. 2021). For instance, a 100 in the Google Trends index for ‘Fast Food’ denotes the week in which search interest in fast food, perhaps accounting for 9% of all searches, was highest across all weeks in the five-year window, while an index level of 50 would indicate a week where relative search interest was half of the level in the the best week, accounting for 4.5% of all searches in that week. As such, one has to use long time windows to compare the index levels over time. Third, since the index is a sample for a given location, some search categories for a set of states may have low volume, leading to volatility in the data, as can be seen in Appendix Figure 1. A small state like Alabama will have fewer searches for categories relative to New Jersey, and its data is therefore more noisy. 

 

Initial data transformations

As explained in the data section above, the raw Google Trends index data is unsuited for direct analysis. Corrections need to be made to reduce noise, seasonal swings, and outliers. The first modification is to smooth out jumps in the series between December 2015 and January 2016 introduced by an external update to Google’s calculation methods. I do so by assuming the actual search intensity at the end of 2015 is equal to the search intensity in the beginning of 2016, allowing us to scale all 2015 data by the observed ratio of December 2015 search levels to January 2016. 

Second, I apply a Kalman Filter and Smoother to extract the signal from the seasonal series. The volatility of some series due to data sampling limitations dominates the seasonal adjustment process at times. I extract a LOESS-smoothed trend line for those series in the 75th percentile or above in overall median absolute week-over-week growth rate. Figure 2 presents some examples of Google Trends indexes after this process. Moving forward, I use the year-over-year percent change to increase the likelihood of having stationary or cointegrated series and remove any residual seasonality for seasonally-adjusted state GDP and Google Trends categories. I use the year-over-year arithmetic change in unemployment and labor force participation rate.

 

OLS autoregressive models

Following Heikkinen (2019), I begin with a simple AR(1) model to act as a baseline against which to measure my forecasts. I estimate versions of the following equation:

 

(1)

Model

 

Where  ΔYs,t represents the year-over-year percent change in GDP for state s in quarter t,  ΔEcons,t,j represents the average year-over-year change in a given traditional economic indicator j in state s during quarter t, and ΔGoogles,t,k  represents the average year-over-year percentage change in the seasonally adjusted and smoothed Google Trends index for category k in state s during quarter t. My baseline model regresses GDP growth only on its one-quarter lag, a classic AR(1) process. Additional specifications with the traditional and Google economic indicators are added for comparison in two extended AR(1) models. 

The advantages of an AR(1) model center on its parsimony. Its simplicity makes coefficients easy to estimate and interpret. However, with the number of Google Trends categories that I have access to, OLS may not be able to correctly run larger extensions. Additionally, an AR(1) model trained on pre-pandemic data may not be flexible enough to capture the swings in economic growth I document during the pandemic. 

ARMAX model

My ARMAX(1,1,1) model adds more complexity to the simple AR model, which may be able to capture more of the variation within states over time. I estimate the following equation:

(2)

MODEL 2

The ARMAX specification is largely similar to the AR(1) model with one distinct change. The one-quarter lag of the residual is added as a moving average term. For this context, one would expect ARMAX to perform better than the regular AR model, but is still not the most flexible model.

 

Regularized autoregressive model

Since I am working with a large number of noisy explanatory variables and less than 1000 observations across all states, regularization–penalizing the complexity of the model–can pare down the number of variables that end up in the final specification. Specifically, I minimize the following equation:

(3)

Model 3

 

 

Image removed.

Image removed.

Where the regression formula used to estimate the SSE is the AR(1) model with Google Trends as outlined in Equation (1). When running the pseudo-out-of-sample process (explained at the end of this section), I use 5-fold cross-validation to select the optimal values of alpha and the L1 penalty ratio. The final hyperparameters are 0.1 and 0.17 for alpha and L1, respectively.

 

Dynamic factor model

Another way to manage the number of explanatory variables is to extra the principal components from the matrix of Google Trends variables, and then replace the Google Trends variables in Equation (1) with then ten most important principal components. Similar methods are employed by Eichenauer et al. (2021), Richardson et al. (2018), Bantis et al. (2022), and Heikkinen (2019). 

The advantage of a factor model is that it greatly simplifies the specification and decreases the likelihood that results will be driven by outlier categories that are strongly related in my data only for this specific time period (for example, the term “tiger king”). However, I lose interpretability and the possibility of identifying certain search categories that are important for forecasting GDP.

 

MIDAS model

A mixed frequency data sample is an OLS regression method that combines data of different frequencies. In this instance, I collapse monthly economic indicators and weekly Google Trends growth rates onto the quarterly level, as defined by the following equation:

(4)

Model 4

Where each month or week in a given quarter is given its own coefficient, while the regression is run at the quarterly level. The elastic net method, as defined by Equation (3), is applied to limit the number of explanatory variables in the final regression. 

 

Random forest

A random forest is a conglomeration of decision trees, which are each trained on a random subset of the training data provided. The trees themselves are sets of nodes, each representing a test on the data, that split into branches and eventually leaves representing the outcomes of the tests. The average of the outputs given by each tree for a set of inputs (in our case, Google trends and assorted economic data) is the final prediction. 

We again use 5-fold cross-validation to select the optimal number of estimators, minimum samples per leaf, and the CCP alpha. I use RMSE as the statistic on which to optimize. The final hyperparameters are 20 estimators, a minimum of 6 samples per leaf, and a value of 0.00001 for CCP alpha. Random forests provide more flexibility and nonlinearity, but they are also computationally more intensive and require more tuning. They are also not designed with time series data in mind. 

 

Neural networks

A neural network is a machine learning algorithm composed of layers of ‘neurons’, which receive input data (either raw or from a previous layer of neurons), perform a computation on the data, and pass it on to the next layer; each neuron may have connections to many others among layers. Within the neurons, the computation performed depends on the activation function. In this case, the commonly used ReLU function (which unlike the sigmoid activation function, performs well in complex, nonbinary predictions) served as the activation function. The strengths of the connections between layers of the network are weighted, with the weights refined over the course of training. 

We use 5-fold cross-validation to select the optimal number layers, nodes, and dropout rate. I use MSE as the statistic on which to optimize. The final hyperparameters are 3 layers, 64 initial nodes, and a dropout rate of 0.2. ReLU is used as the activation function within the hidden layers, and the final activation function is linear, as is used in other regression-based machine learning models. Like random forests, neural networks provide more flexibility and nonlinearity, but they are the most computationally intensive. They are also not specifically optimized for time series analysis.

 

Recurrent neural networks

Recurrent neural networks (RNN) are types of neural networks that are designed to process sequential data. Unlike a feedforward neural network, a RNN can produce a series of outputs and uses a feedback loop to process the input sequence. Thus, the model is able to incorporate information from previous quarters when processing the current one. I specifically use a long short-term memory (LSTM) network, as explained by Hopp (2022). LSTM has distinct advantages in solving gradient issues found in other RNN, incorporating incomplete data vintages, and handling mixed frequency data. 

Due to computational limitations, I do not run cross-validation for this model. As hyperparameters, I use 13 timesteps (covering one full quarter, implicitly assuming that changes in Google Trends variables in the past do not influence current GDP beyond the lagged GDP variable), 10 models (the number of networks to train and predict on), and 50 training epochs.

 

Model evaluation

We employ two statistics to evaluate the models explained above. One, the pseudo out-of-sample RMSE, speaks to the ability of the model to explain GDP prior to the pandemic. This method is used, among others, by Heikkinen (2019) and Bantis et al. (2022). Starting with data for all states between Q1 2016 and Q1 2017, I estimate the model and forecast the current quarter’s GDP growth. Sequentially, I add additional quarters and recalculate the RMSE until the model has estimated up to Q1 2020. The overall RMSE is the average within-state RMSE across these quarters. 

The second statistic, the recession score, is implemented by Buell et al. (2021). I forecast GDP from 2020 through mid-2022 using the final model trained on pre-pandemic data. I calculate the average within-state RMSE. Note that I nowcast only for the current quarter; this is not a dynamic forecasting process. For the models that perform the best across these two metrics, I extend the pseudo-out-of-sample RMSE method to cover all data I have, as would be used during a real crisis. I wait until this stage to do this to avoid having more flexible models key in on variables that are only useful during the pandemic (e.g., “tiger king”). 

 

Shortfall calculation

I extrapolate the GDP growth predictions for Q2 2020 through to the end of Q4 2021 to simulate policymaker’s expectations of public finances during the spring of 2020. Using sales and income tax revenue elasticities (i.e., how much tax revenues are expected to decline when GDP declines), I calculate the expected decline in revenue for each quarter through the end of 2021 relative to revenue absent the pandemic. Taking my estimates from Figure 7 (the green line) as an example, the ARMAX model explained in the previous section implies a revenue shortfall of $57 billion during the first two quarters of 2020 and roughly $300 billion in total during 2020 and 2021. In other words, my model estimates state and local tax revenue was $57 billion lower by July 2020 than if the pandemic had not happened. Figure 7 compares three ‘real-time’ estimates of aggregate state and local government needs to the actual path of tax revenue during 2020 and 2021.