# An Automatic Algorithm to Date the Reference Cycle of the Spanish Economy

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Multiple Change-Point Model

## 3. Bayesian Estimation

#### 3.1. Simulation of the Parameters

#### 3.2. Simulation of the States

#### 3.3. The Number of Clusters

#### 3.4. Handling Data Problems

## 4. Empirical Application

#### 4.1. Collect a Set of Business Cycle Indicators

#### 4.2. Select a Set of Highly Coincident Indicators

#### 4.3. The Number of Clusters

#### 4.4. Estimation of Turning Points

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## Appendix A

Variable | Acronym | Source | Sample |
---|---|---|---|

Gross Domestic Product | GDP | National Statistics Institute (INE) | 1970:I-2020:II |

Private consumption | PC | INE | 1995:I-2020:II |

Labor force | LF | INE | 1972:III-2020:II |

Female labor force | FLF | INE | 1972:III-2020:II |

Unemployment rate | UR | INE | 1989:01-2020:07 |

Social Security registrations | SSR | Ministerio de Inclusión, Seguridad Social y Migraciones | 1982:01-2020:09 |

Social Security registrations without workers on furlough | SSRwF | Ministerio de Inclusión, Seguridad Social y Migraciones | 1982:01-2020:09 |

Electricity consumption | EC | Red eléctrica de España | 1981:01-2020:08 |

Big firms sales | BFS | Agencia Tributaria | 1996:01-2020:07 |

Retail trade index | RTI | INE | 1995:01-2020:06 |

Industrial production index | IPI | INE | 1975:01-2020:08 |

Private vehicles registration | PVR | Asociación Española de Fabricantes de Automóviles y Camiones (ANFAC) | 1975:01-2020:07 |

Services sector activity index | SSAI | INE | 2000:01-2020:07 |

Cement consumption | CC | Oficemen | 1989:02- 2020:05 |

New construction permits | PT | Ministerio de Transportes, movilidad y agenda urbana | 1992:01-2020:07 |

Home sales | HS | INE | 2007:01-2020:08 |

Mortgages | M | INE | 2003:01-2020:07 |

Business turnover index | BTI | INE | 2002:01-2020:05 |

Exports | EX | Departamento de Aduanas y Ministerio de Asuntos Económicos y Transformación Digital | 1970:06-2020:05 |

Imports | IM | Departamento de Aduanas y Ministerio de Asuntos Económicos y Transformación Digital | 1970:06-2020:05 |

Overnight tourist stays | OTS | INE | 1995:01-2020:09 |

Tourist arrivals | TA | INE | 1995:01-2020:09 |

Productive capacity utilization | PCU | Ministerio de Asuntos Económicos y Transformación Digital | 1995:I-2020:III |

Synthetic activity indicator | SAI | EDE Business | 1995:01-2020:06 |

Synthetic activity indicator. Industry | SAII | EDE Business | 1995:01-2020:06 |

Synthetic activity indicator. Construction | SAIC | EDE Business | 1995:01-2020:06 |

Synthetic activity indicator. Construction investment | SAICI | EDE Business | 1995:01-2020:06 |

Synthetic activity indicator. Services | SAIS | EDE Business | 1995:01-2020:06 |

Synthetic consumption indicator | SCI | Ministerio de Asuntos Económicos y Transformación Digital | 1995:01-2020:06 |

Synthetic consumption indicator. Large chain stores | SCIL | Ministerio de Asuntos Económicos y Transformación Digital | 1995:01-2020:06 |

Composite produce manager index | PMI Comp | IHS Markit | 1999:08-2020:06 |

Economic sentiment indicator | ESI | European Commission | 1987:04-2020:10 |

Economic sentiment indicator. Industry | ESII | European Commission | 1987:04-2020:08 |

Economic sentiment indicator. Services | ESIS | European Commission | 1996:01-2020:08 |

Economic sentiment indicator. Consumption | ESIC | European Commission | 1986:06-2020:08 |

Economic sentiment indicator. Retail | ESIR | European Commission | 1988:01-2020:08 |

Economic sentiment indicator. Building | ESIB | European Commission | 1989:01-2020:08 |

Employment expectations indicator | EEI | Eurostat | 1996:01-2020:08 |

Consumer confidence index | CCI | Centro de investigaciones sociológicas (CIS) | 2004:09-2020:10 |

Credit to households (% GDP) | CH | Banco de España | 1995:IV-2020:IV |

