2021 AN AUTOMATIC ALGORITHM TO DATE THE REFERENCE CYCLE OF THE SPANISH ECONOMY - Documentos de Trabajo

Page created by Lucille George
 
CONTINUE READING
AN AUTOMATIC ALGORITHM TO DATE
THE REFERENCE CYCLE OF THE
                                      2021
SPANISH ECONOMY

Documentos de Trabajo
N.º 2139

Máximo Camacho, María Dolores Gadea
and Ana Gómez Loscos
AN AUTOMATIC ALGORITHM TO DATE THE REFERENCE CYCLE OF THE
SPANISH ECONOMY
AN AUTOMATIC ALGORITHM TO DATE THE REFERENCE
CYCLE OF THE SPANISH ECONOMY (*)

Maximo Camacho (**)
UNIVERSITY OF MURCIA

María Dolores Gadea (***)
UNIVERSITY OF ZARAGOZA

Ana Gómez Loscos (****)
BANCO DE ESPAÑA

(*) We thank seminar participants at Banco de España seminar. M. Camacho and M. D. Gadea are grateful for the
support of grants PID2019-107192GB-I00 (AEI/10.13039/501100011033) and 19884/GERM/15, and ECO2017-
83255-C3-1-P and ECO2017-83255-C3-3-P (MICINU, AEI/ERDF, EU), respectively. Data and codes that replicate
our results are available from the authors’ websites. The views in this paper are those of the authors and do not
represent the views of the Banco de España, the Eurosystem, or the Spanish Business Cycle Dating Committee.
(**) Department of Quantitative Analysis, University of Murcia. Campus de Espinardo 30100 Murcia (Spain). Tel: +34
868 887 982 and e-mail: mcamacho@um.es.
(***) Department of Applied Economics, University of Zaragoza. Gran Vía, 4, 50005 Zaragoza (Spain). Tel: +34 976
761 842 and e-mail: lgadea@unizar.es.
(****) Banco de España, Alcalá, 48, 28014 Madrid (Spain). Tel: +34 91 338 58 17 and e-mail: agomezloscos@bde.es.

Documentos de Trabajo. N.º 2139
November 2021
The Working Paper Series seeks to disseminate original research in economics and finance. All papers
have been anonymously refereed. By publishing these papers, the Banco de España aims to contribute
to economic analysis and, in particular, to knowledge of the Spanish economy and its international
environment.

The opinions and analyses in the Working Paper Series are the responsibility of the authors and, therefore,
do not necessarily coincide with those of the Banco de España or the Eurosystem.

The Banco de España disseminates its main reports and most of its publications via the Internet at the
following website: http://www.bde.es.

Reproduction for educational and non-commercial purposes is permitted provided that the source is
acknowledged.

© BANCO DE ESPAÑA, Madrid, 2021

ISSN: 1579-8666 (on line)
Abstract

This paper provides an accurate chronology of the Spanish reference business cycle by
adapting the multiple change-point model proposed by Camacho, Gadea and Gómez
Loscos (2021). In that approach, each individual pair of specific peaks and troughs from
a set of indicators is viewed as a realization of a mixture of an unspecified number
of separate bivariate Gaussian distributions, whose different means are the reference
turning points and whose transitions are governed by a restricted Markov chain. In
the empirical application, seven recessions in the period from 1970.2 to 2020.2 are
identified, which are in high concordance with the timing of the turning point dates
established by the Spanish Business Cycle Dating Committee (SBCDC).

Keywords: business cycles, turning points, finite mixture models, Spain.

JEL classification: E32, C22, E27.
Resumen

Este trabajo proporciona una cronología precisa del ciclo económico de referencia
de la economía española. Para ello, se adapta el procedimiento de fechado, que
considera la posibilidad de múltiples puntos de cambio en la fase del ciclo, propuesto
por Camacho, Gadea y Gómez Loscos (2021). En dicho enfoque, cada par individual de
picos y valles específicos, obtenidos a partir de un conjunto de indicadores económicos,
se considera como una realización de una mixtura de un número no especificado de
diferentes distribuciones gaussianas bivariantes, cuyas medias son los puntos de cambio en
la fase del ciclo de referencia y cuyas transiciones se rigen por una cadena de Markov
restringida. En la aplicación empírica, se identifican siete recesiones en el período
comprendido entre 1970.2 y 2020.2. Este fechado es muy similar al establecido por el
Comité de Fechado del Ciclo Económico Español.

Palabras clave: ciclos económicos, puntos de cambio en la fase del ciclo, modelos de
mixturas finitas de distribuciones, España.

Códigos JEL: E32, C22, E27.
An automatic algorithm to date the reference cycle of the Spanish economy             2

      1           Introduction
      Although it seems a truism truth, the business cycle turning points, the dates at which the economy
      switches from expansion to recession and vice versa, are not directly observable. Indeed, determin-
      ing the reference cycle peaks and troughs is very crucial for policy makers, for businesses and for
      the academia because they are used to determine the causes of recessions, to design public policies,
      to guide investors and to test competing economic theories, among others.
             Aware of this requirement, Martin Feldstein established a Business Cycle Dating Committee
      of National Bureau of Economic Research (NBER) scholars and gave it responsibility for business
      cycle dating when he took over the institution in 1978. In sum, the committee looks at various
      coincident indicators to make informative judgments on when to set the historical dates of the
      peaks and troughs of the past US business cycles. Following these guidelines, other countries have
      been creating similar committees, such as the Euro Area Business Cycle Dating Committee of the
      Center for Economic Policy Research, founded in 2002, and the Spanish Business Cycle Dating
      Committee (SBCDC) of the Spanish Economic Association, created in 2014.
             Despite the interest in establishing and maintaining a historical chronology of the business
      cycle, the dating methodology of the Committees has received some criticism as their decisions
      represent the consensus of individuals. Thus, their dating methodology is neither transparent nor
      reproducible. In addition, the dating committees date the turning points with a considerable lag,
      which last more than two years in some cases. This reduces the interest of the committees’ decisions
      to provide real-time assessments of the business cycle changes.
             To overcome these drawbacks, this paper codifies in a systematic and transparent way a his-
      torical chronology of business cycle turning points for Spain. Following the business cycle concept
      of Burns and Mitchell (1946), we consider the reference cycle as a set of dates of wave-like move-
      ments occurring at about the same time and in many economic activities. Its computation requires
      collecting a number of coincident indicators and determining global change-points, from which the
      reference cycle can be extracted using average-then-date or date-then-aggregate methods. The first
      case consists on summarizing the coincident information in a single composite indicator from which
      the turning points are determined. The second case first identifies turning points in the individual
      indicators and looks for common turning points. Although the literature has focused primarily on
      average-then-date methods, the date-then-average alternative has recently proved to be successful
      in dating the turning points. Examples of the latter are Harding and Pagan (2006, 2016), Chauvet
      and Piger (2008), and Stock and Watson (2010, 2014).
             Against this background, Camacho et al. (2021) recently proposed a novel date-then-average
      methodology that views the reference cycle as a multiple change-point mixture model. They con-
      sider that the reference cycle is a collection of increasing change-points (peak-trough dates) that
      segment the time span into non-overlapping episodes. With the help of a Markov-switching mix-
      ture model representation, the method classifies the dates and the specific turning points, which
      are viewed as realization of a mixture of Gaussian distributions.
             This method has a number of important advantages over other date-then-average methods.
                     An automatic algorithm to date the reference cycle of the Spanish economy             3
      First, the number of historical change-points are data-driven, so the estimates are not conditioned
      by the known occurrence of a phase shift as in Stock and Watson (2010, 2014). Second, the
      estimation is simple as it is estimated using standard Bayesian techniques of finite Markov mixture
      models. Third, the reference dates are population concepts, which allows us to make inferences in
      contrast to Harding and Pagan (2006, 2016). Four, missing data for some coincident indicators is
            7 DOCUMENTOas
      not a problem
BANCO DE ESPAÑA
                            they only imply determining some reference cycles from less observations. Five,
                        DE TRABAJO N.º 2139

      the detection of phase changes in real time is a simple as it reduced to a classification problem. This
      method was successfully applied to date the US business cycle by using several monthly coincident
