AiPaper
Paper status: completed

An Artificial Trend Index for Private Consumption Using Google Trends

Published:03/28/2025
Original LinkPDF
Price: 0.10
Price: 0.10
8 readers
This analysis is AI-generated and may not be fully accurate. Please refer to the original paper.

TL;DR Summary

This paper uses Google Trends data and machine learning to develop a real-time leading indicator for private consumption in Peru. It shows that "Food" and "Tourism" search categories significantly improve forecast accuracy, reducing projection errors.

Abstract

In recent years, the use of databases that analyze trends, sentiments or news to make economic projections or create indicators has gained significant popularity, particularly with the Google Trends platform. This article explores the potential of Google search data to develop a new index that improves economic forecasts, with a particular focus on one of the key components of economic activity: private consumption (64% of GDP in Peru). By selecting and estimating categorized variables, machine learning techniques are applied, demonstrating that Google data can identify patterns to generate a leading indicator in real time and improve the accuracy of forecasts. Finally, the results show that Google's "Food" and "Tourism" categories significantly reduce projection errors, highlighting the importance of using this information in a segmented manner to improve macroeconomic forecasts.

Mind Map

In-depth Reading

English Analysis

1. Bibliographic Information

  • Title: An Artificial Trend Index for Private Consumption Using Google Trends
  • Authors:
    • Juan Tenorio (Universidad Peruana de Ciencias Aplicadas)
    • Heidi Alpiste (Universidad Peruana de Ciencias Aplicadas)
    • Jakelin Remón (Pontificia Universidad Católica del Perú)
    • Arian Segil (Universidad Nacional Mayor de San Marcos)
  • Journal/Conference: The paper is available on arXiv, which is a preprint server for academic articles in fields like physics, mathematics, computer science, and economics. It is a highly respected platform for disseminating early research, though the papers are not peer-reviewed by the platform itself.
  • Publication Year: The arXiv identifier 2503.21981 suggests a submission date in March 2025. Given the current date provided in the prompt context is October 2025, this is plausible. However, the data analysis period mentioned in the paper extends to October 2024, indicating the work was likely completed around that time.
  • Abstract: The paper investigates the use of Google search data to create a real-time leading indicator for private consumption in Peru, which constitutes 64% of the nation's GDP. By applying machine learning techniques, specifically neural networks, to categorized Google Trends variables, the authors develop an "Artificial Consumption Trend Indicator" (ACTI). The study demonstrates that this indicator improves the accuracy of economic forecasts. The results specifically show that Google search categories for "Food" and "Tourism" are particularly effective in reducing projection errors, underscoring the value of segmented, high-frequency data for macroeconomic analysis.
  • Original Source Link: The paper is a preprint available at https://arxiv.org/abs/2503.21981, with the PDF at http://arxiv.org/pdf/2503.21981v1.

2. Executive Summary

  • Background & Motivation (Why):

    • Core Problem: Official data on private consumption in Peru, a critical component of its GDP, is published with a significant delay (around 45 days). This time lag hinders the ability of policymakers and analysts to react promptly to shifts in economic activity.
    • Importance & Gaps: While traditional leading indicators (e.g., consumer confidence surveys) exist, they also suffer from publication delays and have limited predictive power, especially during stable economic periods. This creates a need for more timely and accurate methods for "nowcasting" (predicting the present) private consumption.
    • Innovation: The paper introduces a novel approach by leveraging high-frequency, real-time data from Google Trends. The core idea is that online search queries reflect consumer intentions and concerns before they translate into actual spending. The authors combine this unstructured data with advanced machine learning models (neural networks) to build a more responsive and accurate leading indicator.
  • Main Contributions / Findings (What):

    • Development of the ACTI: The primary contribution is the creation of the Artificial Consumption Trend Indicator (ACTI), a monthly index for private consumption in Peru derived from Google Trends data.
    • Superiority of Neural Networks: The study demonstrates that machine learning models, specifically Artificial Neural Networks (ANN) and Recurrent Neural Networks (RNN), are more effective at capturing the complex, non-linear patterns in consumption data compared to traditional econometric models like Principal Component Analysis (PCA) and Dynamic Factor Models (DFM).
    • Importance of Data Segmentation: The research finds that the predictive power of Google Trends data is significantly enhanced when it is segmented by category. Specifically, search terms related to "Food" and "Tourism" were found to be the most powerful predictors, substantially reducing forecast errors. This highlights that a one-size-fits-all approach to using search data is suboptimal.