Credit to Non Financial Corporate (% GDP) | HHRBD | Banco de España | 1995:IV-2020:IV |

Ratio of households debt over disposable income | HHGDP | Banco de España | 1987:I-2020:II |

Ratio of households debt over GDP | CNFC | Banco de España | 1987:I-2020:II |

Ratio of non financial corporate debt over GDP | NFCDGDP | Banco de España | 1987:I-2020:II |

Ratio of non performing housing loans | NPHL | Banco de España | 1998:IV-2020:II |

Ratio of non performing durable consumption loans | NPDCL | Banco de España | 1998:IV-2020:II |

Ratio of non performing production activities loans | NPPAL | Banco de España | 1998:IV-2020:II |

Sovereign risk premia ES-DE | SRP | Datastream | 1991:07-2020:09 |

IBEX 35 index | IBEX | Datastream | 1987:01-2020:09 |

EA Gross Domestic Product | EAGDP | Eurostat | 1995:I-2020:II |

VIX index | VIX | Datastream | 1990:01-2020:09 |

## References

- Burns, A.; Mitchell, W. Measuring Business Cycles; National Bureau of Economic Research: New York, NY, USA, 1946. [Google Scholar]
- Chauvet, M.; Piger, J. A comparison of the real-time performance of business cycle dating methods. J. Bus. Econ. Stat.
**2008**, 26, 42–49. [Google Scholar] [CrossRef] [Green Version] - Harding, D.; Pagan, A. Synchronization of cycles. J. Econ.
**2006**, 132, 59–79. [Google Scholar] [CrossRef] - Harding, D.; Pagan, A. The Econometric Analysis of Recurrent Events in Macroeconomics and Finance; Princeton University Press: Princeton, NJ, USA, 2016. [Google Scholar]
- Stock, J.; Watson, M. Indicators for dating business cycles: Cross-history selection and comparisons. Am. Econ. Rev. Pap. Proc.
**2010**, 100, 16–19. [Google Scholar] [CrossRef] [Green Version] - Stock, J.; Watson, M. Estimating turning points using large data sets. J. Econ.
**2014**, 178, 368–381. [Google Scholar] [CrossRef] - Camacho, M.; Gadea, M.D.; Gomez-Loscos, A. A new approach to dating the reference cycle. J. Bus. Econ. Stat.
**2021**. [Google Scholar] [CrossRef] - Bry, G.; Boschan, C. Cyclical Analysis of Time Series: Procedures and Computer Programs; National Bureau of Economic Research: New York, NY, USA, 1971. [Google Scholar]
- Hamilton, J. A new approach to the economic analysis of nonstationary time series and the business cycles. Econometrica
**1989**, 57, 357–384. [Google Scholar] [CrossRef] - Albert, J.; Chib, S. Bayes inference via Gibbs sampling of autoregressive time series subject to Markov mean and variance shifts. J. Bus. Econ. Stat.
**1993**, 11, 1–15. [Google Scholar] - Chib, S. Estimation and comparison of multiple change-point models. J. Econ.
**1998**, 86, 221–241. [Google Scholar] [CrossRef] - Frühwirth-Schnatter, S. Finite Mixture and Markov Switching Models; Springer Series in Statistics; Springer: New York, NY, USA, 2006. [Google Scholar]
- Fraley, C.; Raffery, A.E. Model-Based Clustering, Discriminant Analysis, and Density Estimation. J. Am. Econ. Assoc.
**2002**, 97, 611–631. [Google Scholar] [CrossRef] - Kass, R.; Raftery, A. Bayes factors. J. Ame. Stat. Assoc.
**1995**, 90, 773–795. [Google Scholar] [CrossRef] - Harding, D.; Pagan, A. Dissecting the cycle: A methodological investigation. J. Mon. Econ.
**2002**, 49, 365–381. [Google Scholar] [CrossRef]

**Figure 1.**Business cycle SBCDC. Notes: This figure displays with grey shadow bars the recessions established by the Spanish Business Cycle Dating Committee (SBCDC). The vertical red lines represent the peaks and troughs detected by the BBQ applied to the GDP. Finally, the blue line shows the evolution of GDP.

**Figure 2.**Heat map of specific indicators. Notes: This figure represents the periods of expansion (blue) and recession (garnet) for each specific indicator. The switch of the states has been determined from the turning points computed with the Bry–Boschan algorithm.