estimation is simple as it is estimated using standard Bayesian techniques of finite Markov mixture
      models. Third, the reference dates are population concepts, which allows us to make inferences in
      contrast to Harding and Pagan (2006, 2016). Four, missing data for some coincident indicators is
      not a problem as they only imply determining some reference cycles from less observations. Five,
      the detection of phase changes in real time is a simple as it reduced to a classification problem. This
      method was successfully applied to date the US business cycle by using several monthly coincident
      indicators.
             This paper addresses the challenge of applying this methodology to achieve the reference cycle
      dates in Spain in a quarterly basis. This poses us several difficulties. Our first challenge was col-
      lecting a set of coincident economic indicators with homogeneous quality information throughout
      the entire sample given that the Spanish economy has suffered from dramatic transformations in
      the last five decades, especially in the seventies and eighties. Our second challenge was adapting
      the method to a quarterly basis. In order to date the turning points of each quarterly indicator,
      we employ either the so-called BBQ algorithm -proposed by Harding and Pagan (2002), who ex-
      tend the monthly algorithm of Bry and Boschan (1971) to a quarterly basis- or the parametric
      Markov-Switching procedure -proposed by Hamilton (1989)- depending on the characteristics of
      each indicator.
             We evaluate the extension of the Camacho et al. (2021) algorithm developed in this paper in
      terms of its capacity to generate the SBCDC reference cycle for Spain. The results of this exercise
      suggest that our approach is capable of identifying the SBCDC turning points with reasonable
      accuracy. Leaving aside the period of the late 1970s and early 1980s, where some deviations occur
      with respect to the chronology established by the SBCDC, the method clearly identifies the crisis
      of the 1990s, the double dip with which Spain received the impact of the Great Recession and,
      finally, the current impact of the Covid-19 pandemic. Thus, we consider that this method can be
      very useful to complement and guide the work carried out by the SBCDC in dating the Spanish
      business cycles.
             The rest of the paper is organized as follows. Section 2 summarizes the methodology proposed
      in Camacho et al. (2021) which estimation technique is described in Section 3. Section 4 presents
      the empirical application to date the reference cycle of the Spanish reference cycle since the 70s.
      Finally, Section 5 concludes.

      2           Multiple change-point model
      Reference cycle dates can be obtained from the estimates of a multiple change-point model with an
      unknown number of K breaks. In practice, we have data in the bivariate time series τ = {τ1 , ..., τN }
      of the specific pairs of turning point dates collected from a set of coincident economic indicators.
      Each of these turning points, τi , contains a peak date, τiP , and a trough date, τiT , and determines
      the start and the end of one specific recessions for a particular coincident indicator. For estimation
      purposes, the observed pairs of turning point dates are stacked in ascending order, meaning that
                      An automatic algorithm to date the reference cycle of the Spanish economy                     4
      τiP ≤ τi+1
             P and τ T ≤ τ T , for i = 1, . . . , N − 1.
                    i     i+1
          The approach described in Camacho et al. (2021) assumes that each individual pair of peak and
      trough dates in a reference cycle k, τi , is a realization of a density conditioned by τ i−1 = {τ1 , ..., τi−1 }
      that depends on the two dimension vector µk = (µPk , µTk )′ and a covariance matrix Σk . The reference
      cycle dates are viewed as the means of these distributions, around which the specific turning point
      dates dates are clustered. The means and covariances change at unknown time periods breaking the
      time span of interest into segments corresponding to the periods occupied by the k = 1, 2, . . . , K
      business
            8 cycles.
BANCO DE ESPAÑADOCUMENTO DE TRABAJO N.º 2139

             We collect the distribution parameters in the reference cycle k in θk = (µk , Σk ) and assume
      that these parameters remain constant within each regime and change their values when a regime
      change occurs. Then, given that the state is k, τi is drawn from the population given the conditional
that depends on the two dimension vector µk = (µPk , µTk )′ and a covariance matrix Σk . The reference
      cycle dates are viewed as the means of these distributions, around which the specific turning point
      dates dates are clustered. The means and covariances change at unknown time periods breaking the
      time span of interest into segments corresponding to the periods occupied by the k = 1, 2, . . . , K
      business cycles.
             We collect the distribution parameters in the reference cycle k in θk = (µk , Σk ) and assume
      that these parameters remain constant within each regime and change their values when a regime
      change occurs. Then, given that the state is k, τi is drawn from the population given the conditional
      density
                                                          τi |Ti−1 , θk ∼ p(τi |τ i−1 , θk )                 (1)

      for k = 1, . . . , K, where p(τi |τ i−1 , θk ) is the Gaussian density N (µk , Σk ). Let us collect all the
      unknown distribution parameters in θ = (θ1 , ..., θK ).
             This multiple change-point model can be formulated in terms of an integer-valued unobserved
      state variable s referred to as the state of the system and that controls the regime changes. In
      particular, the discrete random variable is allowed to take values in the set {1, . . . , K} in the whole
      sequence of realizations, which are collected in S = (s1 , . . . , sN ). Thus, si = k indicates that τi is
      drawn from p(τi |Ti−1 , θk ).
             The indicator variable si is modeled as a discrete time, discrete-state first-order Markov chain,
      which implies that the probability of a change in regime depends on the past only through the
      value of the most recent regime. In this case, the probability of moving from regime l to regime k
      at observation i conditional on past regimes and past observations τ i−1 is

                                  Pr(τi = k|si−1 = l, ..., s1 = w, τ i−1 ) = Pr(si = k|si−1 = l) = plk .     (2)

             In this context, the transition probabilities are constrained to reflect the one-step ahead dy-
      namics of the multiple change-point specification. In particular, the order constraints of the break
      point model hold when the transition probabilities hold the following restrictions
                                                                         
                                                                         
                                                                          pll          if k = l ̸= M
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         1 − p         if k = l + 1
                                                                                   ll
                                                P r(si = k|si−1 = l) =                                  .    (3)
                                                                         
                                                                          1            if l = K
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         0             otherwise

      The restrictions imply that when the process reaches one regime, for example regime l, it remains in
      this regime with probability pll or moves to regime l+1 with a probability 1−pll . The process starts
      at regime 1 and moves forward (never backward) to the next regime until it reaches regime K in
      which the process stays permanently. Let us collect the transition probabilities {p11 , . . . , pK−1K−1 }
      in the vector
                 Anπ.
                    automatic algorithm to date the reference cycle of the Spanish economy                     5

      3           Bayesian estimation
      The problem is assigning each specific turning point τi to an unknown reference cycle by making
      inference on the unobserved allocation si . To perform the estimation of the parameters collected in
      θ and π and the inference on the set of allocations S, Chib (1998) describes a Markov Chain Monte
      Carlo (MCMC) algorithm. From the set of observations, the algorithm is implemented using the
      Gibbs sampler by simulating the conditional distribution of the parameters given the states, and
      the conditional distribution of the states given the parameters.

BANCO DE ESPAÑA   9 DOCUMENTO DE TRABAJO N.º 2139
      3.1         Simulation of the parameters
      Let us consider sampling the transition probabilities and the parameters of the Gaussian distribu-
      tions given the observations and their corresponding allocations, which are assumed to be inde-
