Forecasting internal migration in Russia using Google Trends: Evidence from Moscow and Saint Petersburg

: This paper examines the suitability of Google Trends data for the modelling and forecasting of interregional migration in Russia. Monthly migration data, search volume data, and macro variables are used with a set of univariate and multivariate models to study the migration data of the two Russian cities with the largest migration inflows: Moscow and Saint Petersburg. The empirical analysis does not provide evidence that the more people search online, the more likely they relocate to other regions. However, the inclusion of Google Trends data in a model improves the forecasting of the migration flows because the forecasting errors are lower for models with internet search data than for models without them. These results also hold after a set of robustness checks that consider multivariate models able to deal with potential parameter instability and with a large number of regressors.


Introduction
Google Trends (GT) is an online service launched in 2008, which provides an index that reflects the relative popularity of a particular keyword (or a topic) by calculating the share of users' searches for this keyword among the total Google searches. This tool has been used in various fields of research, including IT, communications, medicine, health, business, and economics, see the large survey by Jun et al. (2018) for a detailed review.
One of the latest advances in migration research proposed the inclusion of Google Trends data to forecast migration flows. In this regard, Böhme et al. (2019) stated that people acquire information about migration opportunities online before deciding to emigrate. Therefore, the online demand for information can serve as a proxy for future changes in the number of migrants: changes in online search intensity for specific keywords related to migration can indicate an increase in the demand for migration, and, thus, can help to predict migration flows. We remark that there is an increasing literature that shows that Google-based models significantly outperform most of the competitors in several economic and financial applications, see Chol and Varian (2012), Fantazzini (2014), D'Amuri and Marcucci (2017), Bulut (2017), Yu et al. (2019), and Borup and Schütte (2020). Jun et al. (2018) provide a useful review of the research studies using Google Trends in a wide range of areas, including IT, communications, medicine, health, business, and economics. In this perspective, we propose to use online search data for forecasting the monthly aggregate migration inflows into Russian regions from all other regions. We justify this choice because the administrative recently discussed by Sirbu et al. (2021). The increasing availability to policymakers of a wide array of leading indicators can be useful to improve both the development and the implementation of migration policies 4 .
The rest of this paper is organized as follows. Section 2 briefly reviews the literature devoted to migration research with Google Trends and online data, while the methods proposed for forecasting the migration flows in Moscow and Saint Petersburg are discussed in Section 3. The empirical results are reported in Section 4, while Section 5 briefly concludes. Robustness checks are discussed in the Appendix.