3. Prerequisite Knowledge & Related Work

  • Foundational Concepts:

    • Private Consumption: This refers to the total spending by households on final goods and services. It is a major component of Gross Domestic Product (GDP) and a key indicator of economic health. In Peru, it accounts for about two-thirds of GDP (as shown in Figure A.6).
    • Leading Indicator: An economic statistic that tends to change before the rest of the economy changes. They are used to forecast future economic activity. For example, a rise in applications for building permits might signal a future rise in construction activity.
    • Nowcasting: A portmanteau of "now" and "forecasting," it refers to the prediction of the very recent past, the present, and the very near future. It is particularly useful for economic indicators like GDP that are reported with a lag.
    • Google Trends: A public web facility by Google that shows how often a particular search term is entered relative to the total search volume over time. It provides an index from 0 to 100, where 100 represents the peak popularity of the term.
    • Unstructured Data: Data that does not have a pre-defined data model or is not organized in a pre-defined manner. Google search queries are a prime example.
    • Machine Learning (ML): A field of artificial intelligence that uses statistical techniques to give computer systems the ability to "learn" from data, without being explicitly programmed.
      • Artificial Neural Network (ANN): A computational model inspired by the human brain, consisting of interconnected "neurons" that process information in layers. ANNs are adept at finding complex, non-linear relationships in data.
      • Recurrent Neural Network (RNN): A type of ANN specifically designed for sequential data, like time series. They have "memory" in the form of recurrent connections, allowing them to use information from previous time steps to inform the current one.
  • Previous Works:

    • Traditional Indicators: The paper first discusses traditional methods using consumer confidence indices like the MCSI (University of Michigan Consumer Sentiment Index) and CCI (Conference Board Consumer Confidence Index). While some studies ([5], [6]) found them useful, others ([9], [10], [12]) noted their predictive power is limited, often only significant during crises or periods of high volatility.
    • Google Trends in Economics: The literature review highlights a growing body of work using Google Trends for economic forecasting.
      • Vosen and Schmidt (2011) [13] found that Google Trends data outperformed MCSI and CCI for forecasting U.S. private consumption.
      • Woo and Owen (2019) [14] confirmed this, showing that Google Trends and news data provided additional predictive power for U.S. consumption components.
      • Similar successful applications were found in Spain [15], China (using Baidu) [16], Chile [18], and Argentina [19].
      • In Peru, previous work used Google Trends to predict employment [17] and monthly GDP [24].
    • Machine Learning in Economics: The paper cites studies that used neural networks to forecast variables like stock prices ([20], [21]), inflation [22], and GDP [23], often showing that ML models outperform traditional econometric methods like VAR models.
  • Differentiation: This paper builds on previous work by:

    1. Focusing specifically on private consumption in Peru, a key but understudied emerging market in this context.
    2. Systematically comparing advanced neural network models (ANN, RNN) against traditional methods (PCA, DFM) for constructing the indicator.
    3. Performing a robustness analysis that demonstrates the importance of segmenting Google Trends data by consumption category, rather than using an aggregated index. This provides a more nuanced understanding of which consumer behaviors are most predictive.

4. Methodology (Core Technology & Implementation)