Gibbs sampler by simulating the conditional distribution of the parameters given the states, and
      the conditional distribution of the states given the parameters.

      3.1         Simulation of the parameters
      Let us consider sampling the transition probabilities and the parameters of the Gaussian distribu-
      tions given the observations and their corresponding allocations, which are assumed to be inde-
      pendent. Starting with the transition probabilities, Albert and Chib (1993) showed that the full
      conditionalAn
                 distribution
                    automaticπ|S, τ is independent
                              algorithm             of reference
                                          to date the   τ given S.cycle
                                                                   Following Chib
                                                                        of the     (1998),
                                                                               Spanish     we simulate the5
                                                                                       economy
      transition probabilities from π|S using independent Beta priors, pkk ∼ Beta(a, b). The posteriors
      remain independent and also follow Beta distributions
      3           Bayesian estimation
                                       pkk |Sturning
      The problem is assigning each specific  ∼ Beta(a  + nτkk to
                                                     point     ,b +
                                                                  an1),                            (4)
                                                                     unknown reference cycle by making
                                                            i
      inference on the unobserved allocation si . To perform the estimation of the parameters collected in
      where nkk is the number of periods the process stays in regime k, with k = 1, . . . , K.1
      θ and π and the inference on the set of allocations S, Chib (1998) describes a Markov Chain Monte
           To sample θ conditioned to the data and their allocations, we propose an independent normal
      Carlo (MCMC) algorithm. From the set of observations, the algorithm is implemented using the
      inverse-Wishart prior. Conditional on the mean µk the prior of the inverse covariance matrix is
      Gibbs  sampler −1  by simulating the conditional  distribution of the −1parameters given the states, and
      Σ−1
        k  ∼ W  (c 0 , C 0 ) and the posterior is Σ−1
                                                      |S, τ, muk ∼ W (c k , C  ), where
      the conditional distribution of the states kgiven the parameters. k

                                        c k = c 0 + Nk                                                           (5)
      3.1         Simulation of the parameters                                  ′
                                   Ck = C 0 +             (τi − µk ) (τi − µk ) .                       (6)
      Let us consider sampling the transition probabilities
                                                 i:s i =k      and the parameters of the Gaussian distribu-
      tions given the observations and their corresponding allocations, which are assumed to be inde-
      In addition, conditional on the covariance matrix, the prior distribution for the means is µk ∼
      pendent. Starting with the transition probabilities, Albert and Chib (1993) showed that the full
      N (b0 , B0 ), and its posterior is µk |S, τ, Σk ∼ N (bk , Bk ), where
      conditional distribution π|S, τ is independent of τ given S. Following Chib (1998), we simulate the
      transition probabilities from Bπ|S =       � independent
                                             using                    
                                                                   −1 −1priors, pkk ∼ Beta(a, b). The posteriors
                                         k         B0−1 + Nk (S)ΣBeta
                                                                   k                                         (7)
                                                         
      remain independent and also follow Beta distributions                         
                                                                          
                                       bk = Bk (S) B0−1 b0 + Σ−1       k        τi  .                      (8)
                                              pkk |S ∼ Beta(a + nkk , b +i:s1),
                                                                            i =k                             (4)

      Given nthe
      where        data, one can easily sample means and covariances from their conditional
               kk is the number of periods the process stays in regime k, with k = 1, . . . , K.
                                                                                                1 posterior
                  An automatic algorithm to date the reference cycle of the Spanish economy               6
      distributions.
           To sample θ conditioned to the data and their allocations, we propose an independent normal
           1
         Note that NKK+1
      inverse-Wishart    = 1. Conditional on the mean µk the prior of the inverse covariance matrix is
                      prior.
      3.2
      Σ−1 Simulation−1   of the states        −1                      −1
       k ∼ W (c0 , C0 ) and the posterior is Σk |S, τ, muk ∼ W (ck , Ck ), where

      Let us consider now the question of sampling the states from the distribution S|θ, π, τ . Using the
                                       c k = c 0 + Nk                                                      (5)
      properties of the first-order Markov    chain, this
                                                      distribution can be ′stated as
                                      Ck = C 0 +            (τi − µk ) (τi − µk ) .                        (6)
                                                                  −1
                                                  i:si =k N  N                           
                             Pr (S|θ, π, τ ) = Pr sN |θ, π, τ         Pr si |si+1 , θ, π, τ i ,            (9)
      In addition, conditional on the covariance matrix, the     i=1 prior distribution for the means is µk ∼

      N (b0 , B0 ), and its posterior is µk |S, τ, Σk ∼ N (bk , Bk ), where
      where   the last of these distributions is degenerated because we assume that the process starts at
      s1 = 1.                                     �                     −1
                                      Bk = B0−1 + Nk (S)Σ−1          k                                (7)
          Chib (1996) showed that each of the probabilities           in expression(9) holds
                                                                              
                                      bk = Bk (S)         B0−1 b0 + Σ−1  τi  .                  (8)
                                  P r si |si+1 , θ, π, τ i ∝ Pr (si+1 |sik) Pr   si |θ, π, τ i .
                                                                             i:s =k
                                                                                                     (10)
                                                                           i

      The
      Givenfirst
              theingredient
                   data, oneincan
                               thiseasily
                                     expression
                                          samplerefers to and
                                                   means  the transition
                                                              covariancesprobabilities, which are simulated
                                                                            from their conditional  posterior
      from  the distribution.
      distributions.
                                                         
         1 The second ingredient in (10), Pr s |θ, π, τ i , refers to the filtered probabilities and requires
          Note that NKK+1 = 1.                    i
                                                                                  
      a recursive calculation. Starting from an initial value Pr s0 = k|θ, π, τ 0 , with k = 1, . . . , K, the
             10 DOCUMENTO
      following
BANCO DE ESPAÑA
                two steps       are carried out recursively for i = 1, ..., N .2 First, the one-step ahead prediction
                          DE TRABAJO N.º 2139

      with the information up to turning point i − 1

                                                          K
                                                          
                                                                                       
The first ingredient in this expression refers to the transition probabilities, which are simulated
       The first ingredient in this expression refers to the transition probabilities, which are simulated
       The
       from first        ingredient in this expression refers to the transition probabilities, which are simulated
                 the distribution.
       from the distribution.                                                                      
       fromThe   the second
                        distribution.
                             An automatic
                                    ingredient     algorithm
                                                        in (10), to      Pr dates |θ,the         i , refers to
                                                                                           π, τreference                    cycle
                                                                                                                                the of        the Spanish
                                                                                                                                         filtered                    economy
                                                                                                                                                         probabilities           and requires6
               The second ingredient in (10), Pr sii |θ, π, τ ii , refers to                                              the filtered0probabilities                         and requires
               The second
      a recursive            An     ingredient
                              calculation.
                                  automatic             in (10),
                                                  Starting
                                                   algorithm       from  Pr date
                                                                         to      si |θ,
                                                                                an         π, τreference
                                                                                       initial
                                                                                          the         , refers
                                                                                                    value           Pr to  cycle
                                                                                                                             s0the= k|θ, filtered
                                                                                                                                        of    the        
                                                                                                                                                         probabilities
                                                                                                                                                 π, τSpanish
                                                                                                                                                           ,   with    k
                                                                                                                                                                     economy=    and
                                                                                                                                                                                1, . . . requires
                                                                                                                                                                                         , K, the7
      a recursive calculation. Starting from an initial value Pr s0 = k|θ, π, τ 00 , with k = 1, . . . , K, the
       afollowing
           recursive     two  calculation.
                                 steps are        Starting     outfrom          an initial    for value
                                                                                                    i = 1, Pr                    2
                                                                                                                    ..., Ns0. =First,   k|θ, π,the   τ one-step
                                                                                                                                                           , with kahead    = 1, . prediction
                                                                                                                                                                                     . . , K, the
       3.2
        following  Simulation
                         two steps are     of carried
                                                 the states
                                                carried
                                                                      recursively
                                                               out recursively for i = 1, ..., N .22 First, the one-step ahead prediction
        following        two steps areupcarried
        with the information                       to turning            point i − 1for i = 1, ..., N . First, the one-step ahead prediction
                                                               out recursively
        withusthe
       distinct
       Let              information
                      cluster
                    consider       separate
                                    now      up from
                                            the    to turning
                                                   question              point
                                                             otherofclusters
                                                                           sampling   i −of1specific business cycle turning point dates. Notably,
       with the information up to turning point                                       i − 1the states from the distribution S|θ, π, τ . Using the
       despite
       properties     theofhuge       effort made
                                the first-order       Markovin thischain,  area, this  the    problem
                                                                                                 K
                                                                                                 distribution          of
                                                                                                                        choosing
                                                                                                                               can be stated     the number            of clusters is still
                                                                                i−1           K
                                                                                                                                                      i−1as 
       unsolved. So, with thePr                Praim   s    =   k|θ,     π,   τ           =            p       Pr        s         =    l|θ,    π,   τ                                         (11)
                                                     siiof= robustness,
                                                                k|θ, π, τ i−1           we    follow
                                                                                                 K lk several
                                                                                 i−1 = l=1 plk Pr si−1 = l|θ, π, τ i−1
                                                                                                                        i−1different approaches       i−1                in the empirical    (11)
       analysis.                               Pr si = k|θ, π, τ  = l=1 plk N                                Pr
                                                                                                                  −1 si−1 = l|θ, π, τ
                                                                                                                                                                                             (11)
                                             Pr (S|θ, π, τ ) = Pr sN |θ, π,                     l=1 τN                    Pr si |si+1 , θ, π, τ i ,                                             (9)
               Among theSecond,
       is computed.                likelihood-based
                                              when the methods,   i-th turning         thepointsimplest   is i=1   case is the
                                                                                                                added,            to choose
                                                                                                                                          filtered    the     model 
                                                                                                                                                         probability     with  is the    number
                                                                                                                                                                                   updated        as
       is computed. Second, when the i-th turning point is added, the filtered probability is updated as
        is
       of  computed.
            componentsSecond,
        follows                    K thatwhen    reaches   the thei-th highest
                                                                           turning marginal  point
                                                                                                         is added,
                                                                                                                  likelihood,    the
                                                                                                                                    filtered            |θK, MK , from
                                                                                                                                           log p τprobability                  is updateda set as of
        followsthe last of these distributions is degenerated
        where                                                                           Pr   si = k|θ,      becauseπ,     τ i−1  p τ |θ , τ i−1 
                                                                                                                                 we      assume
                                                                                                                                              i          that      the   process        starts    at
        follows values of {1,                                ∗                                                                   ∗                 k
      potential                             Pr..s.i, = K k|θ,      π, τ ii  =the
                                                               }, where                      si = k|θ,
                                                                                        Prupper            bound    π, τ i−1  K  pisτspecified
                                                                                                                             i−1 i−1
                                                                                                                                                         i−1  the user, M
                                                                                                                                              i |θk , τ i−1by     ,                            is a
                                                                                                                                                                                           K (12)
            =
      smixture  1.                          Pr    s i =     k|θ,   π,    τ       =    Pr     s i  =    k|θ,p   (τ π,  |θ,τ  π,  τ    p   τ
                                                                                                                                           )  i |θ k , τ          ,                            (12)
                                                                          τ i θ=
                                                                                                                      i
         1             model of K Pr        components,
                                                   si = k|θ, π,      and           K is the dK -dimensional  p (τi |θ, π, τ i−1            )
                                                                                                                                          vector        of its, maximum likelihood             (12)
               Chib     (1996)      showed       that
                                                     K      each     of    the      probabilities        p (τ  in i |θ,   π, τi−1 ) (9) holds
                                                                                                                         expression
      estimated
        where p τiparameters.
                             |θ, π, τ i−1           K Pr s = k|θ, π, τ i−1  p τ |θ , τ i−1 . Now, one can obtain the condi-
                            |θ,      i−1  =         K Pr sii = k|θ, π, τ i−1  p τii |θk                                  i−1 . Now, one can obtain the condi-
        where  Sincep    τ i
                          this   π, τ
                                  method       =
                                               tends 
                                                    k=1to      choose         models     τ i−1
                                                                                               withpa τlarge         k , τnumber
                                                                                                                              i−1 . Now,              
                                                                                                                                             of components,                we also consider
        where p τi |θ, π, τ           i−1      = Pk=1       Pr     s      k|θ,
                                                                         =            π,                          |θ     ,  τ
      tional distribution of the k=1                  r si |si+1
                                                    states,          i
                                                                  Pr ,θ,      π,i+1
                                                                           si |s
                                                                                       i
                                                                                     τ , θ,∝π,Prτ i(s i ,i+1   i     k
                                                                                                               by|sbackward                   π, τ i one
                                                                                                                        i ) Pr si |θ,recursion.          . can obtain the condi-               (10)
      selecting         criteria that
      tional distribution                     introduce
                                         of the     states, an    Pr explicit            θ, π, τ i ,term
                                                                           si |si+1 ,penalty                   by backwardfor modelrecursion.   complexity. The Akaike                    model
      tional   The distribution
                       unconstrained     of the MCMCstates,samplerPr si |sdescribedi+1 , θ, π, τabove      , by could  backward    haverecursion.
                                                                                                                                              identifiability problems                   because
      selectionThe      procedure is based
                       unconstrained            MCMC       on sampler
                                                                 choosingdescribed   the valueabove      of K could     for which  have      AIC      K = −2 log
                                                                                                                                              identifiability              p y|θK because
                                                                                                                                                                        problems            + 2dK
       The
      it is The first
                subject  ingredient
                       unconstrained
                                to potentialin   this
                                                MCMC       expression
                                                     label sampler               refers
                                                                switchingdescribed             to
                                                                                      issues. To    the
                                                                                                     above     transition
                                                                                                              identifycould the        probabilities,
                                                                                                                                   havemodel, identifiability
                                                                                                                                                          we use thewhich     are
                                                                                                                                                                        problems      simulated
                                                                                                                                                                                         because
                                                                                                                                                                               identifiability
       reaches
      it   is subject a minimum.to potential Alternatively,
                                                     label switching     one can           choose
                                                                                      issues.        Tothe    identifymodelthe       that      minimizes
                                                                                                                                           model,         we
                                                                                                                                                           use      Schwarz’s         criterion,
                                                                                                                                                                        the identifiability
       from
      it
      constraint the distribution.
           is subject       thatto potential
                                    the drawslabel     mustswitching
                                                                   imply a issues.    segmentation  To identify       of thethe      time model, span    weinto  useK  the    identifiability
                                                                                                                                                                           non-overlapping
       which is often
      constraint            thatformulated
                                    the    drawsinmust      terms  implyof minimizing               
                                                                                                  i BIC                 = the −2 log       p span y|θK into   + dKKlog       (N ).   4
      episodes,The second
      constraint            thatµthe
                          i.e.,     ingredient
                                    P    < draws
                                              µ T
