scieee AI-readable full text Open interactive document viewer

Googling unemployment during the pandemic: Inference and nowcast using search data

Caperna, Giulio,Colagrossi, Marco,Geraci, Andrea,Mazzarella, Gianluca

Abstract

EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.

Full text

Caperna, Giulio; Colagrossi, Marco; Geraci, Andrea; Mazzarella, Gianluca Working Paper Googling unemployment during the pandemic: Inference and nowcast using search data JRC Working Papers in Economics and Finance, No. 2020/04 Provided in Cooperation with: Joint Research Centre (JRC), European Commission Suggested Citation: Caperna, Giulio; Colagrossi, Marco; Geraci, Andrea; Mazzarella, Gianluca (2020) : Googling unemployment during the pandemic: Inference and nowcast using search data, JRC Working Papers in Economics and Finance, No. 2020/04, ISBN 978-92-76-19817-8, Publications Office of the European Union, Luxembourg, https://doi.org/10.2760/142454 This Version is available at: https://hdl.handle.net/10419/249356 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. https://creativecommons.org/licenses/by/4.0/ Googling Unemployment During the Pandemic: Inference and Nowcast Using Search Data Giulio Caperna Marco Colagrossi Andrea Geraci Gianluca Mazzarella JRC Working Papers in Economics and Finance 2020/04 This publication is a Technical report by the Joint Research Centre (JRC), the European Commission’s science and knowledge service. It aims to provide evidence-based scientific support to the European policymaking process. The scientific output expressed does not imply a policy position of the European Commission. Neither the European Commission nor any person acting on behalf of the Commission is responsible for the use that might be made of this publication. For information on the methodology and quality underlying the data used in this publication for which the source is neither Eurostat nor other Commission services, users should contact the referenced source. The designations employed and the presentation of material on the maps do not imply the expression of any opinion whatsoever on the part of the European Union concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Contact information Name: Marco Colagrossi Address: European Commission, Joint Research Centre (JRC), Directorate I - Competences, Unit I.1 - Monitoring, Indicators and Impact Evaluation, Via Enrico Fermi 2749, TP 361, 21027 Ispra (VA), Italy Email: [email protected] Tel.: +39 0332 78 9526 EU Science Hub https://ec.europa.eu/jrc JRC121050 PDF ISSN 2467-2203 ISBN 978-92-76-19817-8 doi:10.2760/142454 Luxembourg: Publications Office of the European Union, 2020 © European Union, 2020 The reuse policy of the European Commission is implemented by the Commission Decision 2011/833/EU of 12 December 2011 on the reuse of Commission documents (OJ L 330, 14.12.2011, p. 39). Except otherwise noted, the reuse of this document is authorised under the Creative Commons Attribution 4.0 International (CC BY 4.0) licence (https://creativecommons.org/licenses/by/4.0/). This means that reuse is allowed provided appropriate credit is given and any changes are indicated. For any use or reproduction of photos or other material that is not owned by the EU, permission must be sought directly from the copyright holders. All content © European Union, 2020 How to cite this report: Caperna, G., Colagrossi, M., Geraci, A. and Mazzarella, G., Googling Unemployment During the Pandemic: Inference and Nowcast Using Search Data, Publications Office of the European Union, Luxembourg, 2020, ISBN 978-92-76-19817-8, doi:10.2760/142454, JRC121050 Contents Abstract......................................................................................................................................................................................................................... 1 1 Introduction......................................................................................................................................................................................................... 2 2 Google searches............................................................................................................................................................................................... 3 3 Google searches and unemployment rate in the EU................................................................................................................... 3 4 Measuring the effect of lock-down measures on online search activities...................................................................... 6 5 Conclusion............................................................................................................................................................................................................ 9 References................................................................................................................................................................................................................... 10 List of tables............................................................................................................................................................................................................... 13 6 Appendix................................................................................................................................................................................................................ 14 Supplementary Online Material....................................................................................................................................................................... 16 6.1 Random Forest and Variable Selection...................................................................................................................................... 16 6.1.1 Regression Trees and Random Forest .............................................................................................................................. 16 6.1.2 Variable importance and selection..................................................................................................................................... 16 i Abstract The economic crisis caused by the covid-19 pandemic is unprecedented in recent history. We contribute to a growing literature investigating the economic consequences of covid-19 by showing how unemployment-related online searches across the EU27 reacted to the introduction of lock-downs. We exploit Google Trends topics to retrieve over two thousand search queries related to unemployment in 27 countries. We nowcast the monthly unemployment rate in the EU Member States to assess the relationship between search data and the underlying phenomenon as well as to identify the keywords that improve predictive accuracy. Drawing from this nding, we use the set of best predictors in a Difference-in-Differences framework to document a surge of unemploymentrelated searches in the wake of lock-downs of about 30%. This effect persists for more than ve weeks. We suggest that the effect is most likely due to an increase in unemployment expectations. Keywords: Unemployment; nowcast; random forest; covid-19; Google Trends; Difference-in-Differences. JEL: E24; C21; C53. We thank Claudio Deiana, Massimiliano Ferraresi, Francesco Panella, Paolo Paruolo and audience at seminar series of the Joint Research Centre of the European Commission for valuable comments. Opinions expressed herein are those of the authors only and do not reect the views of, or involve any responsibility for, the institutions to which they are afliated. Any errors are the fault of the authors only. 1 1 Introduction The economic crisis caused by the covid-19 pandemic is unprecedented in recent history. Never before, after the end of the Second World War, economic activities abruptly halted in most of the world's advanced economies. Predictions are gloomy, as the European Commission forecast that the EU GDP will shrink by about 7.7%, with the best-performing country (Poland) anticipating an economic contraction of about 4.3% (European Commission, 2020). This study contributes to a growing literature investigating the economic impact of the covid-19 pandemic.1In particular, we look at the consequences of the pandemic (and the measures enacted to ght it) on unemployment, which is an exceptionally worrisome feature of this crisis. There are indeed already signs of unprecedented demand for unemployment benets in the US (Aaronson et al., 2020; Goldsmith-Pinkham and Sojourner, 2020; Kahn et al., 2020) and of a loss of about 35 million jobs among OECD countries in March alone.2Further, the impact on seasonal activities  such as tourism and agriculture  on which several EU countries depends heavily might be particularly severe.3Finally, the sudden lock-down of non-essential activities might cast worries on the liquidity of many SMEs, which represent 99.8% of all enterprises in the EU28 non-nancial business sector (NFBS) and employ more than 65% of the workers in non-NFBS activities (Hope et al., 2019). So far, the literature on the labour market impacts of the pandemic and subsequent containment measures has focused on single countries (e.g., Aaronson et al., 2020; Amburgey et al., 2020; Baert et al., 2020; Goldsmith- Pinkham and Sojourner, 2020; Kahn et al., 2020; “ahin et al., 2020) or few selected countries (Adams-Prassl et al., 2020). We contribute to this literature in a variety of ways. We are the rst, to the best of our knowledge, to provide a EU-wide perspective. Differently from the US case, timely and high-frequency administrative data on unemployment-related benets are not available in the EU. We take a different approach and rely on unemployment-related online searches. In particular, to extend our analysis to all EU27 countries, we exploit Google Trends topics (as in Brodeur et al., 2020), which are an aggregation of different queries having the same semantic meaning  in our case, all queries linked to the broad concept of unemployment. We then adopt a novel approach, which has not yet been used in the literature. We exploit the topic unemployment to collect, for each country, all search queries linked to it (rst level queries) and all the top queries linked to the latter (second level queries). We show that nowcasting unemployment using the topic alone does not provide a statistically signicant improvement over what a simple auto-regressive model would predict for the vast majority of the countries considered (Section 3section). Instead, once we add all the keywords linked to the topic unemployment and perform variable selection using random forest-based methods, the predictive accuracy increases signicantly in almost all countries. Drawing from this nding, we select the queries that best predict the unemployment rate, separately for each country, and aggregate them to create a daily indicator of unemployment-related searches. Such an indicator, we argue, contains information on both the current unemployment rate and expectations of unemployment. We then perform a Difference-in-Differences (DiD) analysis. Following the lock-down measures imposed by some EU governments to limit the spread of the SARS-CoV-2 virus, unemployment-related searches rose by roughly 30% compared to their pre-pandemic average. The higher level of searches persists throughout the lock-down period. Finally, we provide evidence suggesting that announcements of scal stimuli by EU Governments are perceived as signals of a worsening economic scenario. Importantly, the methodology and the approach outlined in this paper is not only relevant in the context of the covid-19 pandemic and unemployment. It could be adapted to study a variety of events, policies and economic indicators, making it a powerful tool to inform policymakers when reporting data are not readily available. The remainder of this paper is structured as follows: Section 2section briey introduces Google search data. Section 3section reviews the related literature on nowcasting and describes our methodology and results. Section 4section builds on the ndings of the nowcasting exercise and shows the results of the DiD. Section 5section concludes. 1Scholars are investigating the consequences of the evolution of the contagion and mitigation policies on the economy as a whole (e.g., Akira Toda, 2020; Baker et al., 2020; Jones et al., 2020; Kahn et al., 2020; Ludvigson et al., 2020; Stock, 2020), the impact on nancial markets and their stability (e.g., Boot et al., 2020; Ramelli and Wagner, 2020) as well as its cost in terms of inequality (e.g., Adams-Prassl et al., 2020; Alon et al., 2020; Coronini-Cronberg et al., 2020) and overall well-being (e.g., Brodeur et al., 2020; Fetzer et al., 2020; Hamermesh, 2020). 2The loss seems to have been particularly severe among youth and women  see Unemployment Rates, OECD - Updated: May 2020, available at http://www.oecd.org/sdd/labour-stats/unemployment-rates-oecd-update-may-2020.htm 3See Tourism and transport in 2020 and beyond, Brussels, 13.5.2020 COM(2020) 550 nal, available at https://ec.europa.eu/ info/sites/info/files/communication-commission-tourism-transport-2020-and-beyond_en.pdf 2 2 Google searches Google searches have been used in various elds of the economic literature. Starting with the seminal contribution of Choi and Varian (2012), Google search data proved useful to forecast (nowcast) a variety of economic indicators (see Section 3section for a brief review of the main contributions in this literature). Further, they have been used in nancial studies (e.g., Da et al., 2011; Preis et al., 2013; Vlastakis and Markellos, 2012), to understand tourism ows (Siliverstovs and Wochner, 2018) and even the consequences of racial animus on black candidates in the US presidential elections (Stephens-Davidowitz, 2014). Importantly, compared to surveys, Google searches are less sensitive to the small-sample bias (Baker and Fradkin, 2017). Google Trends ( https://trends.google.com/trends/ ) provides access to the search requests made to the Google search engine by its users. In particular, Google Trends contains a random sample representative of all queries that Google handles daily.4Search results are normalized to the time and location of a query. By time range (either daily, weekly or monthly) and geography (either country or NUTS-2 level), each data point is divided by the total searches to obtain relative popularity. The resulting numbers are then scaled on a range of 0 to 100 based on a query's proportion to all searches on all queries. Following the literature, we refer to this quantity as the Search Volume Index (hereafter SVI). Google Trends returns the SVI of either queries or topics. The former are the actual search queries input by users on the Google search engine. Topics are instead aggregations of different queries that could be assigned to a particular semantic domain (in our case, unemployment). Aggregation is done by Google using semantic integration algorithms in the context of the Google knowledge graph.5 Topics provide few advantages over simple queries. First, since topics are language-independent, it is possible to use them to perform a cross-country analysis, whereas the same does not apply to keywords. Evidence shows that search terms related to the same topic vary across countries due to cultural and institutional differences (Bousquet et al., 2017). Further, searches linked to topics might vary across time. This is particularly true for searches related to unemployment, which might depend on the name and the seasonality of particular policies in place in any given country. All queries broadly related to a topic are then linked to it independently from the spelling and the wording of the associated queries. In addition, Google Trends also returns the top-25 (when available) queries and topics related to any given topic or query. Top queries and topics are queries (or topics) that are most frequently searched by users within the same session for any given time and geography. As mentioned in Section 1section, in this paper we exploit a variety of features of Google Trends, a novelty in this literature. First, we collect the monthly SVI for the topic unemployment starting in January 2015. Further, we collect, for the same period of time, the monthly SVI for level-1 queries  i.e., the top-25 related search terms associated with the topic. Finally, we collect the monthly SVI for level-2 queries  i.e., the 10-top related search terms associated with level-1 queries. This procedure is repeated separately for each country for the period January 2015 - December 2019. For the DiD (Section 4section) we instead retrieve the daily SVI of both the topic and the subset of queries we identify as the best predictors of unemployment in each country (Section 3section) from the 13th of January to the 9th of May 2020.6 Of course, Google searches also present limitations. While 90% of EU27 household have internet access, younger individuals are more likely to use the internet than the elderly. Further, access to the internet is not random with respect to socio-economic status.7While the former is a lesser concern in our case, as we do not expect the elderly to look for unemployment related-queries given that they are likely to be retired, the latter might impact our results. In particular, if low socio-economic status individuals are excluded from the queries sample, both the nowcast and the event-study analyses could be downward biased. 3 Google searches and unemployment rate in the EU In the last decade Google search data have been used to forecast and nowcast different macroeconomic indicators. Götz and Knetsch (2019) use Google data to forecast German GDP, Vosen and Schmidt (2011) and Vosen and Schmidt (2012) focus on forecasting consumption in, respectively, US and Germany. Focusing on nancial markets, Da et al. (2015) use Google search data to build an investment sentiment index to predict different US aggregate market indices, while Hamid and Heiden (2015) create a proxy for investors attention to predict stock market volatility. In a recent contribution, Koop and Onorante (2019) show how Google search 4Google excludes from the sampling queries made by very few people; duplicate searches  i.e., queries made by the same individual over a short period; queries containing special characters; and illegal search activities, such as automated searches performed by bots. 5Topics were introduced by Google in late 2013 for the US and in the following years for EU countries. See https://developers. google.com/knowledge-graph for additional information. 6We chose the 13th of January as the starting date because (i) it is past the Christmas' holidays period, which might inuence online search behaviour but (ii) it is before the events and the lock-down of Wuhan (23rd January) which might have inuenced individuals' economic expectations. 7See Eurostat, Digital Economy and Society Data https://ec.europa.eu/eurostat/web/digital-economy-and-society/data/ database . 3 data can be used to improve nowcast of different macroeconomic variables in the context of dynamic model selection. Finally, focusing on unemployment, D'Amuri and Marcucci (2017) assess the performance of Google search data related to job-search in forecasting US monthly unemployment rate. Fondeur and Karamé (2013) and Smith (2016) perform a similar forecasting exercise focusing, respectively, on France and UK. The consensus in this literature is that the inclusion of Google search data leads to signicant improvements in model accuracy, especially for nowcasts and short-term forecasts. We follow this literature and perform a nowcast exercise of the monthly unemployment rate time series for each EU27 country from January 2015 to March 2020. Although this exercise is of interest in itself, we use it here with the aim of assessing if, and to which extent, Google search data related to unemployment are a good predictor of the true economic phenomenon. To understand the relationship between Google searches and unemployment, we start with a simple and stylized conceptual framework. We assume an economy in which, at any given time, the amount of unemployed individuals is given by: Ut=Ut−1−Ot−1,t +It−1,t =Ut−1−Ot−1,t +e δt−1,tEt−1,(1) where Ot−1,t and It−1,t represent, respectively, the outows and inows from and in unemployment. e δt−1,t is the true probability of employed individuals Ein time t−1to become unemployed at time t. We then assume the existence of a latent variable ω∗ trepresenting the volume of online activities related to unemployment at time t:ω∗ t=τUt+φEt+ηt =τUt+τ(e δt,t+1 +t)Et+ηt,(2) where τis the volume of online activities performed by the average unemployed individual to retrieve unemployment-related information. We assume that also employed individuals engage in such activities. Their volume φis the same of unemployed individuals, τ, scaled by their (subjective) expectation of becoming unemployed in the next period (δt). The relationship between the expectation and the true probability is given by the error model δt=e δt,t+1 +t. Finally, ηtis a residual term capturing online behaviour of those neither in employment nor unemployment. In this simple representation, the volume of online activities related to unemployment carries information about the level of unemployment at time t through τUt and t+ 1  through τ(e δt,t+1 +t)Et. We proxy ω∗ t with Google searches related to unemployment. The rst challenge is to dene the set of Google search queries of interest. D'Amuri and Marcucci (2017) exploit the use of logical operators in the Google Trend platform, and identify the SVI associated to all queries containing the word jobs. Fondeur and Karamé (2013) use the single term emploi. Smith (2016) uses a different approach based on the root term redundancy. The root query is used to obtain the associated queries, and the relative volume data are aggregated using weights to produce a composite Google Redundancy Index. An ad-hoc choice of keywords is not feasible in our context since it would require the identication of the words which semantically dene the unemployment concept in each European country. We follow a different approach and exploit the Google topic unemployment to retrieve, separately for each country, the top-25 level-1 queries and the top-10 level-2 queries in the original language in the period January 2015 - December 2019. This data-driven approach is similar to the use of a list of root keywords in Da et al. (2015) and Smith (2016) to retrieve the associated queries. Our root, however is not a single keyword or a list of keywords, but the language-independent topic. After retrieving the full list of associated queries, we extract their SVI in the interval January 2015 - March 2020, as well as the SVI of the topic itself.8We retrieve monthly Google search data to match the EU unemployment rate time series available from Eurostat (ei_lmhr_m). The number of associated keywords retrieved in each country, after removing duplicates, varies from 3 (Estonia) to 178 (Italy), with a mean of 80 and a median of 85.9For each country we estimate different nowcast models which can be summarized as: ut=fh(Kt,Kt−1, ut−h, ut−h−1) + ut, h = 1,2,3,(3) where utis the log-difference of the unemployment rate between month tand month t−1,Ktis a Pc-vector comprising the log-differences of the monthly SVI for the Pkeywords retrieved for country c, including the SVI of the topic (k1hereafter). Kt−1is simply the lag of Kt. Finally each model includes two lags of the dependent variable: ut−h, and ut−h−1. Since the nowcasting equations embed also lags of the dependent variable, we 8Notice that we only retrieve the keywords associated with the topic until the end of 2019 to avoid COVID-19 related keywords. However, we track the SVI of of the selected keywords until March 2020 9For Luxembourg and Malta we were not able to retrieve any associated query. 4 considered three different horizons (i.e., h= 1,2,3) corresponding to the last date for which information on unemployment is available.10 The models considered differ by the target function fh, which maps the available information at time tto the dependent variable, as well as the number of keywords included in Kt, and Kt−1. More specically, we consider ve different models. LM.1, our benchmark, is a classical linear AR model which makes no use of Google search data. LM.2 is a linear model where only k1is included in Ktand Kt−1. RF.1 uses a Random Forest algorithm including the same covariates used in LM.2. RF.2 is a Random Forest where Ktand Kt−1include the SVI of all the retrieved keywords for country cplus the SVI of k1. RF.3 is a Random Forest model including a subset of the keywords used in RF.2. The subset is identied using the Boruta variable selection method (Kursa et al., 2010; Stoppiglia et al., 2003).11 In most of the countries considered, the dimension of the time series is quite small with respect to the number of predictors, a high-dimensional context with T << P. As an example, we retrieved 178 keywords in Italy compared with 63 data-points in the unemployment rate monthly time series. Medeiros et al. (2019) explore the performance of different machine learning methods in a forecast race targeted at predicting US ination using a wide set of covariates. The authors show that, in a data rich environment, the Random Forest algorithm outperforms all the considered alternative high-dimensional models (including the linear LASSO and RIDGE regressions), as well as state-of-the-art dynamic factor models widely used in time series modelling. Therefore, we select Random Forest  an ensemble learning method based on a collection of regression trees introduced by Breiman (2001)  to estimate the target function fh. We evaluate the performance of each model using Pseudo-Out-of-Sample prediction (POOS hereafter) based on a rolling window framework with increasing length starting from the rst 36 months. The procedure can be summarized as follows: a) the models are trained using the rst 36 observations; b) the trained models are used to obtain the prediction for the 37th month; c) the models are then re-trained using the rst 37 observations and predictions for the 38th are computed. The entire procedure is iterated separately for each country until month T−1. Having obtained the time series of POOS predictions for each country, we follow the literature and assess the accuracy of each model against our AR benchmark (LM.1) using the standard one-sided Diebold-Mariano (DM) test (Diebold and Mariano, 1995) based on absolute deviations.12 The aim of this test is to assess whether Google search data carry additional informational content. Figure 1 summarizes the main ndings. Table F.2 in Appendix 6section contains the full set of results. Each bar represents the fraction of DM-victories of each model against the benchmark LM.1. across the countries considered. A model wins over the benchmark if its predictive accuracy is signicantly higher (α= 0.1). The results of the comparison indicates that the usage of the SVI of k1alone (LM.2) does not improve the accuracy of the AR model. A slight improvement is visible when k1is used in a Random Forest rather than OLS (RF.1), suggesting that non-linearities are of some importance. Interestingly, the inclusion of the full set of associated keywords in RF.2 is not associated with an additional increase in performance with respect to RF.1. A sizeable gain is instead visible when the Boruta variable selection method is used to select the list of relevant predictors to be used in the Random Forest  i.e., RF.3. The introduction of a selection step in machine learning algorithms has two objectives. On the one hand it is aimed at reducing noise due to highly correlated or redundant predictors. On the other hand, the identication of relevant predictors is useful in itself for interpretation purposes. In our context, the selection step is also a way to solve the problem of identifying the most relevant set of country-specic keywords. This is similar in spirit to the procedure adopted by Da et al. (2015) to construct their index of investor sentiment starting from the volume of queries related to households economic concerns. Da et al. (2015) use as root a selected set of keywords taken from annotated dictionaries which express negative and positive economic sentiments. Götz and Knetsch (2019) also employ different variable selection methods to identify the set of keywords to be embedded in their GDP forecast models, including principal component analysis, partial least squares, LASSO and boosting. Overall, the results suggest that a subset of relevant keywords helps to improve nowcast accuracy with respect to the benchmark model. This is not the case for the topic alone. Combining the use of topics and the variable selection step in our nowcast framework presents two advantages. On the one hand, the use of a common Google topic allows to retrieve a broad set of keywords in a context of heterogeneous countries 10The maximum value considered (h= 3) is the maximum time lag between the release of ofcial Eurostat statistics on unemployment and the availability of contemporaneous data on Google searches. 11A brief description of the Random Forest algorithm and of the Boruta variable selection method is provided in the supplementary online material 6.1. For a detailed description of Random Forest see Hastie et al. (2009). Results are robust to a different variable selection method  VSURF (Genuer et al., 2010)  and are available upon request. 12The choice of absolute deviations instead of the common squared deviations is driven by the scale of our response variable. The log-difference of monthly unemployment rate is close to the zero. Using absolute deviations implicitly assign the same weight to each error avoiding to reward those that are particularly small. 5 Stoppiglia, H., Dreyfus, G., Dubois, R. and Oussar, Y., Ranking a random feature for variable and feature selection, Journal of machine learning research, Vol. 3, No Mar, 2003, pp. 13991414. Vlastakis, N. and Markellos, R. N., Information demand and stock market volatility, Journal of Banking & Finance, Vol. 36, No 6, 2012, pp. 18081821. Vosen, S. and Schmidt, T., Forecasting private consumption: survey-based indicators vs. google trends, Journal of forecasting, Vol. 30, No 6, 2011, pp. 565578. Vosen, S. and Schmidt, T., A monthly consumption indicator for germany based on internet search query data, Applied Economics Letters, Vol. 19, No 7, 2012, pp. 683687. 12 List of Tables Table 1. Rollingwindowsevent-study ........................................ 8 Table F.2. Results of the Diebold-Mariano test for equal predictive accuracy comparing different nowcasting models against the benchmark AR model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 13 6 Appendix 14 Table F.2: Results of the Diebold-Mariano test for equal predictive accuracy comparing different nowcasting models against the benchmark AR model LM.2 RF.1 RF.2 RF.3 Country h=1 h=2 h=3 h=1 h=2 h=3 h=1 h=2 h=3 h=1 h=2 h=3 AT 0.002 -0.001 0 -0.019*** 0.005 0.008 -0.004 -0.002 0.007 -0.016*** 0.007 0.014 BE 0.007 0.008 0.009 0.002 0.002 0.002 0 -0.002 -0.002 -0.004* -0.006** -0.004* BG -0.002 -0.001 0.001 -0.003 -0.006* -0.004 0.004 -0.002 -0.001 -0.003 -0.01** -0.01* CY -0.005 -0.001 -0.001 -0.025** -0.016* -0.024** -0.009 -0.008 -0.006 -0.03** -0.021** -0.033*** CZ -0.003 -0.002 0.001 0.001 -0.008 0.003 -0.005 -0.018** -0.011** -0.011 -0.004 0.006 DE 0.001 -0.002 -0.001 -0.001 -0.003 -0.003 -0.002 -0.004* -0.003 -0.018*** -0.017*** -0.019*** DK 0 -0.003*** -0.005*** 0.003 0 0.001 -0.002 0.003 0.003 0 0 0 EE 0.002 -0.001 0 -0.005 -0.003 0 0 -0.001 -0.001 -0.006 -0.004 -0.005 ES -0.002 -0.002 -0.002 -0.004** -0.003* -0.004* -0.001 -0.001 -0.001 -0.004** -0.003* -0.003 FI 0.001 -0.009 -0.015** 0 0.003 0.009 -0.004 -0.002 -0.004** -0.015* -0.016* -0.02** FR 0.003 0.003 0.003 -0.008** -0.002 -0.009*** -0.005*** -0.004*** -0.002 -0.01*** -0.01*** -0.01*** GR -0.002* -0.003 -0.001 -0.001 -0.004* -0.002 0 0.001 0.005 -0.009** -0.009* -0.005 HR 0 -0.006 -0.008* 0.001 -0.007* -0.013** 0.008 -0.004 -0.009** -0.001 -0.015** -0.019*** HU 0.001 0 -0.001 0.001 -0.001 -0.001 0.001 0 0 -0.007** -0.006*** -0.009*** IE 0.002 0.005 0.006 0 0.007 0.003 0.002 0.001 0.001 -0.005* -0.004 -0.004 IT -0.006 -0.005 -0.008 -0.009 -0.004 -0.009 -0.012** -0.01* -0.016** -0.016** -0.016** -0.02** LT 0.002 0.001 -0.001 0.006 0.005 0.008 -0.007** 0 0.003 -0.017*** -0.014*** -0.009* LU -0.002* -0.002 -0.004** 0.003 0.004 0.003 0.003 0.004 0.003 0.003 0.004 0.003 LV 0.001 0.001 0 0 -0.001 0 0 -0.004 -0.004 -0.004 -0.008* -0.007* MT 0 0 0 0.001 -0.002 -0.001 0.001 -0.002 -0.001 0.001 -0.002 -0.001 NL -0.003 -0.004 -0.002 -0.012*** -0.007 -0.006 -0.014*** -0.011** -0.011*** -0.018*** -0.016*** -0.016*** PL -0.001 -0.001 -0.001 -0.003 -0.001 -0.004* 0.001 -0.002 -0.003 -0.005 -0.007** -0.009*** PT 0.001 0.002 0 0.002 0.004 0 0.004 0.003 -0.001 0.003 -0.002 -0.01*** RO 0.003 -0.001 -0.001 0.001 0.004 0.006 0 0.002 0.002 -0.005 -0.004 -0.004 SE 0.005 0.004 0.002 0.001 0 -0.001 -0.002 0.001 -0.002 -0.007 -0.011* -0.011 SI 0.001 0.001 0.002 0.004 0.002 0.001 0.006 0.006 0.004 -0.005 -0.001 -0.004 SK -0.002* -0.001 -0.001 -0.002* -0.002* -0.001 -0.004*** -0.002*** -0.003*** -0.006*** -0.005*** -0.007*** Notes: Each cell represents, separately for country and each horizon, the difference g(emod.i)−g(eLM.1). The loss function used is the absolute deviation, i.e. g(emod.i) = E(|yt−\yt,mod.i|). *, **, and *** denote signicance of the difference at the 10, 5, and 1 percent level, computed according to the one-sided Diebold- Mariano test for predictive accuracy. Missing values for RF.2 and RF.3 are due to the impossibility to retrieve additional related queries for the relative countries. LM.2 is a linear model where only the SVI of k1is added to the set of predictors. RF.1 is a Random Forest including the same covariates used in LM.2. RF.2 is a Random Forest where the SVI of all the retrieved keywords for each country is included plus the SVI of k1. RF.3 is a Random Forest model including a subset of the keywords used in RF.2, chosen using the Boruta algorithm. 15 Supplementary Online Material 6.1 Random Forest and Variable Selection 6.1.1 Regression Trees and Random Forest Random Forest as a learning method was developed by Breiman (2001) to reduce the variance of regression trees. Regression trees are non-linear and non-parametric predictive models in which the space dened by the covariates is split in sub-regions. Predictions are then computed as the sample mean of the dependent variable across the observations in the sub-regions. The partition of the space dened by the covariates is obtained recursively. In the trivial case of a single covariate x, nding the best possible split means nding the value ksuch that the prediction error in the two sub-regions dened by x<kand x>kis minimized according to some loss function  e.g., the sum of squared errors. When the number of predictors is greater than one  i.e., X= (x1, x2, ..., xP) at each step all the possible predictors and splitting values are considered, and the best split is based on the combination of the predictor-splitting value which minimize the prediction error. Once the rst best split is found, the resulting sub-region is re-split iteratively using the same procedure. The nal structure of the partitions resemble the one of a tree in which the splitting nodes are the start of the branches, and the nal node are the leaves. In this context, the choice of the stopping rule is crucial. On the one hand, growing a tree too deep might result in overtting, hence noisy out-of-sample predictions. On the other hand, a small tree might not capture non-linearities in the relationship between the dependent variable and the covariates. Single regression trees present an important limitation: they are extremely prone to overtting (Hastie et al., 2009). Small changes in the data can cause large changes in the estimated model. Random Forest was developed to reduce the variance of regression trees. It does so by considering a collection of trees (a forest), each estimated on a bootstrap sample of the original training data. Bootstrapping is not the only source of randomness. At each step of the process only a subset of the predictors, typically P/3, are used as potential candidates for splitting. Once Bregression trees are grown, the nal predictions are computed averaging the predictions of each tree. Averaging across bootstrapped trees allows to grow trees deep (typically the number of observations in the leaves is 5), without the risk of overtting. Another advantage of Random Forest is that there are very few parameters to tune, namely the number of trees of the forest B, and the number of variables considered at each step m. In our application we estimated all Random Forest models using the Rpackage randomForest, setting B= 5000, and m=P/3. 6.1.2 Variable importance and selection Ensemble methods, like Random Forest, are often regarded as black boxes. This is due to the implicit trade off between variance reduction (which enhances prediction accuracy) and interpretability. One important feature of Random Forest, however, is the possibility to use the Bbootstrapped trees to estimate the predictive importance of the covariates used. This information can then be used for interpretation purposes. As an example, Medeiros et al. (2019) use Random Forest variable importance to show that one possible explanation for the better performance of the algorithm is its ability to capture the importance of predictors which are neglected by other linear and non-linear methods. In this article, Random Forest uses Out-of-Bag (hereafter OOB) randomization (permutation method) to compute the importance of predictors, as described in Hastie et al. (2009). Observations are OOB in the bth tree (out of the Btrees of the forest) if they are excluded from the training set in that specic tree due to bootstrapping. Since each observation in the data is OOB in a fraction of the Btrees (tipically B/3), these fraction of trees can be used to compute the average prediction for the entire set of observations. The difference between OOB realizations and predictions across the Btrees can then be used to compute the OOB error, an estimate of the true test error and a measure of predictive accuracy. Additionally, in order to compute a measure of variable importance based on prediction accuracy another step is needed. The values of the covariates used to split are randomly permuted in each split. The OOB error rate is then re-computed using the randomly permuted version of the covariates used. The diference between the two OOB error rates is then used to assess the loss in accuracy due to the random permutation the covariates. This is done separately for each of the covariates used to split the Btrees. Intuitively if a covariate is important in terms of prediction accuracy, permuting at random its values should induce an increase in the OOB error rate. The average loss of accuracy due to the permutation is computed across all trees for each covariate, and is used as a measure of variable importance. It is important to stress that variable importance measures are not used by the Random Forest algorithm in any of its steps, at least in the original denition of the algorithm. However, there are a number of contributions in the scientic literature on Random Forest which propose different methods to use variable importance measures as a way to identify the most relevant features to be included in the model. Here we focus on the Boruta algorithm. 16 Boruta aims at reducing the effect of random associations and uctuations among the observed variables. The Boruta algorithm is made by nine main steps. In the rst (and most meaningful) two, the algorithm copies the existing variables and rearranges the values of the copies by permuting the original values, disrupting any pre-existent relationship with the response variable. The following steps then select the predictors outperforming the randomised variables, until a stop criterion is reached. An extended description can be found in Kursa et al. (2010), while a comparison of variable selection methods is presented by Degenhardt et al. (2019). 17 GETTING IN TOUCH WITH THE EU In person All over the European Union there are hundreds of Europe Direct information centres. You can find the address of the centre nearest you at: https://europa.eu/european-union/contact_en On the phone or by email Europe Direct is a service that answers your questions about the European Union. You can contact this service: - by freephone: 00 800 6 7 8 9 10 11 (certain operators may charge for these calls), - at the following standard number: +32 22999696, or - by electronic mail via: https://europa.eu/european-union/contact_en FINDING INFORMATION ABOUT THE EU Online Information about the European Union in all the official languages of the EU is available on the Europa website at: https://europa.eu/european-union/index_en EU publications You can download or order free and priced EU publications from EU Bookshop at: https://publications.europa.eu/en/publications. Multiple copies of free publications may be obtained by contacting Europe Direct or your local information centre (see https://europa.eu/european-union/contact_en). KJ-AE-20-008-EN-N doi:10.2760/142454 ISBN 978-92-76-19817-8