The paper employs a multi-stage process: data collection and preprocessing, model construction using various techniques, hyperparameter optimization, and a robustness check.

  • Google Trends Data Collection and Treatment:

    • Term Selection: An initial set of ~130 search terms relevant to the Peruvian economy was selected based on a literature review. These terms were categorized (e.g., Food, Tourism, Transport).
    • Data Extraction: Monthly historical data from January 2007 to October 2024 was extracted using the Pytrends Python library.
    • Transformation: To stabilize the variance and handle different scales, the raw search volume series were transformed. First, a logarithmic transformation was applied. Then, logarithmic variations (approximating percentage changes) were calculated to capture relative changes and reduce the impact of seasonal spikes.
    • Final Selection: For the final ACTI, 26 terms related to private consumption and 23 for commerce/services were chosen based on statistical analysis (e.g., dynamic correlations shown in Figures A.8 and A.9).
  • Principal Component Analysis (PCA):

    • Principle: A linear dimensionality reduction technique used to transform a large set of correlated variables into a smaller set of uncorrelated variables called "principal components." It identifies the directions of maximum variance in the data. It serves as a benchmark model.
    • Formula: The transformation is given by: Z=XWZ = X W
    • Symbol Explanation:
      • ZZ: The resulting matrix of principal components.
      • XX: The original data matrix (search term series).
      • WW: The matrix of eigenvectors of the covariance matrix of XX.
  • Dynamic Factor Models (DFM):

    • Principle: A statistical method for modeling multivariate time series. It assumes that the dynamics of a large set of variables can be explained by a few unobserved common "factors." This is another benchmark model.
    • Formula: A DFM is represented as: Xt=ΛFt+ϵtX_t = \Lambda F_t + \epsilon_t
    • Symbol Explanation:
      • XtX_t: The vector of observed time series variables at time tt.
      • FtF_t: The vector of unobserved (latent) common factors at time tt.
      • Λ\Lambda: The factor loading matrix, which links the factors to the observed variables.
      • ϵt\epsilon_t: The vector of idiosyncratic error terms for each series at time tt.
  • Stepwise Least Square:

    • Principle: An automated method for building a regression model by iteratively adding or removing predictor variables based on statistical criteria (like minimizing mean squared error). It's used here for variable selection in the robustness analysis.
  • Artificial Neural Networks (ANN):

    • Principle: As depicted in Figure 1, ANNs consist of an input layer, one or more hidden layers, and an output layer. They learn complex, non-linear relationships by adjusting the weights of connections between neurons during a training process.
    • Loss Function: The model is trained by minimizing a loss function, typically the mean squared error (MSE) for regression tasks. minθ(1ni=1n(yif(xi;θ))2) \operatorname* { m i n } _ { \theta } \left( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } ( y _ { i } - f ( \mathbf { x } _ { i } ; \theta ) ) ^ { 2 } \right)
    • Symbol Explanation:
      • θ\theta: The set of model parameters (weights and biases).

      • nn: The number of training samples.

      • yiy_i: The true observed value for the ii-th sample.

      • xi\mathbf{x}_i: The input vector for the ii-th sample.

      • f(xi;θ)f(\mathbf{x}_i; \theta): The network's prediction for the input xi\mathbf{x}_i.

        Figure 1: Processing diagram of a artificial neural network 该图像是图示,展示了一个人工神经网络的处理结构,包括输入层、多个隐藏层和输出层,说明数据如何在各个层级之间传递和处理。

  • Recurrent Neural Networks (RNN):

    • Principle: An extension of ANNs designed for sequential data. As shown in Figure 2, RNNs have loops that allow information to persist. The output of a neuron at time tt depends not only on the current input but also on the hidden state from the previous time step, t-1. This gives the network a form of "memory."
    • Hidden State Formula: The core of an RNN is the update of its hidden state hth_t: ht=f(Whht1+Wxxt+b) h _ { t } = f ( W _ { h } \cdot h _ { t - 1 } + W _ { x } \cdot x _ { t } + b )
    • Symbol Explanation:
      • hth_t: The hidden state (memory) at the current time step tt.

      • ht1h_{t-1}: The hidden state from the previous time step t-1.

      • xtx_t: The input at the current time step tt.

      • Wh,WxW_h, W_x: Weight matrices for the recurrent and input connections, respectively.

      • bb: The bias vector.

      • ff: A non-linear activation function (e.g., tanh or ReLU).

        Figure 2: Processing diagram of a recurrent neural network (RNN) 该图像是一个示意图,展示了一个包含输入层、两个隐藏层和输出层的神经网络结构,图中蓝色区域标记的为两个隐藏层,表示其节点和连接关系,右下角标注“in RNN”,暗示该结构为递归神经网络的一部分。

  • Projection Evaluation Strategy:

    • Metrics: The accuracy of the forecasts is measured using Mean Squared Error (MSE) and Root Mean Squared Error (RMSE).
      • MSE Formula: MSE=1Tt=1T(yty^t)2 M S E = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } ( y _ { t } - \hat { y } _ { t } ) ^ { 2 }
      • RMSE Formula: RMSE=1Tt=1T(yty^t)2 R M S E = \sqrt { \frac { 1 } { T } \sum _ { t = 1 } ^ { T } ( y _ { t } - \hat { y } _ { t } ) ^ { 2 } }
      • Symbol Explanation:
        • yty_t: The observed value of private consumption growth at time tt.
        • y^t\hat{y}_t: The projected value from the model.
        • TT: The total number of projections.
    • Statistical Tests: To compare the predictive accuracy of different models, two formal tests are used.
      • Diebold-Mariano (DM) Test: A test for whether two forecast models have equal predictive accuracy.
      • Giacomini-White (GW) Test: A more general test that can evaluate the conditional predictive ability of models, useful for out-of-sample scenarios.