We also decide the number of components by choosing the model with the number of com-
    ponents that maximizes the quality of the classification. For this purpose, we define the entropy
    as
                                              N 
                                               K
                                 ENK = −                p (si = k|τi , θ) log p (si = k|τi , θ) ,                      (13)
                                              i=1 k=1
                   An automatic algorithm to date the reference cycle of the Spanish economy                              8
    which measures how well the data are classified given a mixture distribution. The entropy takes
    the value of 0 for a perfect partition of the data and a positive number that increases as the quality
    3.4
    of the Data    problems
           classification deteriorates.
         One interesting option is to combine the aim of selecting a model with an optimal number of
    The application of finite Markov mixture models to turning point data presents two data challenges.
    components (as in the case of the likelihood-based methods) with the aim of obtaining a model
    The first is that finite mixtures of Gaussian distributions are defined for continuous data. However,
    with a good partition of the data (as proposed by model selection criteria based on entropy mea-
    the turning point dates are obtained from coincident indicators that are usually sampled at monthly
    sures). For this purpose, we also consider choosing a model whose number of components minimizes
    or quarterly frequencies and this generates a discontinuity challenge.
    BICK +ENK , which is a metric that penalizes not only model complexity but also misclassification.
         For example, when the coincident indicators are sampled at quarterly frequencies, turning
         In this context, Kass and Raftery (1995) show that a useful way to compare two models with
    points are dates in the format Y Y Y Y.q, which refers to quarter q of year Y Y Y Y . In this case, the
    different numbers of clusters Ki and Kj , is to compute twice the natural logarithm of the Bayes
    distance between the third month and the forth month of a year is lower than that between the foth
    factor Bij , which is the ratio of the two integrated likelihoods that correspond to the models with
    quarter of the same year and the first quarter of the following year. To overcome this drawback, we
    Ki and Kj clusters, respectively. Fraley and Raftery (2002) point out that this measure can be
    propose the transformation of the turning points to dates Y Y Y Y.d, where d = 1/4(q − 1), which
    approximated by the difference between the two corresponding BIC
    can obviously be changed back to recover the results in the standard quarterly calendar dates.5
         The second challenge of this approach is that the individual turning points are collected from
                                    2 log (Bij ) ≈ BIC(Ki ) − BIC(Kj ).                             (14)
    sets of disaggregated economic indicators and some of them might not be available for the full span.
    In practice,
    This quantitysome  indicators
                   provides        are reported
                             a measure  of whetherwiththe
                                                        lags
                                                          dataexhibiting
                                                                increasesmissing  observations
                                                                          or decreases  the oddsinofthe latest
                                                                                                      a model
    months
    with Ki while  others
            clusters      are to
                     relative available
                                 a modelonly
                                          withfor
                                                Kja clusters.
                                                     diminished   time
                                                               Kass andspan  because
                                                                         Raftery      they
                                                                                 (1995)    are not
                                                                                         propose     available
                                                                                                  that  values
    at
    of 2the
         logbeginning   of the2 sample.
            (Bij ) less than            In our
                                correspond      context,
                                           to weak        this is
                                                    evidence    in rarely a problem
                                                                   favor of the modelsince
                                                                                       withitKonly  impliesvalues
                                                                                               j clusters,   that
    the  probability
    between   2 and 6distributions   of turning
                        to positive evidence,    points 6atand
                                              between        early
                                                               10 toand  end dates
                                                                      strong        mustand
                                                                              evidence,   be greater
                                                                                              estimated
                                                                                                      thanfrom  a
                                                                                                            10 to
    relatively   An automatic algorithm to date the reference cycle of the Spanish economy
               lower  number of observations due to missing data.                                                         8
    very strong   evidence.
         4
       In practice, Akaike’s criterion tends to favor more complex models than Schwarz’s criterion since the latter
    3.4 Data
    penalizes
    4                problems
              over-fitted models more heavily.
             Empirical application
    The application of finite Markov mixture models to turning point data presents two data challenges.
    In this section we apply the proposed automatic algorithm to generate the reference cycle of the
    The first is that finite mixtures of Gaussian distributions are defined for continuous data. However,
    Spanish economy. Using the multiple change-point model described above to date the reference
    the turning point dates are obtained from coincident indicators that are usually sampled at monthly
    cycle turning point dates requires several steps in practice. To serve as an example to other
    or quarterly frequencies and this generates a discontinuity challenge.
    application, we review these steps in this section.
        For example, when the coincident indicators are sampled at quarterly frequencies, turning
    points are dates in the format Y Y Y Y.q, which refers to quarter q of year Y Y Y Y . In this case, the
    4.1       Collect a set of business cycle indicators
    distance between the third month and the forth month of a year is lower than that between the foth
    The  national
    quarter of the Business
                   same yearCycle Dating
                             and the       Committees
                                     first quarter of theoffollowing
                                                             the National  Bureau
                                                                     year. To      of Economic
                                                                              overcome          Research
                                                                                       this drawback, we
    (NBER)  examines
    propose the       the behavior
                transformation     of aturning
                                of the  broad set of economic
                                                points  to datesindicators.
                                                                  Y Y Y Y.d, Because
                                                                             where da=recession
                                                                                         1/4(q −influences
                                                                                                 1), which
    the
    can economy
        obviouslybroadly and back
                  be changed  is nottoconfined
                                       recover to
                                               theone  sector,
                                                   results     the standard
                                                           in the   committees   emphasize
                                                                              quarterly     economy-wide
                                                                                        calendar dates.5
    measures    of economic
         The second          activity.
                       challenge of thisTypically,
                                         approachthe    committees
                                                     is that         view real
                                                             the individual    gross domestic
                                                                            turning  points areproduct  (GDP)
                                                                                                collected  from
    as
    setsthe
          of single best measure
             disaggregated        of aggregate
                            economic   indicatorseconomic
                                                   and someactivity.
                                                              of them might not be available for the full span.
        Figure 1some
    In practice,  showsindicators
                          that GDP aredoes  not increase
                                        reported         every
                                                 with lags     single year
                                                           exhibiting       in Spain.
                                                                       missing         Instead,
                                                                                observations     there
                                                                                             in the     are
                                                                                                     latest
    particular identifiable
    months while            episodes
                   others are         during
                               available onlywhich  GDP sharply
                                              for a diminished    falls.
                                                               time  spanThe  downturns
                                                                          because        occur
                                                                                    they are notatavailable
                                                                                                   around
    the periods
    at the       designated
            beginning        as recessions
                      of the sample.  In ourbycontext,
                                                the SBCDC,
                                                       this is which
                                                               rarely aare markedsince
                                                                         problem   as shades
                                                                                       it only areas in that
                                                                                               implies   the
           6 The committee identified six recessions since the 1970s: the impact of the two oil crises in
    graph.
    the probability distributions of turning points at early and end dates must be estimated from a
    the seventies
    relatively    andnumber
               lower  early eighties, the briefdue
                             of observations    crisis
                                                    to of the nineties,
                                                       missing  data. the double dip caused by the global
         5
             In a similar fashion, when the coincident indicators are sampled at monthly frequency, the dates Y Y Y Y.mm are
       transformed into dates Y Y Y Y.d, where d = 1/12(mm − 1).
       4 6 Information
                Empirical    aboutapplication
                                         the Committee and the Spanish turning point dates can be found at
       http://asesec.org/CFCweb/en/