Migration
The study of migration in Russia is based on different approaches. One of the oldest streams of migration research employed the spatial structure of data to explain migration flows between regions, see -just to name a few- Ravenstein (1885), Wilson (1970), Willekens (1980), and Alonso (1986).
Another strand of literature focuses on time series models and mainly employs two types of models: ARIMA class models and extrapolation of time series through the propagation of historical forecast errors, see Bijak et al. (2019) and references therein for a review. These models can also be extended using expertbased information through prior distributions and Bayesian methods. In this regard, Bijak et al. (2019) uses time series models with and without expert opinions and considers three types of models: ARIMA class models, autoregressive distributed lag (ADL) models, and historical propagation of forecast errors. They found that ARMA models of low orders showed better performances with stationary data, whereas ADL models worked better with non-stationary data.
There is also a smaller but increasing literature that uses social big data to measure migration dynamics and future patterns. These data come from social media, internet search services 5 , mobile phones, supermarket transaction data, and other sources. They can contain detailed information about their users and can cover larger sets of the population than traditional data sources. Moreover, they can provide immigrants' movements in real-time and show the immigration trends even before the official statistics are published, see e.g. Hawelka et al. (2014). Zagheni et al. (2014) inferred migration patterns using Twitter data, while Moise et al. (2016) discovered the origins of immigrants from the language used in tweets. Skype ego networks 6 data can also be used to explain international migration patterns, see Kikas et al. (2015) for a detailed discussion. Furthermore, big data can be used to study the movements of individuals in the time of crisis, as suggested by Bengtsson et al. (2011), who proposed to improve the response to disasters and outbreaks by tracking population movements with mobile phone network data. Sirbu et al. (2021) provide a survey of this interesting new literature dealing with human migration and big data.
In the Russian literature, the focus has been to model interregional migration using econometric methods, moving from initial cross-sectional data, to panel data dealing with net migration rates, up to panel 4 The research in this paper received financial support from a grant from the Russian Science Foundation. The policymakers' interest in using such instruments was indirectly confirmed by the request made to us by the grant reviewers to focus specifically on the possibility of forecasting migration flows using Google search data. 5 A specific review of the literature dealing with internet search services is reported in section 2.2 . 6 Ego-centric social networks (ego-networks) map the interactions that take place among the social contacts of individual people. data models for interregional gross migration flows. Even though different datasets were used, the results of these studies are similar and they highlight that the overall migration flow is low compared to other countries of similar size (like the US or Canada), see Andrienko and Guriev (2004) and references therein. Besides, the main idea is that the Russian economy is in disequilibrium and the migration flows depend on economic fundamentals, such as the differences in the public services provisions, incomes, and the unemployment rates between regions. Vakulenko et al. (2011) and Korovkin et al. (2013) provided additional insights by showing that the main determinants of interregional migration are factors that reflect the situation in the labor and residential markets in the region of arrival. Finally, recent works employed time series methods for modelling migration data, like Pavlovskij (2017) who applied ARIMA models for the short-term forecasting of migration inflows and outflows in the Russian regions.
We remark that a large part of the migrants searching for work in Moscow and Saint Petersburg are from the former Soviet republics. Following the fall of the Soviet Union, Russia became a major destination country for international migrants, with officially almost 12 million foreign-born residents in 2017 (United Nations 2017). In the 1990s, most immigrants were ethnic Russians fleeing from the new post-Soviet republics, whereas the composition of migration flows changed in the 2000s to non-Russian labor migrants (Heleniak 2009;Chudinovskikh and Denisenko 2017). This shift was caused by two changes: more liberal policies to grant work permits to non-ethnic Russian citizens of the Commonwealth of Independent States (CIS), and better performance of Russia's economy compared to the other economies in the region, see Gerber and Zavisca (2020) and references therein for a large discussion. In this regard, we highlight that requirements for obtaining work permits have changed over time, both in policy and in implementation, see e.g. Ryazantsev (2016), and Schenk (2018). Moreover, several studies showed that most labor migrants from the CIS countries are illegal, due to government limits on the number of admitted migrants, complex procedures for obtaining legal status, and incentives for employers to hire undocumented migrants rather than follow those procedures, see Human Rights Watch (2009), and Schenk (2018). This lack of legal status has stimulated a business in fake documents and an array of methods to avoid deportation by the authorities, see Reeves (2013Reeves ( , 2015. A large literature discussed how migrants from CIS countries learned of opportunities to migrate thanks to their connections with other migrants or family/friends in Russia (usually known as "migrant networks"), see Gerber and Zavisca (2020) and references therein. Demintseva and Peshkova (2014), Demintseva and Kashnitsky (2016), and Demintseva (2017) showed that social networking sites, such as Odnoklassniki.ru and VKontakte.ru, are among the most important means of communicating by foreign migrants, and they are actively used when looking for accommodation and work. Bedrina et al. (2018) recently provided a detailed econometric analysis of Uzbek migration networks in Russia. Timoshkin (2020) further analyzed the whole spectrum of digital migration networks, and he suggested that the success of these digital platforms is due to the complexity of official interfaces to communicate with state information nodes (regulations, job descriptions, normative acts), which make them unsuitable for communicating at a proper level. As a consequence, Timoshkin (2020) suggests that these "migrant" digital platforms such as social media and other information webpages have become an "instrument that compensates for the technological imperfection of the state information hubs". Abashin (2014), Denisenko et al. (2020) provide large historical surveys and analyses about labor migration on the post-Soviet territory. Ettredge et al. (2005) were among the first to discuss web-based search data to predict macroeconomic statistics. Since then, the research scope has expanded to a variety of other applications thanks to the seminal paper by Choi and Varian (2012), which proposed to use Google Trends data in several fields, like automobile sales, travel planning, consumer confidence, and many others. Several central banks analyzed the suitability of Google Trends for predicting economic fundamentals, see for example Artola and Galan (2012), and McLaren and Shanbhorge (2011).

Google Trends and its applications in migration research
Google Trends data have been widely used in the fields of fertility, mortality, and migration. As for fertility, Billari et al. (2013) found that online search queries could reveal the intention to have a child in the future months so that they can be used to increase in forecasting power of traditional demographic models. Mortality research in developing countries has benefited from using mobile phone data that stores information about causes of death across the country, see Tamgno et al. (2013) for more details. As for migration, Qin and Zhu (2018) studied the effect of an air pollution index on the intentions to emigrate using an online search index on "emigration" via Baidu, the largest Chinese search engine. They found that severe air pollution in the short run may significantly increase people's interest in emigration, but this effect varies across Chinese regions. Böhme et al. (2019), as far as we know, were the first to analyze the potential of online search data in predicting migration flows. They built a large set of fixed effects models for migration flows based on yearly migration data, Google Trends data from the origin countries, and several control variables, as suggested by Mayda (2010). This approach proved to be successful in providing real-time forecasts of current migration flows ahead of official statistics, and to improve the forecasting performances of conventional models of migration flow.

Materials and Methods
The goal of this paper is to verify whether Google Trends data can be useful for modelling and predicting internal migration in Russia. To this end, we will perform an out-of-sample forecasting analysis using a set of time series models: given that sufficiently long time-series data for migration in Russia have become available, time series analysis can now be used. Following Pavlovskij (2017), Böhme et al. (2019) and Bijak et al. (2019), we will use traditional ARIMA models with and without Google Trends to investigate the impact of this new data source for migration forecasting, as well as multivariate models for long-term forecasting. Moreover, as suggested by Keilman et al. (2001), for each class of models we will consider both a "standard" model with variables in levels and a model using logarithms.
Before presenting the results of the empirical analysis, we briefly review the forecasting models that we will use to predict the monthly migration data for the two Russian cities with the largest migration inflows: Moscow and Saint Petersburg.

