{'fraction_non_alphanumeric': 0.03426418011402068, 'fraction_numerical': 0.014532805101942216, 'mean_word_length': 4.792678831299676, 'pattern_counts': {'":': 1, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Nowcasting Growth using Google Trends Data: A Bayesian Structural Time Series Model

This paper investigates the benefits of internet search data in the form of Google Trends for nowcasting real U.S. GDP growth in real time through the lens of mixed frequency Bayesian Structural Time Series (BSTS) models. We augment and enhance both model and methodology to make these better amenable to nowcasting with large number of potential covariates. Specifically, we allow shrinking state variances towards zero to avoid overfitting, extend the SSVS (spike and slab variable selection) prior to the more flexible normal-inverse-gamma prior which stays agnostic about the underlying model size, as well as adapt the horseshoe prior to the BSTS. The application to nowcasting GDP growth as well as a simulation study demonstrate that the horseshoe prior BSTS improves markedly upon the SSVS and the original BSTS model with the largest gains in dense data-generating-processes. Our application also shows that a large dimensional set of search terms is able to improve nowcasts early in a specific quarter before other macroeconomic data become available. Search terms with high inclusion probability have good economic interpretation, reflecting leading signals of economic anxiety and wealth effects.


Introduction
The primary object of nowcasting models is to produce 'early' forecasts of target variables associated with long delays in data publication by exploiting the real time data publication schedule of the explanatory data set. While prediction is the primary goal here, the selected models can also sometimes provide structural interpretations ex post. Nowcasting is particularly relevant to central banks and other policymakers who are tasked with conducting forward looking policies on the basis of key economic variables such as GDP or inflation. Inflation data are, however, published with a lag of up to 7 weeks with respect to their reference period, and precise estimates of GDP can take years. 1 Since even monthly macroeconomic data arrive with considerable lag, it is now common to combine, next to traditional macroeconomic data, ever more information from Big Data sources such as internet search terms, satellite data, scanner data, etc. which have the advantage of being available in near real time (Bok et al., 2018). The recent Covid-19 pandemic has given further impetus to this trend, as faster indicators have proven especially useful in modelling the unprecedentedly sharp movements in the economy that traditional macroeconometric models fail to capture in a timely manner (Antolin-Diaz et al., 2021;Woloszko, 2020).
In this paper we add to the burgeoning literature on using Google search data in the form of Google Trends (GT), which measure the relative search volume of certain search terms entered into the Google search engine, to nowcast aggregate economic time-series. In particular, we investigate the benefits of using monthly Google search information for nowcasting quarterly U.S. real GDP growth in real-time compared to traditional macro data and survey information.
We contribute to this literature by being, to our best knowledge, the first paper to investigate the benefit of search information above and beyond macroeconomic data for the U.S. including performance during the Covid-19 pandemic period.
To deal with the specificities of the data, we propose robust nowcasting methods that are amenable to situations in which the policymaker needs to combine traditional and nontraditional data sources while providing tractable variable selection properties. For this purpose, we adapt current generation state space and regression priors to the widely popular Bayesian Structural Time Series model (BSTS) (Scott and Varian, 2014). Results from our nowcasting 1 The exact lag in publications of GDP and inflation depends as well on which vintage of data the econometrician wishes to forecast. Since early vintages of aggregate quantities such as GDP can display substantial variation between vintages, this is not a trivial issue. application show that Google's search information improves nowcasts of GDP growth, particularly early on in the quarter before macroeconomic data are published. We show that our extensions allow for accuracy gains of up to 40% during certain nowcast periods in point as well as in density nowcasts compared to the original BSTS model of Scott and Varian (2014) while retaining its interpretability. These results are confirmed in a simulation study which checks robustness to a variety of data-generating processes.
In the following, we firstly discuss the state and regression priors as well as posteriors for our extended BSTS models and provide efficient sampling algorithms. In section 3, we elaborate further on the data used for nowcasting, including dealing with mixed frequency, the data publication calendar and the specificities of the Google Trends data set. In section 4, we present results based on our empirical application of nowcasting U.S. GDP growth, which is followed in section 5 by the results from our simulation study. Finally, Section 6 concludes with a discussion and avenues for future research.

The Original Model
The Bayesian Structural Time Series (BSTS) model, as proposed by Scott and Varian (2014), provides a conceptually attractive model for nowcasting aggregate economic time-series with heterogeneous data sources, as it flexibly estimates latent time-trends, seasonality and deviations or 'irregular' dynamics through variable selection using a high-dimensional shrinkage prior. Denote the target variable to be nowcast by y t = (y 1 , · · · , y T ) and the K-dimensional explanatory data set as x t = (x 1 , · · · , x T ) which for now are sampled at the common frequency, t. Then our model is as follows: (1) is a linear state space model with Gaussian errors and states {τ t , α t , δ t } T t=1 which capture long-run trends and S seasonal components δ t . The deviation from τ t describes variation from a long-run trend which, when applied to the level of GDP can be interpreted as the output gap (Watson, 1986;Grant and Chan, 2017). α t allows for a drift term in the trend which is often observed in stock variables such as in GDP, aggregate consumption and inflation (Grant and Chan, 2017;Chan, 2017b).
Variable selection on the possibly high-dimensional K × 1 response vector β in the BSTS model of Scott and Varian (2014) is done via a two component conjugate spike-and-slab prior.
Estimation is standard (George and McCulloch, 1993), and states τ t , α t and δ t are estimated jointly via the forward filtering backward sampling (FFBS) algorithm of Durbin and Koopman (2002) based on the Kalman filter. This implementation relies on Normal-Inverse Gamma (N-IG) priors for the states and state variances for conditional conjugacy. While the BSTS model is a natural model for many time-series applications, we bring 3 important methodological innovations which make it more robust to overfitting trend estimation and variable selection with heterogeneous high dimensional data.

Model enhancements 2.2.1 Non-Centred Bayesian Structural Time Series
In line with previous nowcasting studies, this paper focuses on nowcasting GDP growth rather than levels. However, two problems arise when applying model (1) directly to growth variables.
As growth variables are often approximately stationary, conceptually, the inclusion of α t implies that GDP growth follows a boundless drift for which there is little structural justification or empirical evidence. A non-drifting stochastic trend, on the other hand, has been shown to markedly improve nowcasts of GDP growth as shown in Antolin-Diaz et al. (2017), especially when the state variances are tightly controlled by priors such that the stochastic trend does not wander too wildly. This suggests that modeling time-variation is preferred over de-trending a priori. 2 The underlying rationale for this improvement is the well known empirical finding of changes in long-run GDP growth (Kim and Nelson, 1999;McConnell and Perez-Quiros, 2000;Jurado et al., 2015). Econometrically, the additional problem is that the IG priors with no prior mass on zero, as implemented for Bayesian linear state space methods, can bias posterior state variances away from zero, thereby potential leading to false support for state dynamics which can hurt forecast performance.
2 Modelling an I(1) component in U.S. GDP growth is additionally consistent with Harvey's local-linear trend model (Harvey, 1985), the Hodrick and Prescott (1997) filter and Stock and Watson (2012).
We extend model (1) to flexibly let the data shut down state dynamics, and therefore broaden the applicability of model (1), by adopting the non-centred parameterisation of the state space as suggested by Frühwirth- Schnatter and Wagner (2010). The non-centred parameterisation models state variances directly in the observation equation, which with normal priors, exerts much stronger shrinkage than IG priors. 3 This allows additionally for valid inference on testing for zero posterior variance via Savage-Dickey density ratios, as will be further discussed in section 5. Testing for zero posterior variance would be very challenging in a frequentist hypothesis testing approach because the null hypothesis of constant state in model (1) lies on the boundary of the parameter space.
The non-centred model considered for the empirical application is equivalently written as: with starting valuesτ 0 =α 0 = 0. Note that the seasonal component is left out for estimation due to the small sample length of the Google Trends data set and differing seasonal patterns between monthly and quarterly data. 4 To see that (2) and (3) is equivalent to (1), let: Hence, by setting y t = τ t + x t β + t , it is clear that which recovers (1). Since σ τ,α are allowed to have support on the real line, they are not identified in multiplication with the states: the likelihood is invariant to signs of σ α and σ τ . Consequently, 3 Formally, a normal prior on the state standard deviation can be shown to imply a Gamma prior on the state variance. 4 For further discussion, please see section 3 mixing of the posterior state standard deviations can be poor and their distributions are likely to be bi-modal (Frühwirth-Schnatter and Wagner, 2010). This issue is addressed by randomly permuting signs in the Gibbs sampler as explained below. Similar to Frühwirth-Schnatter and Wagner (2010), we assume normal priors centred at 0 for σ i : Collecting all state space parameters in θ = (τ 0 , α 0 , σ τ , σ α ), we assume an independent multivariate normal prior with diagonal covariance matrix: While the state processes {τ ,α} T t=1 can be estimated by any state space algorithm, we opt for the precision sampler method of Chan and Jeliazkov (2009) which is outlined in Appendix (A.4.1) along with the state posteriors. In contrast to FFBS type algorithms, it samples the states without recursive estimation which speeds up computation significantly.

SSVS Prior
Our second enhancement concerns the SSVS prior. Variable selection in the BSTS model of Scott and Varian (2014) is done via a two component conjugate spike-and-slab prior which utilises a variant of Zellner's g-prior and fixed expected model size. While computationally fast due to conjugacy, many high-dimensional problems benefit from prior independence (Moran et al., 2018) and a fully hierarchical formulation to let the data decide on the most likely value of the parameters (Ishwaran et al., 2005). Therefore, we follow Ishwaran et al. (2005)'s extension to the SSVS prior, the Normal-Inverse-Gamma prior: where j ∈ (1, · · · , K). The intuition remains the same as compared to the spike-and-slab prior of Scott and Varian (2014) in that the covariate's effect is modeled by a mixture of normals where it is either shrunk close to zero via a narrow distribution around zero (the spike component) or estimated freely though a relatively diffuse normal distribution (the slab component).
Sorting into each component is handled through an indicator variable, γ j , and the hyperparameter c is chosen to be a very small number, thereby forcing shrinkage of noise variables to close to zero. While in the original BSTS model, the indicator variable, γ j , depends on a fixed prior π 0 which governs the prior inclusion probability of a variable, (7) allows for it to be estimated from the data through another level of hierarchy. We set b 1 = b 2 = 1, which effectively assumes that any expected model size is a priori possible and thus allows for sparse but also dense model solutions as recommended by Giannone et al. (2021). Finally, the prior variance δ 2 j is also allowed to be hierarchical. Posteriors are standard and described in the Appendix (A.1).
The posterior of γ j is of special interest to the analyst as it gives a data informed measure of importance of a variable. Specifically, p(γ|y) can be interpreted as the posterior inclusion probability of a variable.

Horseshoe Prior
Our third and final enhancement of the BSTS models extends the employed shrinkage priors to the horseshoe prior. Like many recently popularised shrinkage priors, the horseshoe prior belongs to the broader class of global-local priors which take the following general form: The idea of this family of priors is that the global scale ν controls the overall shrinkage applied to the regression, while the local scale λ j allows for the local possibility of regressors to escape shrinkage if they have large effects on the response. A variety of global-local shrinkage priors have been proposed , but here we focus on arguably the most popular, the horseshoe prior of Carvalho et al. (2010) which employs two half Cauchy distributions for ν and λ j : These two fat tailed scale distributions imply a shrinkage profile that has the spike-and-slab prior in its limit and therefore offers a continuous approximation to the SSVS (Piironen et al., 2017) (see section A.2 in the appendix for further discussion). An additional attractive feature of the horseshoe prior is that it is completely automatic with respect to its hyperparameters and has been shown to be excellent at forecasting in several previous studies (Huber et al., 2019(Huber et al., , 2020Cross et al., 2020;Follett and Yu, 2019). Due to its special connection to frequentist shrinkage priors , it offers not only good finite sample performance but also favourable asymptotic behaviour compared to competing global priors (Bhadra et al., 2019). Chakraborty et al. (2020) in particular show that the fractional posterior mean as a point estimator is rate optimal in the minimax sense using (9).
Nevertheless, fitting the horseshoe prior can be challenging when the scale parameters are not strongly identified by the data, which is particularly critical in cases where the likelihood is flat, for example, separable data in logistic regression (Piironen et al., 2017). 5 We provide in the appendix a (A.2) robustness check based on Piironen et al. (2017) that are able to alleviate any identifiability concerns for the empirical study below.
Posteriors are described in the appendix (A.1).

SAVS Algorithm
Although the horseshoe prior shrinks noise variables towards zero, the importance of a variable for nowcasts may not be immediately clear from posterior summary statistics of the coefficients, especially when the posterior is multi-modal. To aid interpretability and simultaneously preserve predictive ability, we employ the signal adaptive variable selection (SAVS) algorithm of Ray and Bhattacharya (2018) to the posterior coefficients on a draw-by-draw basis. The algorithm uses a useful heuristic, inspired by frequentist lasso estimation, to threshold posterior regression coefficients to zero: where X j = (x j1 , · · · , x jT ) is the j th column of the regressor matrix X, sign(x) returns the sign of x andβ represents a draw from the regression posterior. The parameter κ j in (10) acts as a threshold for each coefficient akin to the penalty parameter in lasso regression which can be selected via cross-validation. Ray and Bhattacharya (2018) propose which ranks the coefficients inverse-squared proportionally and provides good performance compared to alternate penalty levels (Ray and Bhattacharya, 2018;Huber et al., 2019). To see the 5 We thank an anonymous reviewer for having facilitated this discussion.
similarity to lasso style regularisation, the solution to (10) can be obtained by the following minimisation problem which is closely related to the adaptive lasso (Zou, 2006): Here, φ is the sparsified regression vector. Analogous to the SSVS posterior, the relative frequency of non-zero entries in the posterior coefficient vector can be interpreted as posterior inclusion probabilities. Integrating over the uncertainty of the parameters, we obtain the predictive distribution p(ỹ|y), which is similar to a Bayesian Model Averaged (BMA) posterior (Huber et al., 2019).
Step 4 of the sampler will depend on the prior and its respective hyperpriors. While the posterior sampling scheme for the SSVS is standard, we use the efficient posterior sampler of Bhattacharya et al. (2016) to sample the regression coefficients of the horseshoe prior. Compared to Cholesky based sampling as used for the SSVS, computation speed is markedly improved; see Appendix A.1.1. Note that in step 4, we perform SAVS sparsification via (10) on an iteration basis.

Mixing Frequencies
In this paper, we relate monthly macro data commonly used for nowcasting based on Giannone et al. (2016) and internet search information via U-MIDAS skip-sampling to real quarterly U.S. GDP growth. The U-MIDAS approach to mixed frequency belongs to the broader class of 'partial system' models (Bańbura et al., 2013), which directly relate higher frequency information to the lower frequency target variable by vertically realigning the covariate vector.
The benefit of this mixed frequency method compared to restricted MIDAS and full system state space methods is its simplicity in that existing models and priors can directly be applied to U-MIDAS sampled data as well as its competitive performance, especially when the frequency mismatch between the target and the regressors is small (Foroni et al., 2015;Foroni and Marcellino, 2014), as is the case in our application. Switching notation from equation (1) to make it explicit that y t is quarterly while x t is sampled at a higher, i.e., monthly frequency, denote x t,M = (x 1,t,M , · · · , x K,t,M ) and β m = (β 1,M , · · · , β K,M ) where M = (1, 2, 3) denotes the monthly observation of the covariate within quarter, t. By concatenating each monthly column, we obtain a T × 3K regressor matrix X and a 3K × 1 regression coefficient vector β. This vertical realignment is visualised for a single representative regressor below:

Macroeconomic Data
The macro data set pertains to an updated version of the database of Giannone et al. (2016) (henceforth, 'macro data') which contains 13 time series which are closely watched by professional and institutional forecasters including real indicators (industrial production, house starts, total construction expenditure etc.), price data (CPI, PPI, PCE inflation), financial market data (BAA-AAA spread) and credit, labour and economic uncertainty measures (volume of commercial loans, civilian unemployment, economic uncertainty index etc.). We augment this data set with the composite Purchasing Managers Index (PMI) and the University of Michigan Consumer Confidence Index (UMCI). These are often used as leading indicators for producer and consumer sentiment, respectively. The target variable for this application is deseasonalised U.S. real GDP growth (GDP growth) data as reported in the FRED dataset. 6,7 As early data vintages of macroeconomic data and GDP figures can exhibit substantial variation compared to final vintages (Croushore, 2006;Sims, 2002), there is no unambiguous choice of variable in evaluating nowcast models on historical data. Further complications can arise through changing definitions or methods of measurements (Carriero et al., 2015). In order to judge the expected performance of the proposed models from a real-time perspective, we only make use of the latest vintages of the series available at the point in time of the nowcast.
8 The stylised release calendar (1) simulates the data availability within the months during which nowcasts are conducted. For instance, at the 24th nowcast period, all data which became available during periods 1-24 will be updated according to their latest available vintages dating prior to the release of PCE and PCEPI, which are published typically during the last week of a given month. Real-time vintages are downloaded from the FRED database using the 'FredFetch' Matlab package. 9

Google Trends
Google Trends (GT) are indices produced by Google on the relative search volume popularity of a given search term, search topic or pre-specified search category, conditional on a given time frame and location. The difference between individual search terms and topics/categories is that the latter measures the search popularity for a basket of search terms which are content-wise related to the specified topic or category. In particular, categories are further split into a 5-level hierarchy of categories which are fixed a priori, 10 and topics can be assembled depending on the 6 Here, the deseasonalisation pertains to the X13-ARIMA method and was performed prior to download from the FRED-MD website. 7 We thank an anonymous reviewer who brought to our attention that instead of mixing pre-deseasonalisation techniques between macroeconomic data and Google Trends discussed below, one could also deseasonalise with common techniques such as the Loess filter. In doing so, the results in this paper remain qualitatively identical.
Details are available upon request. 8 The only exception is real GDP growth, for which, following previous nowcast studies (Carriero et al., 2015;Clark, 2011), we use the second vintage for nowcast evalutation. 9 The Matlab package is available from https://github.com/MattCocci/FredFetch. PMI data were downloaded from quandl.com using Quandl code 'ISM/MANPMI'. 10 For an overview of categories and sub-categories, please see https://github.com/pat310/ google-trends-api/wiki/Google-Trends-Categories term one is interested in. For example, the user can specify the topic 'Recession', whose related search queries contain, among others, 'recession', 'downturn', and 'economic depression'. Likewise, the category 'Welfare & Unemployment' relates to search queries about 'unemployment, 'food stamps' and 'social security office'. A large literature on using individual Google Trends search terms 11 have shown that these data can improve predictions for economic time-series which have a clear connection to the specific search term used, such as using 'unemployment benefits' to predict unemployment (Smith, 2016). However, this approach has two potential limitations.
First, using broad search terms to capture general macroeconomic activity bears the risk of capturing spurious search behaviour. For example, the search term 'jobs' might contain search volume for 'Steve Jobs'. Second, since many search terms will be related to multiple topics, there may be lack of interpretability. To reduce search term ambiguity and interpretability in relationship to real GDP growth, we use Google topics and categories instead of individual search terms, and choose these based on their relationship with various aspects of the economy.
As forcefully argued by Woloszko (2020) and Fetzer et al. (2020), these mostly alleviate spuriously correlated search terms as the user can confine the search purpose. This is benefited by the fact that Google refines this basket of search terms, by taking into account where users click after the search has been conducted Woloszko (2020). Further, categories and topics can be conceptualised as factors based on search terms with the same meaning/purpose. Although the exact basket of search terms corresponding to a topic/category is not a priori accessible to the user, any topic or category with little predictive power will ultimately be shrunk to zero via the shrinkage priors employed in the proposed models.
Our sample comprises 37 Google Trends which were chosen based on capturing activity in various parts of the economy ranging from crisis/recession, labour market, personal finance, consumption to supply side activities. 12 Our chosen list of topics and categories is as follows: • Crisis/Recession: topic -Economic crisis, topic -Crisis, topic -Recession   2005; Askitas and Zimmermann, 2009); and (iv) root terms, which similarly specify a list of search terms through backward induction, but additionally download "suggested" search terms from the Google interface. This serves to broaden the semantic variety of search terms in a semi-automatic way. As methodologies based on pure correlation do not preclude spurious relationships (Scott and Varian, 2014;Niesert et al., 2020;Ferrara and Simoni, 2019), we opt for our (somewhat subjective) selection to best guarantee economically relevant Google Trends.
Since search terms can display seasonality, we deseasonalise all Google Trends by the Loess filter, as recommended by Scott and Varian (2014), which is implemented with the "stl" command in R. 14 Although one of the main benefits of Google Trends is their timely availability, which can be as granular as displaying search popularity minutely for the past hour, the purpose of the empirical application is to showcase the flexibility of the proposed models in taking advantage of the heterogeneous information contained in adding new data sources to traditional macroeconomic data, even with little data processing efforts. Due to the simplicity of obtaining monthly Google Trends information, we sample the Google Trends information at the monthly frequency. Nevertheless, the proposed methodology can easily be extended to update monthly Google Trends with higher frequency search information via bridge methods as in Ferrara and Simoni (2019) or could directly be included in the model via expansion of the covariate matrix. 15 The indicative real-time calendar can be found in Table 1 and has been constructed after the data's real publication schedule. It comprises a total of 37 nowcast periods which make for an equal number of information sets Ω v t for v = 1, · · · , 37 which are used to construct nowcasts as explained in Section 4. Google Trends are treated as released prior to any other macro information pertaining to a given month, since as argued, Google Trends information can essentially be continuously sampled.  = refers to data for the given month within the reference period, m-1 = refers to data with a months' lag to publication in the reference period, m-2 = refers to data with 2 months' lag to publication in the reference period.

Understanding Google Trends
To get a visual understanding of the Google search information, we plot in figure (1) the first 3 principal components of the U-MIDAS transformed Google Trends information. Figure (2) shows the factor loadings.

Relationship Between Macroeconomic and Google Search Data
Understanding further how the skip-sampled Google Trend series correlate with the macro data set may help us anticipate which information will likely be picked up in the model. Figure (3) shows a correlation heatmap between the macro data set and the first three Google Trends principal components. Please note that an increase in the UMCI and PMI indicate improved consumer and producer sentiments, respectively.
As expected, the first rather procyclical component correlates highly with the fed-funds rate which tends to also rise with the business cycle. The second component is strongly positively correlated with the UMCI index and negatively with the BAA spread (which increases during deteriorating financial conditions), indicating that it indeed captures something close to congovernment policies had. are generated from the posterior predictive distribution p(y T +1 |Ω v T ) for growth observation y T +1 , conditional on the real-time information set Ω v T , where (v = 1, · · · , 37) refers to nowcast 17 As a further alternative to the proposed BSTS models, we investigate in the appendix as well whether past GDP growth dynamics are more appropriately (in terms of nowcasting) modelled via ARMA components. The results show that the LLT components within the BSTS model are clearly preferred over ARMA type dynamics.
We thank an anonymous reviewer for making this suggestion.
periods within the real-time calendar (Table 1). This results in 37 different nowcasts which are generated on a rolling basis until the end of the forecast sample, T end . As recommended by Carriero et al. (2015), variables that have not yet been published until nowcast period v are zeroed out.
Point forecasts are computed as the mean of the posterior predictive distribution and are compared via real time root-mean-squared-forecast-error (RT-RMSFE) which are calculated for each nowcast period as: whereŷ is the mean of the posterior prediction for nowcast period v using information until T + j − 1.
Forecast density fit is measured by the mean real-time log-predictive density score (RT-LPDS) and real-time continuous rank probability score (RT-CRPS): where, for brevity of notation, ζ 1:T +j−1 collects all model parameters as defined for each model, which are estimated with expanding in-sample information until T + j − 1 and M stands for iterations of the Gibbs sampler after burn-in. Note that in (16) (Gneiting and Raftery, 2007)  Finally, to test whether a state variance is equal to zero, we make use of the Dickey-Savage density ratio evaluated at σ τ,α = 0: It can be shown that for nested models, the DS statistic is equivalent to the Bayes factor between the prior and the posterior distribution of the parameter of interest at zero (Verdinelli and Wasserman, 1995). The intuition for the test is simple: if the prior probability-densityfunction (PDF) allocates more mass at 0 than the posterior at that point, there is evidence in favour of the unrestricted model, i.e., σ τ,α = 0. While the priors for the state variances have well known forms and thus can be evaluated analytically, we estimate the denominator for all models through Monte Carlo integration. Figure 4 shows the in-sample cumulative-one-step ahead prediction errors using the proposed priors where the information set pertains to the entire estimation sample without ragged edges.

In-Sample Results
From Figure 4, it is clear that the horseshoe prior BSTS (HS-BSTS) provides the best in-sample predictions at all time periods. The HS-BSTS-SAVS and SSVS-BSTS initially provide similar fit, however diverge in performance around the financial and Covid-19 crises, especially the HS-SAVS-BSTS. It is striking that, compared to the former two, the HS-BSTS provides very 18 We do not report calibration tests, as there are too few out-of-sample observations to meaningfully determine calibration. 19 Although the CRPS is a symmetric scoring rule, it penalises outliers less aggressively than the log-score which is of advantage in small forecast samples such as ours. 20 The Kalman filter provides conditionally optimal forecast densities in terms of squared forecast error.
However, if there is mispecification or if the forecast horizon is very short, then approximate methods can do just as well empirically. A similar logic holds when comparing direct and iterative forecasting methods such as in Marcellino et al. (2006). We thank an anonymous reviewer for bringing this to our attention. stable performance as indicated by a nearly linear increase in errors even during the financial crisis and the Covid pandemic. It is also apparent that the SAVS algorithm is not able to retain the fit of the HS prior alone, which, as we show in the next subsection, is in contrast to the out-of-sample results.   Conversely, 'investing' items are presumably searched more often when households and individuals are financially more stable which is when they engage in looking for investment opportunities. As seen in Figure 27, this series tends to positively correlate with the business cycle. This interpretation of the investment topic corroborates findings of Woloszko (2020) who show that the investment topic has a positive impact in a panel data nowcasting exercise for GDP growth. pertain to the macroeconomic data set, and to the right, the Google search data. The HS prior tends to display substantial uncertainty over inclusion, particularly for the Google Trends data, which makes sense given the similarity in signal within Google Trends categories and topics. By contrast, the SSVS tends to load only on a few Google search items and not explore posteriors of correlated GTs.
Nonetheless, the fact that the HS prior identifies individual macroeconomic series such as 'pce2' as a clear signal indicates that mixed frequency information matter for predictive purposes, which would otherwise be lost in averaging information across quarters.
These results contribute to the recently popularised studies of sparsity within economic prediction problems (Giannone et al., 2021;Cross et al., 2020) in at least two ways. Firstly, they indicate that different sparsity patterns can emerge within data sources (here, macroeconomic Finally, our in-sample results clearly demonstrate (Figure 9) that there is support in the data for a local trend, but not a local linear trend: the posterior for σ τ is clearly bi-modal with less mass on zero than the prior, while the posterior for σ α has substantially more mass on zero than the prior. The Bayes factors are 28.69 and 0.42 for the state standard deviations respectively.

Nowcast Evaluation: Pre-Pandemic period
We now turn to out-of-sample nowcasting performance, where nowcasts are produced following the real time data publication calendar as explained in Section 2. Due to the extraordinary economic circumstances of the Covid-19 pandemic, we split the evaluation sample into: (a) pre-Covid (ending Q4 2019); and (b) during Covid (ending Q2 2021). We first evaluate pointand then density fit for the pre-Covid period.
RT-RMSFE are plotted in Figure 10 for the competing non-centred BSTS estimators, as well as the AR (4)  consequently poor nowcasting performance.

Nowcast Evaluation: During the Pandemic
The pre-Covid results highlighted that the value of Google Trends are largest before any macroeconomic information are available for the given quarter. While the aim of the nowcasting application for the proposed models is not to provide very granular (weekly or higher) nowcasting models, 24,25 we now illustrate briefly how, even at the relatively coarse monthly level, Google search information improves predictions during the pandemic.

An Extension to Student-t Errors
It is also clear that both models struggle to nowcast the equally large upswing that follows the pandemic trough. Inspired by recent VAR forecasting literature during the pandemic (Lenza and Primiceri, 2020;Carriero et al., 2021), we also explore a new BSTS model based on fatter tailed t-distributed errors. The logic behind models with fat tails (compared to those of the normal distribution) is to acknowledge that the large macroeconomic fluctuations, for example 24 Higher frequencies would expand the covariate set within the U-MIDAS sampling framework even further.
At higher frequencies, predictions could instead be based on single covariates and combined, for example via Bayesian model averaging, or alternatively the frequency weights could be constrained via lower parametric basis functions which is akin to conventional MIDAS estimation. 25 See Woloszko (2020) for a panel data approach to a weekly GDP index based on Google Trends. However, we assume t ∼ N (0, σ 2 ψ t ), where ψ t is distributed as G −1 (η/2, η/2) where G −1 denotes the inverse-Gamma distribution and η the degree of freedom parameter of the t-distribution.
Smaller degrees of freedom indicate fatter tails. To estimate the BSTS-t model, we leverage a mixture representation of the t-distribution for which derivations and sampling steps are detailed in appendix (A.5). Treating η as a random variable, figure (23), based on the whole estimation sample shows that there is clear evidence for fatter tails, which are mostly due to the large outliers during the Covid pandemic. The nowcasts from this model ( Figure 14) show that, in line with the finding of small posterior degrees of freedom for the error distribution, the forecast intervals are much wider compared to the normal BSTS models. The lower forecast interval now captures the trough during the pandemic already in the 15th nowcasting period. Surprisingly, we find that the t-model's mean prediction comes much closer to GDP growth realisation at the height of the recession in period 27. In fact, the additional nowcast period forecasts in Figure (24) show that already with the third publication of the Google search information within Q2 2020, we see a large downward adjustment which had not materialised in period 24 before the GT release.
The posterior inclusion probabilities (22) in the appendix reveal that this is because the model loads less heavily on PCE inflation of the first month ('pce2') which had not reacted much until Q2 2020, as opposed to the Google Trends and construction starts data. Yet, this new model still struggles with the upswing and presents the trade-off that even pre-Covid the predictive uncertainty is very large compared to the normal BSTS models. We believe that future research may investigate whether and how different data and modelling techniques are able to accurately forecast not only the trough, but also the peak after sharp downturns.

Simulation Study
The empirical application above showed that the proposed BSTS models perform better in point as well as density forecasts compared to the original model of Scott and Varian (2014) and that both the SAVS augmented horseshoe prior as well as the SSVS-BSTS exhibit a relatively sparse selection of macroeconomic data. This finding is in contrast to previous studies using macroeconomic data such as Giannone et al. (2021) and Cross et al. (2020) who find that priors yielding dense models generally outperform sparsity favouring priors. Since an innovation in this paper is the estimation of a latent local-linear trend which might filter out co-movement in the macroeconomic data, we compare the ability of the proposed priors to the original BSTS model (Scott and Varian, 2014) in capturing both sparse and dense environments. Further, to make the simulations closer to our empirical application, we additionally test the priors' ability to detect zero state variances.
Specifically, we simulate local-linear-trend models as (2)-(3) having either the trend variance or the local trend variance set to zero, both equal to zero, or neither equal to zero. Accordingly, we generate 20 simulated samples for (σ τ , σ α ) = {(0.5, 0), (0, 0.5), (0, 0), (0.5, 0.5)} together with either a dense or a sparse DGP, where the sparse coefficient vector is set to β sparse = (1, 1/2, 1/3, 1/4, 1/5, 0 K−5 ) and the dense coefficient vector is where p d is set to 2/3. For both coefficient vectors, the dimensionality, K, is set to 300 which is high dimensional compared to the number of observations T = 150. We account explicitly for mixed frequencies by first generating the covariate matrix according to a multivariate normal distribution with mean 0 and a covariance matrix with its (i, j) th element defined as 0.5 |i−j| and then skip-sample each covariate individually after the U-MIDAS methodology as in (13) whereβ refers to the mean of the posterior distribution. We estimate the original BSTS model with the expected model size, π 0 , equal to the true number of non-zero coefficients.
Sparse Dense (σ τ , σ α ) (0.5,0) (0.0.5) (0.5,0.5) (0,0) (0.5,0) (0,0.5) (0.5,0.5) (0,0)  As can be seen from Table 2, both the non-centred BSTS models as well as the original BSTS model of Scott and Varian (2014) do better in sparse than in dense DGPs which is similar to the finding of Cross et al. (2020). The largest gains of the proposed BSTS models over Scott and Varian (2014) can be found for dense DGPs where the proposed estimators offer gains in estimation accuracy well in excess of 50% . In sparse designs, however, the latter slightly outperforms the former. This is expected given that the spike-and-slab prior uses a point mass prior on zero and that the true expected model size is used. At the same time, it is encouraging that the differences in accuracy are very small. Among the proposed estimators in dense designs, the HS prior BSTS versions are 30-40% more accurate compared to the SSVS-BSTS which is in line with our findings from the empirical application. Hence, these results offer the conclusion that continuous shrinkage priors are clearly preferred over spike-and-slab models in dense DGPs with a latent local-linear trend component.
The Dickey-Savage density ratio tests confirm that the non-centred state space models are able to correctly identify which of the state variances are significant and which are not, even in high dimensional regression settings. However, the test is sensitive to correctly pinning down the regression coefficient vector: in dense designs, where the SSVS prior does worse than the horseshoe prior, the DS tests in cases (0,0.5) and (0,0) show false support for significant σ τ . 27

Conclusion
In this paper, we investigated the added benefit of including a collection of Google Trends (GT) topics and categories in nowcasts of U.S. real GDP growth through the lens of currentgeneration Bayesian structural time series (BSTS) models. We extended the BSTS of Scott and Varian (2014) to a non-centred formulation which allows shrinkage of state variances to zero in order to avoid overfitting states and therefore let the data speak about the latent structure.
We further extended and compared priors used for the regression part which are agnostic about the underlying model dimensions to accommodate both sparse and dense solutions, as well as the widely successful horseshoe prior of Carvalho et al. (2010). To make the posterior of the horseshoe prior interpretable, we applied sparsifying algorithms borrowed from the machine learning literature, which improve upon the excellent fit of the horseshoe prior itself.
We find that Google Trends improve point as well as density nowcasts in real time within the sample under investigation, where largest improvements appear prior to publication of macroeconomic information. This finding is robust across all considered models. The highest posterior inclusion probability for prediction of GDP growth across all models is obtained with the Google topics/categories 'business news' and 'investing'. The time-series dynamics and model impact of these GTs suggest that they provide timely signals of economic anxiety and wealth effects, respectively. Structural implications of this finding may be investigated with larger Google Trend samples and for other countries. The superior performance of the proposed models over the original BSTS model is confirmed in a simulation study which shows that among the proposed models, the horseshoe prior BSTS performs best and the largest gains in estimation accuracy can be expected in dense DGPs. It is further confirmed that the non-centred state priors are able to correctly identify the latent structure, however they are sensitive to the efficacy of the regression prior to detect signals from noise.
Finally, we applied our models to the Covid-19 pandemic period and find that Google Trends information help characterise the uncertainty during the Covid recession and subsequent recovery period. An extension of the BSTS model to student-t errors is also shown to benefit the timeliness of the forecast revisions to the changes in the macroeconomic data.
Our work suggests some important avenues for future research. An aspect which remained the state variance has no mass on zero and therefore is not testable.
unexplored in this study is that Google Trends might have time varying importance in relationship to the macroeconomic variable under investigation, as highlighted by Koop and Onorante (2019). Search terms can be highly contextual and might therefore be able to predict turning points in some periods but not in others. While, given the limited quarterly observations of Google Trends, our current investigation of this research question is somewhat limited, this will improve in significance over time. Also, nowcasting in contexts where the design is partly dense and partly sparse is a challenging problem. Our work sheds some light on this question, but it also motivates further research in this direction.
Algorithm 1 Fast Horseshoe Sampler 1: Sample independently u ∼ N (0, D) and δ ∼ N (0, I T ) 2: Set ξ = Φu + δ 3: Solve (ΦDΦ + I T )w = (α − ξ) The posteriors of the scales (ν, λ) are non-standard and need different treatment. We follow Polson et al. (2014) who propose an efficient slice sampler. In particular, define η j = 1/λ 2 j and µ j = β j /(σν). Then, the conditional posterior distribution for η j takes the following form: The slice sampler is then implemented as follows: 1. Sample u j |η j uniformly in the interval (0, 1/(1 + η j )) 2. Sample η j |µ j , u j ∼ exp(2/µ 2 j ), truncated to have zero probability outside (0, (1 − u j )/u j ). Now, transforming back to λ j yields a direct draw from its posterior distribution and by setting η = 1/ν 2 and replacing µ 2 j = β 2 j /2 yields an equivalent draw from the conditional posterior of ν. The advantages of the slice sampling algorithm include: its simplicity; that it involves no rejections; and that it requires no external parameters to be set.

A.2 Robustness Check for the Horseshoe Prior
The Cauchy distribution can be a challenging distribution to fit. Due to no analytically available moments, a posterior distribution in which the prior information dominates the likelihood, Cauchy priors might induce vanishing posterior moments (Ghosh et al., 2018;Piironen et al., 2017). Piironen et al. (2017) provide a way in which potential problems due to weak identification can be diagnosed, which is based on the prior induced effective model size distribution.
Assuming a scale mixture of normal prior such as (2.2.3), the conditional posterior p(β|Λ * , τ, σ 2 , y) within a normal linear regression can be written as: where and β j andβ j refer to the mean of the posterior for β j |• and the maximum likelihood solution respectively. κ j can be regarded as a shrinkage coefficient as it is defined over the unit interval and therefore dictates how much shrinkage is applied to the maximum likelihood solution. It is easy to verify that when λ j ν → ∞, then κ j → 0 and when λ j ν → 0, then κ j → 1. The distribution of the shrinkage coefficient p(κ j |Λ * , ν, σ 2 , y) is implicitly defined through the priors for the hyperparameters (Λ, ν). By applying the change of variable theorem, it can be shown that for the horseshoe prior, this distribution is proportional to B(0.5, 0.5). In fact, by plotting this distribution alongside the distribution implied by a spike-and-slab prior with zero pointmass spike and slab with infinite scale, the horseshoe prior provides a continuous approximation to the SSVS. Now, by summing over the shrinkage coefficients in (28), the authors provide a measure of "active regressors": m ef f = (1 − κ j ), i.e. large slopes, which are used to illicit a prior for Since, as discussed above, the prior predictive distribution of m ef f diverges to K, weak identification of either the local or global scale parameters would lead to a divergent posterior m ef f distribution, which we use as a diagnostic tool.
However, some caveats must be highlighted: (1) the number of active coefficients formulation is derived from the conditional posterior, and hence does not account for uncertainty in (ν, σ 2 ); and (2) it makes further two strong assumptions: the covariates are uncorrelated and the maximum likelihood solution to β exists. Hence, caution should be exercised in taking this approach at face value with high-dimensional macro data, which have typically large crosssectional correlation.
Nevertheless, we provide in Figure  the HS-BSTS model based on the entire sample without ragged edges. As the figure clearly shows, the effective model size is not divergent to K and is very similarly distributed to the SAVS model size distribution. Hence, for the HS-BSTS model, there is no indication of weakly identified posterior scale processes.

A.3 ARMA vs LLT Estimation
While the nowcasting exercise has demonstrated the statistical support for a local-linear-trend model, and hence support for shifts in the long-run rate of GDP growth, it is an important question as to whether GDP dynamics within a high-dimensional regressor setting is better modelled via ARMA components.
Hence, we also estimate the regression as in the paper, but with ARMA components instead of a LLT. The model considered is: where |ψ| < 1 for identification purposes and {u t } T 0 ∼ N (0, σ 2 ). The posterior for the AR coefficients is modelled via the horseshoe prior. We further assume a uniform prior on the interval (-1,1) for ψ ∼ U(−1, 1). To estimate the ARMA components, we follow Chan (2017a) by using a band and sparse matrix representation which allows for very fast computation by avoiding recursive algorithms. The order of the ARMA components are chosen via the best out-of-sample performance.   large data set captures large troughs and peaks, such as during the financial crisis. By contrast, the ARMA component is of very small magnitude and displays erratic short-run movements.
This suggests that short run dynamics are indeed better captured by the macro and Google Trend information.
To derive the posterior p(ψ|•), notice that each ψ t is univariate and independently distributed. Hence: Notice that these are kernels of the inverse-Gamma distribution: 29 Since the horseshoe uses a conjugate formulation, the posterior moments for the horseshoe are D 1 = σ 2 (X Σ −1 X + Λ −1 ) andβ 1 = D −1 1 X Σ −1 y * .
Finally, regarding the unknown η, we specify a uniform prior η ∼ U [2, 50]. The lower limit ensures that the variance σ 2 y exists, and 50 is chosen to be reasonably large such that the upper limit generates an error variance close to a normal. The conditional posterior boils down to: p(η|•) ∝ p(ψp(η)) where the first definition follow from the fact that the priors are independent. This distribution is non-standard. To sample from this distribution, we make use of an independent Metrolpolis-Hastings within Gibbs sampling step. By slight abuse of notation, define the target density as f, the current state of the Markov chain as X and the proposal state as Y, then the proposal Y is accepted with probability where g(.) is the proposal density. In order for the Metropolis-Hastings sampler to quickly explore the typical set of η|•, g should be close to f. To ensure this, we define g as a normal with mean equal to the mode of f and covariance equal to the negative Hessian evaluated at the mode. To find the mode, we use the Newton-Raphson method. The Hessian is analytically available (Chan, 2017a).
The sampling algorithm follows the same sequence as in main text of the paper, however with steps p(ψ|•) and p(η|•) added before sampling σ 2 y |• is sampled.