BANCO DE ESPAÑA 12 DOCUMENTO DE TRABAJO N.º 2139
    In this section we apply the proposed automatic algorithm to generate the reference cycle of the
    Spanish economy. Using the multiple change-point model described above to date the reference
    cycle turning point dates requires several steps in practice. To serve as an example to other
the probability distributions of turning points at early and end dates must be estimated from a
      relatively lower number of observations due to missing data.

                        An automatic algorithm to date the reference cycle of the Spanish economy                                                                 8
      4           Empirical application
                       An automatic
                       An automatic algorithm
                                    algorithm to
                                              to date
                                                 date the
                                                      the reference
                                                          reference cycle
                                                                    cycle of
                                                                          of the
                                                                             the Spanish
                                                                                 Spanish economy
                                                                                         economy                                                                  98
      In
      3.4thisData
             sectionproblems
                     we apply the proposed automatic algorithm to generate the reference cycle of the
      Spanish economy. Using the multiple change-point model described above to date the reference
       3.4
      financial  Data
       The applicationcrisisproblems
                               inof2008
                                     finiteandMarkov        mixture models
                                                     the European             sovereignto turning
                                                                                              debt crisispointindata  2010  presents    two data
                                                                                                                               and, finally,     thechallenges.
                                                                                                                                                       economic
      cycle turning point dates requires several steps in practice. To serve as an example to other
       The firstofisCovid-19
      impact             that finitepandemic.
                                          mixtures ofTo        Gaussian
                                                                   determine    distributions
                                                                                     when a particularare definedrecession
                                                                                                                        for continuous
                                                                                                                                     begins data.      However,
                                                                                                                                                and ends,       the
       The application
      application,               of finitethese
                          we review           Markov  steps mixture
                                                                in thismodels
                                                                            section.to turning point data presents two data challenges.
       the turninguses
      committee           point dates are obtained                 from     coincident       indicatorsdifficult
                                                                                                               that aretousually        sampled at monthly
       The first is that judgments
                                 finite mixtures   and of their     decisions
                                                               Gaussian             are, therefore,
                                                                                distributions         are defined for          replicate.
                                                                                                                              continuous       data. However,
       or quarterly
              To  overcome frequencies
                                   this        and this generates
                                          inconvenient,           in  this     a discontinuity
                                                                              paper     we   date        challenge.
                                                                                                      peaks      and    troughs     from     economic      indica-
      4.1        Collect
       the turning        pointa dates
                                    set of   arebusiness
                                                   obtained from    cycle       indicators
                                                                            coincident       indicators that are usually sampled at monthly
      tors    For
              usingexample,
                       thefrequencieswhenBBQ
                             so-called         the coincident indicators                   are     sampled         at quarterly frequencies,              turning
       or quarterly                            and mechanical
                                                      this generates      algorithm,       which
                                                                               a discontinuity         ischallenge.
                                                                                                          an implementation              of the methodology
      The
       points
      outlined national
                 areindates  Business
                         Harding  in the     Cycle
                                       andformat
                                               Pagan    Dating
                                                         Y(2002).
                                                            Y Y Y.q, Committees
                                                                          which
                                                                         In   short, refersof to
                                                                                         the    thequarter
                                                                                                       National   q ofBureau
                                                                                                                         year   Y YofY Economic
                                                                                                                                         Y             Research
                                                                                                                                           . In thispeaks
                                                                                                                                                        case, and
                                                                                                                                                                the
              For example,           when      the coincident             indicators       arenonparametric
                                                                                                   sampled at quarterly  algorithm       provides
                                                                                                                                       frequencies,       turning
      (NBER)
       distance of
      troughs       examines
                    between
                         a time     thethird
                                   the     behavior
                                                bymonth   of aand broad
                                                                      the   set
                                                                             forthof month
                                                                                      economic   of aindicators.
                                                                                                         year is lower   Because      a recession
                                                                                                                              than that      between  influences
                                                                                                                                                         the foth
       points are       dates     in series
                                      the format      following
                                                         Y Y Y Y.q,    three
                                                                          which  steps:
                                                                                     refers(i)toitquarter
                                                                                                       estimates  q of the
                                                                                                                         yearpossible
                                                                                                                                Y Y Y Y .turning
                                                                                                                                              In this points
                                                                                                                                                        case, the in
      the
      the    economy
       quarter     of the
              series        broadly
                             same year
                        by picking        and
                                           theand is  not
                                                  local      confined
                                                       themaxima
                                                             first quarter   to   one
                                                                                  of     sector,
                                                                                       the following the    committees
                                                                                                         it year.               emphasize
                                                                                                                       Toalternating
                                                                                                                             overcome this      economy-wide
                                                                                                                                             thedrawback,         we
       distance     between        the third       month       and theand    forth minima;
                                                                                      month of    (ii)a year ensures
                                                                                                                 is lower     than that between   troughs       and
                                                                                                                                                         the foth
      measures
       propose
      the    peaks;   of
                    theandeconomic
                           transformation
                                (iii) year activity.
                                       it applies         Typically,
                                                     of atheset  turning    the   committees
                                                                               pointsoftorules         view
                                                                                               datesthat        real
                                                                                                         Y Y meet      gross    domestic
                                                                                                               Y Y.d,pre-determined
                                                                                                                           where d = 1/4(q     product    (GDP)
                                                                                                                                                    − 1), of which
       quarter     of the    same              and the       firstofquarter
                                                                        censoring of the following           year. To        overcome this criteria
                                                                                                                                                 drawback,      the
                                                                                                                                                                  we
      as  the
      duration   single
       can obviously  and  best     measure
                             be changed of
                             amplitudes            of
                                                  back aggregate
                                                           to recover
                                                      phases       and   economic
                                                                             the results
                                                                           complete      activity.    7
                                                                                                in the To
                                                                                          cycles.          standard
                                                                                                                ease    of quarterly
                                                                                                                             comparison,  calendar
                                                                                                                                                the    dates.and
                                                                                                                                                     peaks      5
       propose the transformation of the turning points to dates Y Y Y Y.d, where d = 1/4(q − 1), which
      trough Figure
              Thedates   1 identified
                     second shows       that
                                 challenge   withGDP
                                                  of this
                                                      BBQ  does arenot
                                                              approach      increase
                                                                       plotted is that    every
                                                                                          the
                                                                                    in Figure        1single
                                                                                                 individual      year
                                                                                                         asstandard
                                                                                                             red          in Spain.
                                                                                                                    turning
                                                                                                                    vertical    points    Instead,
                                                                                                                                           are can
                                                                                                                                 lines. calendar
                                                                                                                                           As          there
                                                                                                                                                collected
                                                                                                                                                     be   seen  are
                                                                                                                                                              from
                                                                                                                                                                5 in
       can obviously         be changed           back     to recover        the results        in the                     quarterly                   dates.
      particular
       sets figure,
      the               identifiable
              of disaggregated             episodesin
                                 is noeconomic
                        there challenge   instance        during which
                                                         indicators        and GDPsome of   sharply
                                                                                                them is   falls.
                                                                                                          might      The
                                                                                                                     not be  downturns
                                                                                                                               available     occur
                                                                                                                                             for     atfull
                                                                                                                                                          around
                                                                                                                                                 thealgorithm,
                                                                                                                                                             span.
              The second                          of this which
                                                              approach   a SBCDC
                                                                               is that recession
                                                                                          the individual     not turning
                                                                                                                    identified     by the
                                                                                                                                points     areBBQ
                                                                                                                                                collected     from
      the
      which   periods
       In practice,
                 picks     designated
                           some
                          up    an            as
                                     indicators
                                     additional    recessions
                                                       are    reported
                                                        recession     byat  the
                                                                              with
                                                                            the    SBCDC,          which
                                                                                       lags exhibiting
                                                                                   begging       of   the      are    marked       as  shades     areas
                                                                                                                  missing observations in the latest
                                                                                                            eighties.                                       in  the
       sets of6disaggregated
                         An automatic    economic
                                               algorithm indicators
                                                                  to date  and    some
                                                                                the        of themcycle
                                                                                      reference           mightofnot   thebeSpanish
                                                                                                                               available     for the full span.9
                                                                                                                                        economy
      graph.
       months      The committee
                   while
              Although       others    isare
                             GDPindicators    identified
                                            the available
                                                   most        six
                                                                only recessions       since the
                                                                         for aindicator,
                                                                                  diminished           1970s:
                                                                                                 thetime      span thebecause
                                                                                                                         impact of  theythearetwonotoil recession
                                                                                                                                                         crises in
                                                                                                                                                        available
       In practice,        some                        are prominent
                                                              reported with            lags exhibiting   committees
                                                                                                                  missingemphasize
                                                                                                                               observations   thatina the    latest
      the
       at theseventies
      involves   beginning
                    a       and of
                        significantearly
                                       the   eighties,
                                              sample.
                                          decline       in  the
                                                             In ourbriefcontext,
                                                            economic       crisis    ofthis
                                                                              activity   the
                                                                                           thatnineties,
                                                                                               is  rarely
                                                                                                    is        athe    double
                                                                                                                  problem
                                                                                                         widespread              dip caused
                                                                                                                                since
                                                                                                                             across     it only
                                                                                                                                       the       by  the global
                                                                                                                                                   implies
                                                                                                                                             economy.          that
                                                                                                                                                             Thus,
       months while others are available only for a diminished time span because they are not available
      financial       crisisfashion,
       the5 Inprobability
      they                   aindistributions
                                    2008     and     theof European
                                                            turning           sovereign
                                                                          points              debtand
                                                                                      at sampled
                                                                                          early        crisis
                                                                                                            endindates2010    and,
                                                                                                                              must    finally,
                                                                                                                                      bedates    the
                                                                                                                                                 Y Y Yeconomic
                                                                                                                                            estimated      fromarea
       at theconsider            variety     of   indicators        toindicators
                                                                         determine        turning       points.      In    this  paper, it we
                                                                                                                                            onlyhave    collected
                a similar               when     the   coincident                    are               at  monthly     frequency,    the                Y.mm
      transformed
                 beginning
                        into  dates
                                   of Ythe
                                         Y  Y
                                              sample.
                                              Y.d,   where
                                                             Ind =our    context,
                                                                     1/12(mm       −
                                                                                        this
                                                                                      1).
                                                                                               is rarely      a problem         since              implies     that
      impact
      arelatively
         broad     ofsetCovid-19
                       lower
                          of  51 number pandemic.
                                    specific  of             To determine
                                                   observations
                                                  indicators        of   due
                                                                         both    to  when a data.
                                                                                     missing
                                                                                  aggregate        particular
                                                                                                   activity       and recession
                                                                                                                          employment,beginsand  andothers
                                                                                                                                                       ends, of the
          6
       the Information
              probability about  distributions          of turningand
                                            the Committee                 points the atSpanish
                                                                                          early and         end dates
                                                                                                        turning       point mustdatesbecan  estimated
                                                                                                                                                 be found  from ataa
      committee
      sectoral           uses judgments            and theirbothdecisions           are,
                                                                                      softtherefore,         difficult
                                                                                                                  TabletoA1    replicate.
       relativelynature,          which includes                     harddueand               indicators.                         in the Appendix shows
      http://asesec.org/CFCweb/en/
                       lower number           of observations                    to missing       data.
      the details of the definitions and the acronyms that will be used in the rest from
       4
              To  overcome         this
                  Empirical application
                                          inconvenient,           in  this    paper     we   date     peaks      and    troughs     of theeconomic
                                                                                                                                               work as indica-
                                                                                                                                                           well as
      tors  using the
      the sources    andso-called
                           samples. BBQ    mechanical
                                        Overall,           algorithm,
                                                   the sample     begins which   is an implementation
                                                                            in 1970.2    and ends in 2020.3,of thealthough
                                                                                                                   methodologyeach
      4
      series
             Empirical
      outlined
      In thishasin  Harding
               section          application
                                and
                          we apply
                  a different    lengthPagan
                                       theand  (2002).
                                            proposed
                                                combines  In  short,
                                                         automatic    the  nonparametric
                                                              monthlyalgorithm                 algorithm
                                                                                     to generate
                                                                         and quarterly                      provides
                                                                                                    the reference
                                                                                            frequencies.              peaks
                                                                                                                     cycle of
                                                                                                            The monthly        and
                                                                                                                                the
                                                                                                                            series
      troughs
      Spanish
      are       of  a  time
                economy.into
           transformed        series
                               Using   by  following
                                        the multiple
                                  quarterly    by takingthree   steps:
                                                         change-point
                                                            the average  (i) it
                                                                           model estimates
                                                                            of the described  the  possible
                                                                                                 above to
                                                                                     corresponding            turning
                                                                                                             date the   points
                                                                                                                        referencein
      In this  section we     apply    the proposed      automatic     algorithm     to generate the3 reference
                                                                                                         months,    although
                                                                                                                     cycle of theall
      the
      cycleseries
      series  have by
             turningbeenpicking
                         point     the local
                                 dates
                            previously         maxima
                                         requires
                                          seasonally       andsteps
                                                     several     minima;
                                                                    to in    (ii)  it ensures
                                                                           practice.     To     alternating
                                                                                              serve            the troughs
                                                                                                     as an example             and
                                                                                                                         to other
      Spanish   economy.       Using the     multiple adjusted
                                                         change-point   their original
                                                                           model          frequency.
                                                                                    described    above to date the reference
      the  peaks;
      application,  and
                      we (iii)
                          reviewit applies   a turning
                                    these steps setinofthis
                                                         censoring
                                                            section. of rules    that
                                                                                 datedmeet     pre-determined     criteria  ofalgo-
                                                                                                                                the
      cycleThe  specific
             turning        business
                         point   datescycle
                                         requires         points
                                                     several       have
                                                               steps   in been
                                                                           practice.     by applying
                                                                                         To   serve  as  either
                                                                                                         an      the
                                                                                                             example  BBQto  other
      duration
      rithm,     andthe
               when     amplitudes
                           series have  of phases    andthecomplete     cycles.7 Toprocedure
                                                                                        ease of comparison,      therepresented
                                                                                                                      peaks and
      application,    we review     thesea steps
                                            trend,inor this  Markov-Switching
                                                            section.                              ,when they are
      trough
      by       dates identified
      4.1a composite
              Collect     aindex
                             set of  with
                                    or     BBQrates.
                                        business
                                        growth     arecycle
                                                        plotted   in2Figure
                                                               indicators
                                                           Figure               1 as red vertical
                                                                       plots series-specific         lines. As
                                                                                                 recession       can bewhere
                                                                                                             episodes,    seen ina
      the   figure, there
       series-specific          is no instance
                             recession     (inbusiness
                                                 red) iniswhich
                                                            defineda SBCDC        recession
                                                                       toindicators
                                                                           be the                is  not aidentified     by totheaBBQ
                                                                                                                                    BBQalgorithm,
       4.1       CollectBusiness
       The national            a set of    Cycle      Dating   cycle
                                                                 Committees         ofperiod     from
                                                                                       the National          BBQ
                                                                                                              Bureau  peakof Economic       trough
                                                                                                                                              Research  or
      which
       periods   picks   up    an   additional       recession    at  the   begging      of  the    eighties.
       (NBER)with          a probability
                     examines       the behaviorof being      in recession
                                                       of a broad               above 0.5.indicators.
                                                                      set of economic            In addition,        Figurea recession
                                                                                                                Because         3 displaysinfluences
                                                                                                                                               the esti-
       The
       mated  national
             Although
                  probabilityBusiness
                             GDP      is
                                    thatandCycle
                                          the   most  Dating     Committees
                                                         prominent
                                           all isindicators              indicator,
                                                                are intorecession   of the
                                                                                         the
                                                                                        in eachNational
                                                                                                committees    Bureau
                                                                                                     quarter, adding      of
                                                                                                                    emphasize Economic
                                                                                                                                   that
                                                                                                                             the SBCDC    a   Research
                                                                                                                                              recession
                                                                                                                                                turning
       the economy          broadly                 not confined           one sector,       the committees           emphasize       economy-wide
       (NBER)
      involves
       points        examines
                     a significant
                  as red            the  behavior
                                        decline
                            vertical lines.          inof  a broad
                                                         economic     set  of
                                                                       activityeconomic
                                                                                    that    isindicators.
                                                                                                widespread      Because
                                                                                                                   across   a  recession
                                                                                                                             the   economy. influences
                                                                                                                                                   Thus,
       measures       of economic        activity. Typically, the committees view real gross domestic product (GDP)
       the economy
      they     consider
             The     SBCDC  broadly
                             a varietyand      is not clearly
                                           of indicators  confined    to one
                                                               to determine   in sector,
                                                                                   turning   the    committees
                                                                                                points.     In thistheemphasize
                                                                                                                       paper,
                                                                                                                           two we oil economy-wide
                                                                                                                                      have
                                                                                                                                      crisescollected
       as the    single    best recessions
                                  measure ofare                    visible
                                                     aggregate economic           these
                                                                                  activity.figures.       Dating                                is quite
       measures
      achallenging
          broad set   of due
                         economic
                         of              activity.
                              51tospecific             Typically,
                                               indicators      of    the
                                                                   both     committees
                                                                           aggregate           view
                                                                                           activity    real
                                                                                                         and  gross   domestic
                                                                                                                employment,         product
                                                                                                                                    and  others  (GDP)
                                                                                                                                                     of a
             Figure 1 shows the       thatscarce
                                              GDP numberdoes notand       low quality
                                                                     increase       every of      available
                                                                                             single     year in   series  in the
                                                                                                                     Spain.          seventies
                                                                                                                                 Instead,    there  when
                                                                                                                                                      are
       as the was
      sectoral
       Spain     single    bestwhich
                     nature,
                        under     measure
                                  the   late    of aggregate
                                          includes
                                               years    both
                                                         of        economic
                                                                hard
                                                             Franco’s   and       activity.
                                                                               soft   indicators.
                                                                          dictatorship.         The      Table
                                                                                                       first        A1 inofthe
                                                                                                               impact          the Appendix
                                                                                                                                    oil price      shows
                                                                                                                                                  rise  in
       particular identifiable episodes during which GDP sharply falls. The downturns occur at around
      the
       the   Figure
             details    1
                        of  shows
                            the       that
                                  definitions GDP   and does
                                                          the   not  increase
                                                                acronyms       that every
                                                                                      will   single
                                                                                             be   used  year
                                                                                                           in thein  Spain.
                                                                                                                     rest  of    Instead,
                                                                                                                               the  work     there
                                                                                                                                            as   well are
                                                                                                                                                        as
       the fall
             periodsof 1973    only became
                          designated                noticeable
                                            as recessions        byinthetheSBCDC,
                                                                             Spanish whicheconomy     areinmarked
                                                                                                              1975, and       the implementation
                                                                                                                         as shades      areas in the
       particular
      the
       of    sources
           several     identifiable
                         and    samples.
                       accommodative     episodes
                                              Overall,  during
                                                            the   which
                                                                  sample    GDP
                                                                             begins  sharply
                                                                                       in   1970.2falls.and Theendsdownturns
                                                                                                                       in 2020.3,  occur   at around
                                                                                                                                      although      each
       graph.    6 The     committee identified six recessions since the 1970s: the impact of the two oil1979,
                                                policies     delayed    its  impact      on    the   real    sector    until   1977.    In     crisesthein
       the periods
      series
       economy            designated
                has suffered
                       a different from     as recessions
                                       length
                                           serious andstructural
                                                         combinesby the     SBCDC,
                                                                       monthly
                                                                      problems,      and  which
                                                                                      while quarterly
                                                                                                it    are hit
                                                                                                    was      marked
                                                                                                            frequencies.
                                                                                                                  by  theassecond
                                                                                                                              shades    areas
                                                                                                                               The monthly
                                                                                                                                      rise   in   in  the
                                                                                                                                                   series
                                                                                                                                                 the   oil
       the seventies       and early eighties, the brief crisis of the nineties, the double dip caused by the global
                 6 The committee
       graph.
      are   transformed
       price,    plunging       intocountry
                               the          identified
                                       quarterly   intobyasix   recessions
                                                            taking   the and
                                                             recession          since
                                                                           average     the
                                                                                  a longof the1970s:
                                                                                             period       theweakness
                                                                                                   corresponding
                                                                                                        of      impact3of      thelasted
                                                                                                                            months,
                                                                                                                           that     twoalthough
                                                                                                                                         oiluntil
                                                                                                                                               crises   in
                                                                                                                                                       all
                                                                                                                                                     well
          5
            In  a  similar
       the seventies
      series    have        fashion,
                           and
                        been           when   the
                                  early eighties,
                                 previously         coincident
                                                        the brief
                                                  seasonally     indicators
                                                                     crisis of
                                                                 adjusted     are  sampled
                                                                               tothe           at
                                                                                       nineties,
                                                                                   their          monthly
                                                                                           originalthe        frequency,   the   dates Y Y Y
                                                                                                             double dip caused by the global
                                                                                                         frequency.                            Y.mm    are
       into   the    next   decade.
      transformed into dates Y Y Y Y.d, where d = 1/12(mm − 1).
          6 The specific business cycle turning points have been dated by applying either the BBQ algo-
          5
            Information
            In a similar
             The   SBCDC    about
                         fashion,   the the
                                  when
                              identifies   Committee
                                          twocoincident   and1974.4,
                                                                thearesignaling
                                                peaks: indicators
                                                         in           Spanish
                                                                        sampled atturning
                                                                                   amonthly  point
                                                                                     recession       dates
                                                                                              frequency,
                                                                                                  between    can
                                                                                                         the1975.1 beand
                                                                                                             dates Y Y Y found
                                                                                                                          Y.mm    at
                                                                                                                                 are
                                                                                                                            1975.2,
      http://asesec.org/CFCweb/en/
      transformed
      rithm,    when into
                       thedates  Y Yhave
                             series Y Y.d,awhere
                                             trend,d=or1/12(mm
                                                        the       − 1).
                                                              Markov-Switching       procedure     ,when   they  are represented
          7
          6
            For example, aabout
            Information      complete
                                    thecycle must last four
                                           Committee      andquarters
                                                                the at   least. Inturning
                                                                      Spanish      addition, point
                                                                                             the minimum
                                                                                                     dates duration
                                                                                                             can beof afound
                                                                                                                           recession
                                                                                                                                  at
      by
      is   a composite
         two   quarters.     index or growth rates. Figure 2 plots series-specific recession episodes, where a
      http://asesec.org/CFCweb/en/
      series-specific recession (in red) is defined to be the period from a BBQ peak to a BBQ trough or
      periods13with