Forecasting methods
The out-of-sample forecasting analysis will employ three classes of models: univariate time series models and Google-augmented univariate time series models for 1-step ahead forecasts, while multivariate models will be used for long-term forecasts. A brief description of each model is reported below.

Models for short-term forecasts
The first class of models employed in our analysis is the class of autoregressive integrated moving average (ARIMA) models based on migration data only. A non-seasonal ARIMA (p,d,q) model can be represented as follows, , µ is the mean of d t y  , and L is the usual lag operator. ARIMA models represent a standard benchmark in time series analysis and we refer to Hamilton (1994) for more details. Following Keilman et al. (2001), we considered models with the variables in levels and in log-levels. In the case of seasonal data, a seasonal ARIMA (SARIMA) can be used: which can be written compactly as ARIMA (p,d,q)(P,D,Q) [S]. Information criteria can be used to find the optimal number of lags for the auto-regressive and moving average terms.
If we augment the previous class of models with Google search data, we obtain an autoregressive integrated moving average model with eXogenous variables (ARIMA-X), where xt-1 is the lagged Google search index at time t -1 and β is a coefficient. Seasonal components may be added if needed.

Models for long-term forecasts
We used vector autoregression (VAR) models and vector error correction (VEC) models to consider the potential effects of both macroeconomic and search variables on migration flows, and to build long-term forecasts. A general VAR model of order p denoted as VAR(p) is given by where Yt is the (n × 1) vector of endogenous variables, Φ0 is an intercept vector, while Φi are the usual coefficient matrices with i=1,…,p. As the primary focus of this paper is forecasting, the VAR(p) model is estimated in levels and no differencing is applied to non-stationary data. The lag order p of the VAR is selected using the Akaike and Bayesian information criterion. The estimated VAR model is then analyzed by reporting its impulse response functions (IRF), and its forecast error variance decomposition (FEVD), see Lütkepohl (2005, chapters 2-5) for more details.
We decided to use a simple VAR(p) in levels following the suggestion by Gospodinov et al. (2013), who stated that the "unrestricted VAR in levels appears to be the most robust specification when there is uncertainty about the magnitude of the largest roots and the co-movement between the variables". This is definitely our case, given the moderate size of our dataset (120 observations): in this regard, we want to remark that Elliott (1998) was the first to show that cointegration methods may deliver large size distortions in the case of systems with near unit-roots. Similar distortions can take place when using sequential modeling and specification procedures based on pretests for unit roots. Moreover, it is possible to show that the estimates of the impulse responses using VAR in levels remain asymptotically valid under weak conditions, even when the underlying process contains a unit root (or is possibly cointegrated with other variables), and the same holds true for forecast error variance decompositions at any finite horizon, see Inoue and Kilian (2020) for more details. Instead, differencing the variables when they are stationary causes these estimates to be inconsistent and inference to be invalid. However, for sake of generality and interest, we will also consider a VEC model following the standard sequential specification procedure based on pretests for unit roots and cointegration, see Lütkepohl (2005, chapters 6-8) for more details.
Similar to univariate models for short-term forecasting, we will consider VAR and VEC models with and without Google search data to evaluate the impact of this new data source for migration forecasting.

Data
We used monthly migration, search volume data, and macro variables for the 2009-2018 period to analyze how search internet data and macro variables affect migration inflows into a region and to forecast migration. In case there were several alternative data sources for the same variables, we followed previous research in the field of migration and accepted standards among data sources.

