You are on page 1of 3

A Bayesian Structural Time Series approach to forecasting

Mexico Consumer Index


Mario A. Garcia-Meza

January 11, 2018

Abstract
A bayesian structural time series model is used to forecast consumption index in
Mexico, where correlated searches in Google’s search engine are used to determine the
weekly value of the index.

1 Introduction
Every month, Mexico’s Institute of Statistics and Geography (INEGI) publishes the
Mothly Indicator of Private Consumption in the Domestic Market. This indicator is a
valuable tool for researchers, local governments and firms to make informed decisions
and build more knowledge from it. Although a period length between releases of the
indicator of one month can be a reasonable time in times of economic stability, a more
responsive flow of data may be needed in periods of recession.
Moreover, most indicators are often released with several months of delay. In the
case of the Private Consumption Index, the most recent information available is three
months old. In a context of macroeconomic volatility, the reduction of the window of
uncertainty can prove to be key for accurate policy decisions.
The existence of new sources of information means that there is room for im-
provement in the publication of indicators that can be used for macroeconomic policy
decisions. This preview of the information to be published has come to be known as
nowcasting (cf. [1]), i.e., predictions about the present, the very near future or very
recent past. For example, the GDP is released quarterly by INEGI, but it also releases
a monthly indicator of economic activity, which is a rough estimation of the same
elements that compose the Gross Domestic Product.
One possible source of data that can be useful to nowcast the consumption index
can be found in Google search queries data, available in the Google Trends and Google
Correlate [5] tools. A reasonable case can be made that enough consumption items
imply internet search activity in a way such that it is possible to infer future or present
consumption activity through peaks in searches.
This might be true even for a country like Mexico, with a relatively low broadband
penetration. The reasoning is that some important product queries might be correlated
to the intermediate demand. For example, we will further show that searches for

1
transport services are frequently correlated with the consumption index; this might
suggest that the transport of merchandise can be used as a predictor of consumption,
and, if the Google searches for the service is a big part of the purchasing process, then
the search trends can be helpful to predict consumption. Indeed, it is possible that the
users search for the transport companies to get tracking numbers, which might be seen
directly reflected in the correlation between the queries and the consumption index.
In this article, we develop a state space model to forecasting the Mexican con-
sumption index using Google search data as regressors. The private consumption is a
major component of the Gross Domestic Product of a nation and provides strategic
information to governments, firms and researchers. It is assumed that some significant
part of the consumption process of final or intermediate goods implies internet searches
and, thus, it is reasonable to believe that Google searches can be used as explanatory
variables for consumption.
Google searches have been used to predict several macroeconomic indicators, such
as motor vehicles and parts demand, unemployment and traveling (cf. [2]). Nowcasting
is becoming ever more important for central banks for policy decision.
The rest of the document is organized in the following way: In section 2 we provide
a brief description of the Private Consumption Index of Mexico, the methodology used
for collecting it and its role in policy decision. Section 3 ...

2 Private Consumption Index


Mexico’s information collection methodology is designed to match the methodologies
of international organisms, such as the United Nations, EUROSTAT, the Organization
for Economic Co-operation and Development (OECD) and the International Monetary
Fund (IMF) [3]. This means that the GDP and it’s components follow a standard
theoretical framework that helps compare one series with another. This means that
a consumption index can be compared within countries with a reasonable degree of
confidence that both measurements mean the same, provided that the statistics source
is reliable and follows the same methodology.
It would be only natural to keep a certain degree os skepticism about the compa-
rability of indexes. After all, it would be an interesting coincidence that two countries
share the same weight in the relevance of the demand of a certain industry. Nonethe-
less, the indexes and their components are clearly a reliable indicator of the state of
the economy.
The theoretical framework of the National Accounts is consistent with that of stan-
dard macroeconomic models. Thus, the aggregate demand is

Y = C + I + G + (X − M ) +  (1)
Where Y is the demand-side GDP, which is composed by the Private Consumption
C, Gross Capital Formation is measured by I, which by convention stands for invest-
ment in the demand side of the economy. The Government spendings are denoted by
G and (X − M ) denotes the net exports. It is common to include a term for variations
in existence, that is demand unaccounted for that can be explained by other terms
that cannot be classified in the components in (1).

2
Some variables can be explained with more accuracy by Google searches than others.
As we will see further in the document, the balance of trade variables tend to have less
out-of-the-box prediction power than the local variables. This makes sense, since the
export and import of goods should be subject to exogenous variables independent of
the search behavior of the country, e.g. the exchange rate.
The private consumption index is composed by consumption of national products
and imports. Domestic consumption is divided in goods and services, whereas the
imports index has only products. The information available starts in 1993, which is
the year that the record starts, in order to standardize measurements previous to the
entry to NAFTA. However, in this article we will only use the information from 2004
to 2017, that is the period available from google search data.
The information from this index is gathered by INEGI with data from different
surveys applied to firms in the manufacturing industry, services and registries from
the trade balance and the National Price Index [3]. This data is complemented with
information from producers associations and statistics derived from institutions such
as state-owned petroleum company PEMEX, the Automotive Industry Mexican As-
sociation and the Bureau of Labor Statistics of the United States of America for the
imports. Since the sources may differ in time releases, they use Denton’s method [4]
to adjust the data into a monthly release.

3 The Forecasting Model


4 Appendix
The search “1800”, although seemingly unimportant, might hint to the search for a
particular brand of tequila 1

References
[1] Marta Banbura, Domenico Giannone, Michele Modugno, and Lucrezia Reichlin.
Now-casting and the real-time data flow. ECB Working Paper Series, European
Central Bank (ECB), 2013.
[2] Hyunyoung Choi and Hal Varian. Predicting the present with google trends. Eco-
nomic Record, 88(s1):2–9, 2012.
[3] Instituto Nacional de Estadı́stica y Geografı́a. Sistema de cuentas nacionales de
méxico, fuentes y metodologı́as año base 2013: Producto interno bruto, trimestral.
Documento Metodológico, 2013.
[4] Frank T. Denton. Adjustment of monthly or quarterly series to annual totals: An
approach based on quadratic minimization. Journal of the American Statistical
Association, 66(333):99–102, 1971.
[5] Matt Mohebbi, Dan Vanderkam, Julia Kodysh, Rob Schonberger, Hyunyoung Choi,
and Sanjiv Kumar. Google correlate whitepaper. 2011.

1
See https://trends.google.com/trends/explore?date=all&geo=MX&q=1800

You might also like