BANCO DE ESPAÑA DOCUMENTO DE TRABAJO N.º 2139
                      a probability of being in recession above 0.5. In addition, Figure 3 displays the esti-
      mated probability that all indicators are in recession in each quarter, adding the SBCDC turning
      points as red vertical lines.
the sources and samples. Overall, the sample begins in 1970.2 and ends in 2020.3, although each
      series has a different length and combines monthly and quarterly frequencies. The monthly series
      are transformed into quarterly by taking the average of the corresponding 3 months, although all
      series have been previously seasonally adjusted to their original frequency.
              The specific business cycle turning points have been dated by applying either the BBQ algo-
      rithm, when the series have a trend, or the Markov-Switching procedure ,when they are represented
      by a composite index or growth rates. Figure 2 plots series-specific recession episodes, where a
      series-specific recession (in red) is defined to be the period from a BBQ peak to a BBQ trough or
      periods with a probability of being in recession above 0.5. In addition, Figure 3 displays the esti-
      mated probability that all indicators are in recession in each quarter, adding the SBCDC turning
      points as red vertical lines.
              The SBCDC recessions are clearly visible in these figures. Dating the two oil crises is quite
      challenging due to the scarce number and low quality of available series in the seventies when
      Spain was under the late years of Franco’s dictatorship. The first impact of the oil price rise in
      the fall of 1973 only became noticeable in the Spanish economy in 1975, and the implementation
      of several accommodative policies delayed its impact on the real sector until 1977. In 1979, the
      economy suffered from serious structural problems, while it was hit by the second rise in the oil
      price, plunging the country into a recession and a long period of weakness that lasted until well
                    An automatic algorithm to date the reference cycle of the Spanish economy                            10
      into the next decade.
            The SBCDC identifies two peaks: in 1974.4, signaling a recession between 1975.1 and 1975.2,
      and7 For
            in example,
                1978.3, aresulting  in a must
                          complete cycle recession   between
                                              last four quarters 1978.4
                                                                 at least. and   1979.2.theThe
                                                                            In addition,        application
                                                                                            minimum  durationof
                                                                                                              of the  BBQ
                                                                                                                 a recession
      is two quarters.
      algorithm,   delays the dating of each of these recessions by a quarter. The algorithm also identifies
      a third recession between 1981.2-1981.3, which captures the slow recovery of the Spanish economy
      in the face of the second oil price hike. This behavior differs from most of the rest of the European
      countries, which underwent a recovery at the beginning of the eighties.
              The crisis of the nineties took place between 1992.2 and 1993.2 according to the SBCDC and
      is delayed by a quarter if we apply the BBQ algorithm to GDP. It was a short intense recession
      after years of sound economic growth. The recession was synchronized with the cyclical phase of
      most European countries. A high percentage of series point to a recession: 71% of the 51 series
      detect the crisis in the quarters spanning from 1992.3 to 1993.1 and 54% lead or lag its effect.
              The global financial crisis and the European debt crisis had a strong impact on the Spanish
      economy, which involved two waves of recession separated by a brief interval of recovery. Most
      of the series accurately pinpoint the first hit of the crisis (Figures 2 and 3). Specifically, between
      2008.3 and 2009.1 (official SBCDC dates) more than two thirds of the series identified the crisis,
      although 69% had already detected it in 2008.2. The second impact, dated between 2011.1 and
      2013.2 according to SBCDC, is confirmed by 70% of the series analyzed. A non-negligible set of
      series, around 50%, did not detect the intermediate recovery period between both impacts.
              At the beginning of 2020, the world was suddenly hit by a global pandemic due to the coron-
      avirus disease. The pandemic triggered the most severe global economic crisis since World War II in
      terms of speed and intensity. To mitigate the propagation of the virus, governments implemented
      unprecedented measures, such as restrictions on movement and travel, population lockdowns, and
      social distancing in some targeted activities. Official institutions place the recession peak in the
      last quarter of 2019 or in February of 2020 at the monthly frequency. The SBCDC places the peak
      in the fourth quarter of 2019 and, therefore, the beginning of the crisis in the first quarter of 2020.
      More than 70% of the series detect the crisis, although there is a significant percentage of series,
      around 50%, that already pointed to a slowdown in the economy that was obviously not related to
      Covid-19 pandemic which, being an exogenous shock to the economy, was impossible to predict.
         Summing up, around the dates that the SBCDC identifies recessions there is a wide set of
      specific14indicators