Migration data and macroeconomic variables
We employed the monthly aggregate inflow into a region from all other regions using the dataset of interregional migration inflows inside Russia as reported by the Federal State Statistics Service (FSSS), all regions included, for the 2009-2018 period. The goal of this statistical service is to estimate the number of people living in each region when the census is not conducted, and the basis for this data collection is a change in the place of permanent registration. The FSSS is the primary source of information on migration for this work because other sources do not provide the same degree of reliability and they have smaller time samples: the latest population census was held in 2010, while the Russian Longitudinal Monitoring Survey and the Russian Sample Labor Force Survey are sample studies.
It is worth noting that in Russia there is currently freedom of movement within the country (except for some closed cities and territories related to state security), unlike in the Soviet era when migration to large cities was artificially hampered by a special type of registration known as "propiska". The so-called "propiska" was canceled on October 1, 1993. In its place, the Law of the Russian Federation No. 5242-1 of 25.06.1993 introduced the so-called "registration", which is applied following the "Rules for registration and removal of citizens of the Russian Federation from registration at the place of stay and the place of residence within the Russian Federation", approved by the Decree of the Government of the Russian Federation No. 713 of 17.07.1995. This law is applied until now. Moreover, the right of movement is now enshrined in the Constitution (Article 27), and the current legislation provides only for the notification nature of the present-day registration. Therefore, if a citizen (or a foreigner) moves to a new place of residence for more than 90 days, he/she must notify the migration service within three days. The registration of the migration flows is handled by the Federal Migration Service, which was an independent federal service in 2012-2016, but it is currently a division of the Ministry of Internal Affairs (that is, the police). The registration procedure is regulated by the Government Decree No. 713 of 17.07.1995 with later amendments. The registration is carried out by the owner of the residential premises, and can take place with a personal visit to the office of the migration service, by mail, or using the state portal "Gosuslugi.ru". For further processing and use, the migration data are later transferred from the regional bodies of the Federal Migration Service to the Federal State Statistics Service.
The FSSS officially states that the migrants' statistical records are compiled upon registration and deregistration at their place of residence, as well as (since 2011) when registering at the place of stay for 9 months or more. The deregistration is carried out automatically when processing the migration data of the Russian citizens during their movements within the Russian Federation whereas, for foreign migrants, it takes place after the expiration of their period of stay, regardless of their place of former residence. Interestingly, the Federal State Statistics Service notes that the concepts of "arrivals" and "departures" affect migration data because the same person can change his place of permanent residence more than once during the year. See the official "Methodological Explanations" by the FSSS for more details 7 . We remark that there are two types of migration registration in Russia 8 : the permanent registration ("регистрация по месту жительства"), whose data are available on the Federal State Statistics Service website and are used in the paper; and the temporary registration for a predetermined period ("регистрация по месту пребывания"), which is requested by labor migrants.
Following the past Russian migration research discussed in the literature review, we used the following set of monthly variables dealing with the economic and social situation in Russia: the estimated Russian GDP 9 , the nominal wage of employees, the residential construction volume (in thousand square meters), the number of employed people in the 15-72 age class (in thousands), and the employers' need for employees (according to the Russian Federal Service for Labor and Employment). The descriptive statistics of these variables for Moscow and Saint Petersburg, respectively, are reported in Table 1, together with the FSSS sources from which they were collected. Russia has two search engines that take most of the market: Yandex and Google. In this regard, we remark that the computation of market shares for search engines is not straightforward, it can be controversial 10 , and different analytical services may provide different numbers. In the case of Russia, the two most well-known analytical services are Yandex Radar 11 and StatCounter 12 . We report in Figure 1 the market shares of Yandex and Google search engines since the beginning of 2015 for all platforms provided by these two services, together with their average (2015 is the first year when both analytical services are available). 9 We are aware that the monthly estimates of the Russian GDP are sometimes considered disputable or doubtful statistical indicators. However, despite being potentially biased measures, they provide new (updated) information that is important for policymakers, and they can be useful to improve the efficiency of any model estimates. It is for these reasons that there are several efforts to estimate monthly GDP indicators: see, for example, the Eurocoin indicator for the euro area GDP growth rate developed by Altissimo et al. (2010), the Aruoba-Diebold-Scotti Business Conditions Index proposed by Aruoba et al. (2009)   StatCounter shows that Google was the top search engine in Russia for most of the time, while the opposite is true for Yandex Radar. Given that investigating which online analytical service is more reliable goes beyond the scope of this work, we focused our attention on their simple average, and we observed that Google had a market share in the 40%-45% range, compared with a market share of 50-55% for Yandex. As we anticipated in the Introduction, Yandex provides only a limited amount of free monthly data, so that we had to use Google search data for our work. Even though the latter does not appear to be the main search engine in Russia, its high market share guarantees that its data can still provide useful insights for this research.
Google Trends is a website by Google that publishes a standardized index known as Google Index (GI), which estimates the popularity of a particular search query relative to the total number of searches in the same period in a specific region, and whose scale ranges from 0 to 100.
Although the general reach of Google Trends in Russia is wide, we found that the availability of online searches for our research purposes was quite limited, and search volumes were mostly available only from 2009 onwards. Therefore, we decided to focus only on the regions with the largest migration inflows, given that the online searches for the intentions to migrate were available only for these regions.
The top-10 regions by the total immigration flow in 2018 (see Table 2) represented the starting point that we used to look for online search queries. After comparing the volumes of migration flows in Russian regions with the availability of online search queries, we decided to choose Moscow and Saint-Petersburg that account for 12% of the total migration inflow: even though the number of migrants in these cities is comparable to the migration inflows into other regions, the number of online searches for the other regions is almost insignificant compared to these two cities.
The choice of keywords for migration research is not predefined and clear cut unlike the studies dealing with unemployment (for example), where the set of keywords 'work' ("работа") and 'vacancies' ("вакансии") is generally enough to obtain a good estimate of the intentions to find a job, see D'Amuri and Marcucci (2017) and references therein for more details. It is for this reason that Böhme et al. (2019) used a wide range of words that could potentially reflect an intention to move, including indirect interest in economic and legal issues, using for example keywords such as "GDP" and "passport". According to the previously cited Russian studies dealing with migration, the main factors that explain the decision to emigrate are finding a job in the region of interest and finding an apartment. Therefore, we used not only the general query indicating the interest in emigrating ("переезд в «название региона»") but also queries on job and housing searches ("работа в «название региона»", "жилье в «название региона»"). This choice allows us to focus on capturing the intentions to move from one region to another, whether other queries may not indicate the direct intention to relocate. Moreover, we avoided the queries including the word 'migration' ("миграция") and its derivatives because they may be associated only with a general interest in migration policy. Furthermore, we specified the name of the region to exactly identify the direction of migration. We chose these three queries because they are the most popular search queries in each respective group of words concerning relocation, finding a job, and a place to live. As a result, compared to Böhme et al. (2019), our choice of keywords may provide an underestimated number of intentions to emigrate, but the willingness to move in our case is much more certain and it contains a specific geographical component.
We used the previous three queries separately for the in-sample analysis to examine the effect of each query on the migration flow. For forecasting purposes, we also considered the average of these three time series to reduce the number of variables involved and to improve the forecasting efficiency, see e.g. Fantazzini and Fomichev (2014) and Algan et al. (2019) for details.
A first look at the data seems to show a certain degree of seasonality in the monthly inflows, particularly for Saint Petersburg. Therefore, we formally tested for seasonality using a battery of tests for the data in levels and in log-levels, which are reported in Table 3. More specifically, we used the F-test for seasonality based on the joint significance of seasonal dummies in a non-seasonal ARIMA model (where the latter is selected using the Hyndman-Khandakar (2008) algorithm), the Friedman (1937) test, the Kruskal and Wallis (1952) test, the QS test by Maravall (2011) that is a variant of the Ljung-Box test computed on seasonal lags, and the Welch (1951) test. We also implemented the Ollech-Webel (2020) test that is a machine learning (ML) classification approach, which first performs a recursive feature elimination algorithm using random forests to identify the most informative seasonality tests, and then uses their p-values as predictors within a single conditional inference tree to determine whether a time series has a significant seasonal component or not. The seasonality tests highlighted a significant seasonal component, so that we employed seasonal-ARIMA models and VAR/VEC models allowing for seasonality when modelling the monthly inflows data.