5. Experimental Setup

  • Datasets:

    • Input Data: Monthly Google Trends search data for approximately 130 terms in Peru, spanning from January 2007 to October 2024. This data is preprocessed as described in the methodology.
    • Target Data: Official data on private consumption in Peru for the corresponding period.
    • Other Data (for Robustness): High-frequency leading indicators for Peru, such as employment (emplo), consumer credit (credet cons), mortgage credit (credit hip), and the consumer price index (CPI).
  • Evaluation Metrics:

    • Mean Squared Error (MSE):
      1. Conceptual Definition: Measures the average of the squares of the errors—that is, the average squared difference between the estimated values and the actual value. Squaring the errors penalizes larger errors more heavily.
      2. Mathematical Formula: MSE=1Tt=1T(yty^t)2 \mathrm{MSE} = \frac{1}{T} \sum_{t=1}^{T} (y_t - \hat{y}_t)^2
      3. Symbol Explanation: TT is the number of data points, yty_t is the observed value, and y^t\hat{y}_t is the predicted value.
    • Root Mean Squared Error (RMSE):
      1. Conceptual Definition: The square root of the MSE. It brings the metric back to the same units as the target variable, making it more interpretable.
      2. Mathematical Formula: RMSE=1Tt=1T(yty^t)2 \mathrm{RMSE} = \sqrt{\frac{1}{T} \sum_{t=1}^{T} (y_t - \hat{y}_t)^2}
      3. Symbol Explanation: Same as for MSE.
    • Diebold-Mariano (DM) Test Statistic:
      1. Conceptual Definition: A statistical test used to determine if the forecast accuracy of two different models is statistically different. The null hypothesis is that both models have the same forecast accuracy.
      2. Mathematical Formula: DM=dˉσ^d2T DM = \frac{\bar{d}}{\sqrt{\frac{\hat{\sigma}_d^2}{T}}}
      3. Symbol Explanation: dˉ\bar{d} is the mean of the loss differential series (e.g., squared error of model 1 minus squared error of model 2), σ^d2\hat{\sigma}_d^2 is an estimate of the variance of dd, and TT is the number of forecasts.
    • Giacomini-White (GW) Test Statistic:
      1. Conceptual Definition: A test for conditional predictive ability, which is more general than the DM test. It can handle nested models and assess whether one model's superiority is consistent across different conditions or time periods.
      2. Mathematical Formula: GW=1nt=1nd^t GW = \frac { 1 } { \sqrt { n } } \sum _ { t = 1 } ^ { n } \hat { d } _ { t }
      3. Symbol Explanation: d^t\hat{d}_t is the difference in losses between the two models at time tt, and nn is the size of the out-of-sample evaluation period.
  • Baselines:

    • Principal Component Analysis (PCA): A standard linear method for dimensionality reduction.
    • Dynamic Factor Models (DFM): A common econometric technique for modeling large time-series datasets.
    • Stepwise Least Squares Model: A regression model using traditional high-frequency indicators as predictors, serving as a baseline for the robustness check.