**Figure 3.**Diffusion index of specific indicators. Notes: The blue bars show the percentage of series that are in recession in each period. The garnet boxes represent the recessions established by the Spanish Business Cycle Dating Committee (SBCDC).

**Figure 4.**Concordance index of specific indicators. Notes: This figure displays the concordance index of each indicator and the business cycle established by the Spanish Business Cycle Dating Committee (SBCDC). The garnet line corresponds with a value of 0.9.

**Figure 5.**Bivariate distribution of specific turning point dates. Notes: The figure plots the bivariate kernel density of the specific pairs of peak-trough dates.

**Figure 6.**Scatter plots of means and variances. Notes: The figure plots the scatter plots of conditional draws of the MCMC sampler for $\left(\right)$ and $\left(\right)$ (Panel A) and $\left(\right)$ (Panel B) for each of the $K=7$ clusters.

**Figure 7.**Diagnosis of the Gibbs sampler. Notes: The figure plots the trace plots of the MCMC draws for ${\mu}_{k}^{P}$ (Panel A), ${\mu}_{k}^{T}$ (Panel B), $log\left(\right)open="("\; close=")">|{\mathsf{\Sigma}}_{k}|$ (Panel C), and ${p}_{i,j}$ (Panel D) for each of the $K=7$ clusters.

**Figure 8.**Classification probabilities. Notes: The figure plots the estimates of $Pr\left(\right)open="("\; close=")">{s}_{i}=k|\theta $, for $k=1,\dots ,8$ and $i=1,\dots ,N$ from January 1959 to August 2010.

K | LogLik | AIC | BIC | Entropy | BIC-Entropy | Bayes Factor (k = i/k = i+ 1) |
---|---|---|---|---|---|---|

1 | −2229.78 | 4469.57 | 4486.30 | - | - | - |

2 | −696.46 | 1414.91 | 1451.73 | 0.03 | 1451.80 | 3034.57 |

3 | −400.14 | 834.27 | 891.18 | 0.00 | 891.18 | 560.55 |

4 | −141.25 | 328.51 | 405.49 | 0.00 | 405.50 | 485.69 |

5 | −25.28 | 108.57 | 205.63 | 0.00 | 205.63 | 199.86 |

6 | 13.64 | 42.72 | 159.87 | 0.00 | 159.87 | 45.76 |

7 | 42.61 | −3.22 | 134.01 | 0.00 | 134.01 | 25.86 |

8 | - | - | - | - | - | - |

SBCDC | MCPM | Deviation (in Quarters) | |||
---|---|---|---|---|---|

Peaks | Troughs | Peaks | Troughs | Peaks | Troughs |

1974.4 | 1975.2 | 1974.4 | 1975.3 | 0 | 1 |

(1974.4, 1975.1) | (1975.3, 1975.4) | ||||

1978.3 | 1979.2 | 1978.3 | 1979.3 | 0 | 1 |

(1978.3, 1978.4) | (1979.2, 1979.3) | ||||

- | - | 1980.4 | 1981.3 | - | - |

(1980.4, 1981.1) | (1981.3, 1981.4) | ||||

1992.1 | 1993.3 | 1992.2 | 1993.4 | 1 | 1 |

(1992.1, 1992.2) | (1993.3, 1994.1) | ||||

2008.2 | 2009.4 | 2007.4 | 2009.4 | −2 | 0 |

(2007.4, 2007.4) | (2009.3, 2009.4) | ||||

2010.4 | 2013.2 | 2010.3 | 2013.3 | −1 | 1 |

(2010.3, 2010.4) | (2013.3, 2013.4) | ||||

2019.40 | - | 2019.4 | - | 0.00 | - |

(2019.4, 2019.4) | (-,-) |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Camacho, M.; Gadea, M.D.; Gómez-Loscos, A.
An Automatic Algorithm to Date the Reference Cycle of the Spanish Economy. *Mathematics* **2021**, *9*, 2241.
https://doi.org/10.3390/math9182241

**AMA Style**

Camacho M, Gadea MD, Gómez-Loscos A.
An Automatic Algorithm to Date the Reference Cycle of the Spanish Economy. *Mathematics*. 2021; 9(18):2241.
https://doi.org/10.3390/math9182241

**Chicago/Turabian Style**

Camacho, Maximo, María Dolores Gadea, and Ana Gómez-Loscos.
2021. "An Automatic Algorithm to Date the Reference Cycle of the Spanish Economy" *Mathematics* 9, no. 18: 2241.
https://doi.org/10.3390/math9182241