Univariate models
The best seasonal and non-seasonal ARIMA models, with and without Google search data, found using the Hyndman and Khandakar (2008) algorithm with the corrected Akaike criteria (AICC) proposed by Sugiura (1978) and Hurvich and Tsai (1989) are reported in Table 4 for both Moscow and Saint Petersburg. For sake of interest, Table 4 reports also the Bayesian Information Criteria (BIC) for each selected model.
Seasonal models have lower information criteria than non-seasonal models, and this is particularly true for Saint Petersburg, while the differences are much smaller for Moscow inflow data, thus confirming the previous seasonality tests. The Moscow data has a non-seasonal unit root, while the inflow data for Saint Petersburg displays both a seasonal and non-seasonal unit root. Interestingly, (S)ARIMA models augmented with Google search data as an exogenous regressor almost always show worse information criteria than the baseline models without Google data 13 . No qualitative differences are found when using data in levels and data in log-levels 14 . 13 The coefficients of the Google search data were never statistically significant across all models considered. These results are not reported for sake for space, but are available from the authors upon request.
14 We remark that the information criteria for the data in levels and in log-levels cannot be directly compared because the datasets used are different, see section 2.11 in Burnham and Anderson (2004) for a detailed discussion of this issue at the textbook level. Consistent with the past literature dealing with Russian migration research, we employed multivariate models for a set of variables including the migration inflows, the estimated Russian monthly GDP, the nominal wage of employees (per capita), the residential construction volume (in thousand square meters), the number of employed people in the 15-72 age class, the employers' need for employees (according to the Russian Federal Service for Labor and Employment), and the Google search data for the queries about moving in a certain region, about work and about and housing.
Information criteria selected a VAR(1) model for both Moscow and Saint Petersburg. Given the presence of seasonality, we estimated all multivariate models with centered seasonal dummies, which sum to zero over time and therefore do not affect the asymptotic distributions of testing procedures, see Johansen (1995Johansen ( , 2006 for more details. For ease of interpretation and sake of interest, we report the orthogonalised impulse responses 15 from a shock in Google searches on migration inflows in Moscow and Saint Petersburg in Figure 3 and 4, respectively, the forecast error variance decompositions 16 for the migration inflows are reported in Figure 5, while the full results are available from the authors upon request. 15 The orthogonalised impulse responses are derived from a Choleski decomposition of the error variance-covariance matrix Σ = PP ' , with P being lower triangular, see Lütkepohl (2005) for more details. 16 The forecast error variance decomposition is based upon the orthogonalised impulse response coefficient matrices and shows the contribution of the variable j to the h-step forecast error variance of variable k, see Lütkepohl (2005) for more details.    Figure 3 and 4 show that the effects of shocks in internet searches on migration inflows are not significant for queries related to emigration and housing searches, while there are significant negative effects for queries related to job searches. In the latter case, it appears that a one-time shock in internet search queries results in a negative migration inflow after approximately five months. The forecast error variance decompositions in Figure 5 show that the variances of migration inflows are mostly affected by their own variances, but the effects of online job searches and the numbers of employed people become stronger in later periods, particularly for Saint Petersburg. The negative relationship between online job searches and migration inflows is probably due to immigrants moving to the regions bordering Moscow and Saint Petersburg because of the high cost of living and traffic congestion in these two metropolises, see e.g. Efimova and Mikhaltsov (2017), Pavlovskij (2017), Varaksin and Varaksina (2017), Demidova et al. (2020), and Vakulenko and Mkrtchyan (2020).
Given the evidence of non-stationarity that emerged from the previous univariate analysis, for sake of generality and interest, we also considered a VEC model following the standard sequential specification procedure based on pretests for unit roots and cointegration. We tested for cointegration using the Johansen trace test with centered seasonal dummies and we rejected the null hypothesis of no cointegration for both Moscow and Saint Petersburg. We estimated a VEC(1) model with six cointegration relationships and a constant term in the cointegration equations for both cities. The orthogonalised impulse responses from a shock in Google searches on migration inflows in Moscow and Saint Petersburg are reported in Figures A3 and A4 in the Appendix B, respectively, while the forecast error variance decompositions for the migration inflows are reported in Figure A5 and the full results are available from the authors upon request. The IRFs and the FEVDs obtained with VEC models are qualitatively similar to those estimated with VAR models in levels, confirming a significant negative effect of online job searches on migrants inflows (for Saint Petersburg), and a much larger importance of Google searches for Saint Petersburg than for Moscow.

Out-of-sample forecasting analysis
The last step to evaluate the ability of Google search data to predict internal migration in Russia was to perform an out-of-sample forecasting analysis for both Moscow and Saint Petersburg, to forecast the monthly inflows using several competing models with and without Google data, over different time horizons. The data in January 2009 -September 2015 were used as the first training sample for the models' estimation, while the data for October 2015 -December 2018 was left for out-of-sample forecasting using an expanding estimation window.

Short-term forecasts: 1-step ahead forecasts
Three classes of models were considered for short-term forecasts for a total of 20 models: 1) ARIMA models with the dependent variable represented by the monthly inflows in levels or log-levels (2 models); 2) Google-augmented ARIMA-X models with the variables in levels or log-levels (8 models): we considered lagged Google search data for the query about moving in a certain region, queries about job and housing, as well as the average of these three queries.
3) Seasonal-ARIMA (SARIMA) models with and without Google search data, with the variables in levels or log-levels (10 models).
Additional models could surely be added, but this selection already gave important indications whether Google search data are useful for forecasting the monthly migration inflows in Moscow and Saint Petersburg. A summary of the models' performances according to the mean squared error (MSE), the mean absolute error (MAE), and the mean absolute percentage error (MAPE) is reported in Table 5 17 . The optimal seasonal and non-seasonal ARIMA models, with and without Google search data, were estimated using the Hyndman and Khandakar (2008) algorithm at each iteration of the forecasting procedure.
In general, Google-augmented time series models forecasted the monthly inflows better than models without Google data. However, the simple SARIMA model with data in logs turned out to be the best model for Saint Petersburg (even though Google-based models were close): this result was expected due to the strong local seasonality in monthly inflows, differently from Moscow where the seasonality was barely significant. This phenomenon may also explain why models with the variables in logs forecasted better than models with the variables in levels for Saint Petersburg, whereas the opposite was true for Moscow. Among Google search terms, queries about moving in a certain region or the averages of all three queries provided better forecasts than the other choices.