BANCO DE ESPAÑA
                                 that show a recession. However, there are indicators that either advance (usually
                  DOCUMENTO DE TRABAJO N.º 2139

      related to the industrial sector), delay or extend the duration of recessions (for example, those
      associated with the labor market). Furthermore, not all the specific indicators have the same
      behavior in each recession.
More than 70% of the series detect the crisis, although there is a significant percentage of series,
      around 50%, that already pointed to a slowdown in the economy that was obviously not related to
      Covid-19 pandemic which, being an exogenous shock to the economy, was impossible to predict.
         Summing up, around the dates that the SBCDC identifies recessions there is a wide set of
      specific indicators that show a recession. However, there are indicators that either advance (usually
      related to the industrial sector), delay or extend the duration of recessions (for example, those
      associated with the labor market). Furthermore, not all the specific indicators have the same
      behavior in each recession.

      4.2         Select a set of highly coincident indicators
      Although Figures 2 and 3 show that the set of indicators would be useful for ascertaining whether
      a turning point has occurred, it is evident that there is considerable dispersion of the specific-
      series turning points around the beginning and end of the recessions. As the multiple change-point
      method assumes that the series being dated have been chosen to be coincident indicators, we
      strongly recommend testing for this in advance by checking how synchronized the cycles are.
                     An automatic algorithm to date the reference cycle of the Spanish economy                  11
             For this purpose, we address the issue of synchronization between each indicator and the
      SBCDC chronology by computing the index of concordance advocated by Harding and Pagan
      (2002), which measures the percentage of time units spent in the same phase. The index, whose
      values are plotted in Figure 4, confirms that there is a relatively high degree of synchronization
      within the SBCDC business cycles. To ensure strong synchronization, we pick only those indicators
      for which the concordance index exceeds 90%. Thus, the final set of indicators that exhibit the
      highest correlation with the SBCDC chronology is formed by six time series: SSAI, SAI, ESIS,
      ESIC, GDP and PC. This selection, which combines aggregated, sectorial, hard and soft indicators,
      is not very different from the one commonly used by the NBER. Employment indicators are not
      capable of pinpointing the Spanish cycle since they have a lagging behavior during expansions.
             We use the SBCDC chronology to select the coincident indicators, given the high coincidence of
      the modes detected in the set of indicators and the dating of the committee. Nevertheless, it should
      be noted that our methodology does not require any prior information or the existence of any dating
      committee. Alternatively, we could select the optimal set of coincident indicators with a search
      algorithm applied to different combinations of indicators, where the optimal combination could be
      selected on the basis of the number of clusters, the entropy and the variance of the confidence
      intervals. This procedure could allow us to discard leading or lagging indicators and to choose the
      combination of indicators that produces the largest modes. Since this option is computationally
      more expensive, external information of experts, such as that of the SBCDC, can be used to speed
      up the process.
             It should be noted that, in any case, the choice of coinciding indicators, a key element for
      the success of the procedure, requires the good judgment of the expert who must evaluate the
      characteristics of each country, such as its productive structure, the quality and methodological
      changes in the series or any other circumstance. Likewise, a qualitative assessment of the resulting
      chronology would also be helpful. This is the reason to establish expert committees in different
      countries.
             Figure 5 provides a preliminary inspection of the individual chronologies of turning points by
      plotting the kernel density estimator of the bivariate distribution of the resulting pairs of specific
      peaks and troughs computed with the BBQ algorithm or the Markov-Switching procedure. The
      distribution of turning points is multimodal, exhibiting various modes that cluster the individual
      turning points around periods of SBCDC-referenced recoveries and declines. In particular, the
      figure exhibits several modes around the seventies and the beginning of the eighties, the early
      nineties, the first
             15 DOCUMENTO
BANCO DE ESPAÑA                decade
                          DE TRABAJO N.º 2139 of the new century and, finally, a large concentrated mode at the end

      of the sample, in 2020. The figure also shows a larger variance of the turning point dates in the
      seventies and early eighties, probably due to the lower quality of the indicators in the late years
      of Franco’s dictatorship and the unstable political transition towards democracy. By contrast, this
You can also read