6. Results & Analysis

  • Core Results:

    • Qualitative Comparison (Figure 3): The paper first presents a visual comparison of the indicators.

      • In Figure 3(a), the PCA indicator is highly volatile, while the DFM indicator is smoother but does not track private consumption well.

      • In Figure 3(b), both the RNN and ANN indicators closely follow the patterns and seasonality of actual private consumption, suggesting a much better fit. This visually confirms the superiority of neural network models for this task.

        Figure 3: Private Consumption vs. Indicators by Methodology 该图像是一个极坐标图,展示了图3中私营消费与PCA指标及DFM指标的对比,时间范围涵盖2008年至2018年,反映了不同指标随时间的变化趋势。

        该图像是一个极坐标系图表,展示了私消费(Private Consumption)与两种神经网络指标(RNN Indicator和RNA Indicator)随时间(月-年)变化的趋势对比,反映了模型预测与实际数据的拟合度。 该图像是一个极坐标系图表,展示了私消费(Private Consumption)与两种神经网络指标(RNN Indicator和RNA Indicator)随时间(月-年)变化的趋势对比,反映了模型预测与实际数据的拟合度。

    • Volatility Analysis (Figure 4): This figure further analyzes the properties of the indicators. The 3D plots suggest that the neural network indicators have variance properties that are more aligned with the target variable compared to the benchmarks.

      Figure 4: Volatility Analysis by Indicator 该图像是包含两个子图的图表,展示图4中不同指标的波动性分析。左侧图(a)为条件方差 CVar(ϵ)CVa r(\epsilon) 三维散点图,右侧图(b)为方差 Var(ϵ)Va r(\epsilon) 的三维曲面图,分别描绘时间、指标值和方差的关系。

  • Hyperparameter Calibration:

    • To ensure robust performance and avoid overfitting, the models' hyperparameters were optimized using cross-validation. The data was split into training (Jan 2008 - Aug 2014), validation (Sep 2014 - May 2022), and testing (Jun 2022 - Oct 2024) periods. The training set was further split into 5 folds for cross-validation.

    • The following table (transcribed from Table 3 in the paper) shows the optimized hyperparameter values for each model. This systematic tuning is crucial for the fair comparison of models.

      Modelo Hyperparameter Range Optimized Value
      PCA Number of Components 2 to 12 6
      DFM Number of Factors 2 to 10 4
      Series Length 0.01 to 2.5 1.2
      ANN Number of Hidden Layers 2 to 64 32
      Number of Neurons 6 to 256 64
      RNN Number of Hidden Layers 2 to 48 24
      Number of Neurons 6 to 256 32
      [Likely a typo in paper, possibly learning rate?] 2.5 to 6.5 2.1
    • Figure 5 shows the performance of the optimized models, visually confirming their good fit on both monthly and quarterly data.

      Figure 5: Private Consumption vs. Optimized Neural Network Indicators 该图像是四个子图组成的图表,展示了图5中不同方法(最优超参数和先验)下的私有消费指数(ITAC)与贸易指数的月度和季度比较,反映了模型对消费和贸易时间序列的拟合效果。

  • Robustness Analysis:

    • This analysis evaluates the out-of-sample predictive power of the Google Trends data in a two-stage process.

      1. Stage 1: A baseline forecast is created using traditional indicators (employment, credit, CPI) selected via Stepwise Least Squares.
      2. Stage 2: This baseline forecast is then augmented with the ITAC (the index created from Google Trends), segmented by different search categories (Food, Transport, Tourism, etc.).
    • The key question is whether adding the category-specific Google Trends information significantly improves the baseline forecast. Table 4 presents the results, showing the MSE, RMSE, and p-values from the DM and GW tests. The null hypothesis for the tests is that the augmented model is not more accurate than the baseline.

    • The table below is a transcription of Table 4 from the paper.

      Models Estimate MSE RMSE p-value (DM) p-value (GW)
      Food 0.614 2.35 1.40 0.029 0.002
      Transport 0.241 3.61 6.45 0.057 0.017
      Tourism 0.795 2.02 0.98 0.005 0.032
      Recreation 0.713 4.51 5.62 0.026 0.014
      Personal care 0.727 3.56 6.61 0.049 0.059
      Total 0.791 1.69 1.12 0.001 0.002
    • Interpretation:

      • The low p-values (most are < 0.05) for both the DM and GW tests indicate that we can reject the null hypothesis. This means that adding the Google Trends data significantly improves forecast accuracy.
      • The "Food" and "Tourism" categories show particularly strong results, with very low p-values and the lowest MSE/RMSE values (along with the total index). This is the core finding: segmenting the data and identifying the most relevant categories is key to building a powerful predictive model. The total aggregated index also performs very well, likely driven by these strong components.