Long-term forecasts: 24-step ahead forecasts
The previous univariate models can also be used for long-term forecasting, but it is well known that their forecasting ability quickly degrades, see Hyndman and Athanasopoulos (2018) and references therein for more details. Moreover, if exogenous variables are present, multivariate models have to be used to build long-term forecasts.
More specifically, we used three classes of models to build long-term 24-step ahead forecasts: 1) VAR models with centered seasonal dummies, with and without Google data, with the variables in levels, log-levels, first differences, or log-returns (12 models).
2) VEC models with centered seasonal dummies, with and without Google data, with the variables in levels or log-levels (6 models).
3) Seasonal-ARIMA models, as simple univariate benchmark models, with the variables in levels or loglevels (2 models).
As for the Google search queries, we considered three possible variants: no Google data, the average of the three Google search queries, or all three Google search queries together. A summary of the models' performances according to the mean squared error (MSE), the mean absolute error (MAE), and the mean absolute percentage error (MAPE) is reported in Table 6.
In general, multivariate models with Google data forecasted better than multivariate models without Google data and much better than simple SARIMA models (as expected). In the case of Moscow, the VAR model with the variables in log levels and the average of the Google search queries was the best, while VAR models with the variables expressed in log returns (with and without Google data) provide the best forecasts: therefore, this forecasting evidence confirmed the initial in-sample analysis where the evidence of non-stationarity was much stronger for Saint Petersburg than for Moscow. Interestingly, the VEC models performed poorly, in some cases even worse than SARIMA models: these results were not a surprise because the large variance of the estimators for cointegrated models in small-medium samples is a wellknown issue in the econometric literature, see Stock and Watson (1993), Maddala andKim (1998) section 5.7 andHayashi (2000) section 10.4, for more details. Moreover, Fantazzini and Toktamysova (2015) showed that the sampling noise of Google data can exacerbate this inference problem, and using the averages of Google data can solve this issue to some extent, but not completely. This is what we also found with our data, where models with the averages of Google data often performed better than models with the separate Google search queries.
These results are consistent with a large body of the forecasting literature that shows that Google-based models outperform their competitors, see -for example-Fantazzini (2014), D'Amuri and Marcucci (2017), Borup and Schütte (2020), Aaronson et al. (2021), and references therein.

Discussion and Conclusions
There is an increasing literature that shows that Google-based models significantly outperform most of the competitors in several economic and financial applications, see Jun et al. (2018) for a review. Böhme et al. (2019) analyzed the potential of online search data in predicting migration flows for the first time, and they showed that this approach improved the forecasting performances of conventional models of the migration flow. Moreover, it provided real-time forecasts ahead of official statistics.
Following this literature, this paper used monthly migration data, Google search volume data, and macroeconomic variables for the 2009-2018 time sample to analyze how these variables affected migration inflows for the two Russian cities with the largest migration inflows: Moscow and Saint Petersburg. The choice of keywords for migration research was not predefined and clear cut, unlike previous studies dealing with unemployment or financial and economic forecasting. We followed past Russian studies that showed that the main factors explaining the decision to emigrate are finding a job (in the region of interest) and finding an apartment. Therefore, we used not only the general query indicating the interest in emigrating ("переезд в «название региона»") but also queries on job and housing searches ("работа в «название региона»", "жилье в «название региона»"). We chose these three queries because they are the most popular search queries in each respective group of words concerning relocation, finding a job, and a place to live. As a result, compared to Böhme et al. (2019), our choice of keywords may provide an underestimated number of intentions to emigrate but the willingness to move is more certain, and it contains a specific geographical component.
The empirical analysis did not provide evidence that the more people search online, the more they relocate to other regions, but we found that a one-time shock in internet search queries results in a negative migration inflow after approximately five months. We then performed an out-of-sample forecasting analysis to forecast the monthly inflows using several competing models with and without Google data, over different time horizons ranging from 1 month to 24 months ahead. In terms of short-term forecasting, Google-augmented time series models forecasted the monthly inflows usually better than models without Google data. However, the simple SARIMA model with data in logs turned out to be the best model for Saint Petersburg, thanks to the strong local seasonality in monthly inflows, whereas this was not the case for Moscow where the monthly seasonality was barely significant.
In terms of long-term forecasting, multivariate models with Google data forecasted better than multivariate models without Google data and much better than univariate models. Interestingly, the VEC models performed poorly, in some cases even worse than simple univariate models, thus confirming wellknown estimation problems in small-medium samples that can be further exacerbated by the sampling noise of Google data. These results also held after a set of robustness checks that considered multivariate models able to deal with potential parameter instability and with a large number of regressors, potentially larger than the number of observations.
Our empirical evidence showed that Google Trends does help forecast migration inflows in the two Russian cities with the largest migration inflows (Moscow and Saint Petersburg). As recently highlighted by Nikolopoulos et al. (2021 a,b), the lack of reliable hard data limits the possibility of policymakers making informed decisions, and this is why they suggested employing auxiliary data from social media such as Google Trends. Given that migration inflows represent a sensitive social issue in Russia, the option to improve the modelling and forecasting of these flows via using auxiliary data such as Google Trends can be of great help to local policymakers. This improvement is even more important if we consider that a part of these migration inflows is represented by illegal immigrants, which are not included in official statistics but can be revealed by Google Trends.
The availability to policymakers of a wide array of leading indicators for migration dynamics, ranging from online search data to telecommunications data, can be useful to plan and implement more realistic migration policies that can significantly help the inclusion process of migrants, see Sirbu et al. (2021) for a large discussion.
The negative relationship between online job searches and migration inflows is probably due to immigrants moving to the regions bordering Moscow and Saint Petersburg because of the high cost of living and traffic congestion in these two metropolises, see e.g. Efimova and Mikhaltsov (2017), Pavlovskij (2017), Varaksin and Varaksina (2017), Demidova et al. (2020), and Vakulenko and Mkrtchyan (2020). An empirical analysis including also these bordering regions would require spatial econometric models able to deal with situations when the number of variables is larger than the number of time points for the data, see e.g. Ahrens and Bhattacharjee (2015), Lam and Souza (2020), and references therein. Given that this issue goes beyond the scope of this paper and the size of the paper is already quite substantial 18 , we leave this issue as an avenue for further research.
Another possibility of future work will be to check how the empirical evidence found in this work will change when using Yandex search data in place of Google search data. To reach this aim, a direct agreement between Russian policymakers and Yandex will probably be necessary to have access to long time series of monthly search data, which currently are not available. The inclusion of such data will likely considerably improve the forecasting performances of the models proposed in this work, so we leave it as a compelling topic of further work. Acknowledgements: Dean Fantazzini, Alexey Mironenkov, and Alexey Kurbatskii gratefully acknowledges financial support from the grant of the Russian Science Foundation n. 20-68-47030.