7. Conclusion & Reflections

  • Conclusion Summary:

    • The study successfully demonstrates that unstructured data from Google Trends can be used to construct a high-frequency, real-time indicator for private consumption in Peru.
    • The combination of Google search data with Recurrent Neural Network (RNN) models is particularly effective, outperforming traditional econometric techniques by better capturing the complex, non-linear dynamics of consumer behavior.
    • A critical insight is that the effectiveness of Google Trends data is maximized through a segmented approach. Treating different consumption components separately—especially "Food" and "Tourism"—leads to significant improvements in forecast accuracy. This suggests that how consumers search for different goods and services contains distinct predictive signals.
    • The findings have strong practical implications, offering policymakers and economists a valuable tool for more timely economic monitoring and decision-making, especially in environments with data lags.
  • Limitations & Future Work:

    • Authors' Stated Future Work: The authors suggest that exploring daily and weekly Google Trends data could lead to even higher-frequency indicators, allowing for more agile economic analysis.
    • Implicit Limitations:
      • Data Stability: The underlying Google search algorithm can change over time, potentially affecting the stability and interpretation of the Trends index.
      • Search Behavior: The relationship between search behavior and actual consumption might change, for example, due to the rise of new e-commerce platforms or apps that bypass traditional search engines.
      • Generalizability: While effective for Peru, the specific search terms and categories that are most predictive may not generalize to other countries without careful adaptation.
      • Causality: The model identifies strong correlations, but does not establish causality. Searches might precede consumption, but they could also be driven by a common external factor.
  • Personal Insights & Critique:

    • Novelty: The paper's main strength lies in its rigorous application and validation of modern machine learning techniques for a specific, high-impact problem in an emerging economy. The emphasis on data segmentation is a valuable and practical contribution that moves beyond simply creating a single aggregated index.
    • Practical Impact: For an institution like the Central Reserve Bank of Peru (BCRP), where one of the authors of a cited paper [24] is affiliated, this kind of tool is immensely practical. It can provide early warnings of economic slowdowns or accelerations weeks before official data becomes available.
    • Critique: The paper could have benefited from a more detailed discussion of the specific search terms within the winning categories ("Food" and "Tourism"). What kind of food searches are most predictive (e.g., restaurants vs. groceries)? This would provide deeper economic intuition. Additionally, the paper mentions using Long Short-Term Memory (LSTM) networks as a variant of RNNs but doesn't clarify if they were the specific architecture used; given their prevalence for mitigating RNN issues, this would have been a valuable detail.
    • Open Questions: How does this index perform during major, unforeseen economic shocks like the COVID-19 pandemic? The timeline includes this period, and a specific analysis of its performance then would be a powerful test of its robustness. Furthermore, could this methodology be integrated with other alternative data sources, such as credit card transactions or satellite imagery of retail parking lots, to create an even more powerful composite nowcasting model?

Similar papers

Recommended via semantic vector search.

No similar papers found yet.