Appendix A
Google Trends is a website (https://trends.google.com) that reports the standardized volume of Google searches for a keyword or a topic. Google Trends calculates the ratio of the number of online searches for a specific keyword (or topic) K in a given geographical region a, on a particular day t (Ka,t), to the total amount of searches for the same day and region (Ta,t): Ra,t = Ka,t / Ta,t . The obtained time series is then divided by the value of the day in which it reaches the maximum level, and multiplied by 100. The Google index (GI) for a specific keyword K on day t, and in the area a is thus given by, GIKa,t = [100  Ra,t / maxt (Ra,t)]. Google Trends tracks only queries with a minimum volume due to privacy considerations: if the search volume is too low, a value of zero is reported 19 . The data are available from an intraday time-frequency up to a monthly frequency (which was our case), depending on the selected time range. The longer is the time sample selected, the lower is the frequency provided by Google Trends (the lowest frequency possible is monthly data). Note that Google Trends allows comparing the search volumes of up to five search terms, or up to a maximum of 30 search terms grouped in a single entry using quotation marks (to return searches that match an exact expression), and using the + or -signs between the search terms to include or exclude search terms, respectively. The data are available since 2004, see https://support.google.com/trends for more details.
An example of the Google Trends interface to download the monthly data for the keywords "Работа в Москве" (="Job in Moscow") searched in Russia from 01/01/2009 until 31/12/2018, is reported in Figure   A1: Figure A1. Google Trends data for the keywords "Работа в Москве", searched in Russia. Sample: 01/01/2009 -31/12/2018. 19 In the case of zero values, the GIs were linearly re-scaled using a small positive constant, following the approach proposed by Fantazzini and Toktamysova (2015).
The monthly GIs can be downloaded as a csv file by clicking on the arrow on the right, as highlighted in Figure A1. Given that the manual download of the GIs for several keywords can become too burdensome, it can be executed using an R script and the gtrendsR package as reported below: library(gtrendsR) dat=gtrends("Работа в Москве", geo = "RU", time = "2009-01-01 2018-12-31") plot(dat) Figure A2. Google Trends data for the keywords "Работа в Москве", searched in Russia. Sample: 01/01/2009 -31/12/2018. Data downloaded using the gtrendsR package.
We remark that Google Trends data are computed using a sampling method, so the results may be slightly different if the data are downloaded on different days. A possible way to decrease the sample variability is to compute the GIs as the simple average of different data downloads performed over different days. We also tried this approach as a robustness check, but we decided to use the original raw data coming from the single downloads because we found that using the raw data does not alter the final results, similarly to what found by Fantazzini and Toktamysova (2015) and D'Amuri and Marcucci (2017).
Google Trends has both advantages and limits when forecasting migration is of concern. In general, Google Trends has several advantages in terms of economy, coverage, and immediacy: they are free of charge, and they can cover larger sets of population than some of the traditional data sources, which may suffer from sample size limits. Moreover, they can allow researchers to monitor immigrants' intentions almost in real-time. In this regard, the main advantage of online search queries is the possibility to anticipate immigrants' movement, as highlighted by Böhme et al. (2019), who validated this proposition by comparing the Gallup World Poll data about emigration 20 with the results obtained with Google Trends, and they found that Google Trends data can indeed now-cast the "genuine migration intention".
Yet, Google Trends data have also their limitations: for example, it is well known that online users may not represent the whole population, and these data may require significant cleaning, see Jun et al. (2018), Nikolopoulos et al. (2021a), and references therein. The impossibility to track specific categories of users may determine migration policies that perpetuate discrimination or neglect the needs of some groups. For these reasons, the latest research efforts try to combine online big data with more traditional data sources, see Salini et al. (2020) and Iacus and Porro (2021) for more details.
Despite these limitations, increasing literature showed that Google Trends and other online big data can still improve the understandings of migration patterns, see Hawelka et al. (2014), Zagheni et al. (2014), Moise et al. (2016), Iacus and Porro (2021), Sîrbu et al. (2021) for more details. 20 This is a survey done over more than 160 countries and that wants to find whether the local individuals are planning to move to another country and, if so, whether the plan will take place within 12 months, see http://gallup.com for more details.    Similar to the baseline case, a one-time shock in online google searches related to emigration and job queries has a negative effect on migration inflows but, differently from the baseline case, these effects are no more significant.
The lack of significance of the IRFs can probably be explained by the larger variances of the TVVAR model estimates compared to traditional VAR models with constant parameters and by the weak evidence of model instability, which makes the TVVAR model more inefficient.

C.2. Additional lags
The simple VAR(1) model used in the baseline case can be an efficient way to deal with several variables, but it is hardly realistic, considering that the decision and the entire process to emigrate may take several months, at the very least 23 . Unfortunately, given the limited size of our dataset, VAR models with more than 6 lags were numerically unstable or simply impossible to estimate. Therefore, we resorted to multivariate shrinkage estimation methods that can be applied to high-dimensional VAR models with dimensionality potentially larger than the number of observations.
More specifically, we considered the multivariate ridge regression by Hoerl and Kennard (1970). If we rewrite the VAR model described in eq. (1) in a more compact form as follows, where Y is a (Tp) × n matrix collecting the temporal observations of all endogenous variables, X is a (Tp) × (np+1) matrix collecting the lags of the endogenous variables and the constants, B is a (np+1) × n matrix of coefficients, while U is a (Tp) × n matrix of error terms, then the multivariate ridge regression estimator of B can be obtained by minimizing the following penalized sum of squared errors:

B X X I X Y
The shrinkage parameter λ can be automatically determined by minimizing the generalized cross-validation (GCV) score by Golub, Heath, and Wahba (1979):