# A Bayesian Change Point Analysis of the USD/CLP Series in Chile from 2018 to 2020: Understanding the Impact of Social Protests and the COVID-19 Pandemic

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Methodology

#### Bayesian Estimation

- (i)
- ${\gamma}_{i}\sim \phantom{\rule{4.pt}{0ex}}\mathrm{iid}\phantom{\rule{4.pt}{0ex}}\mathrm{Bernoulli}\left({\pi}_{i}\right)\phantom{\rule{1.em}{0ex}}0\le {\pi}_{i}\le 1;\phantom{\rule{1.em}{0ex}}i=2,\dots ,n;\phantom{\rule{1.em}{0ex}}{\pi}_{1}=1$.
- (ii)
- ${r}_{j}\sim \mathrm{iid}\phantom{\rule{4.pt}{0ex}}\mathrm{Bernoulli}\left({\nu}_{j}\right)\phantom{\rule{1.em}{0ex}}0\le {\nu}_{j}\le 1;\phantom{\rule{1.em}{0ex}}j=1,\dots ,M$.
- (iii)
- ${\sigma}^{2}$ follows a Jeffreys prior distribution.
- (iv)
- ${\mathit{\beta}}_{\mathit{\gamma}}|\mathit{\gamma},{\sigma}^{2}$ follows a Zellner g-prior distribution.$$\begin{array}{cc}\hfill {\mathit{\beta}}_{\mathit{\gamma}}|\mathit{\gamma},{\sigma}^{2}& \sim {\mathcal{N}}_{{d}_{\gamma}}(0,{c}_{1}{\sigma}^{2}{\left({\mathit{X}}_{\mathit{\gamma}}^{\prime}{\mathit{X}}_{\mathit{\gamma}}\right)}^{-1})\hfill \end{array}$$
- (v)
- ${\mathit{\lambda}}_{\mathit{r}}|\mathit{r},{\sigma}^{2}$ follows a Zellner g-prior distribution.$$\begin{array}{cc}\hfill {\mathit{\lambda}}_{\mathit{r}}|\mathit{r},{\sigma}^{2}& \sim {\mathcal{N}}_{{d}_{r}}(0,{c}_{2}{\sigma}^{2}{\left({\mathit{F}}_{\mathit{r}}^{\prime}{\mathit{F}}_{\mathit{r}}\right)}^{-1}).\hfill \end{array}$$

- Stage 1:
- Stage 2:
- The estimation of ${\mathit{\beta}}_{\mathit{\gamma}},{\mathit{\lambda}}_{\mathit{r}}$ and ${\sigma}^{2}$ given $\widehat{\mathit{\gamma}},\widehat{\mathit{r}}$ and $\mathit{Y}$ using the Gibbs sampler algorithm:
- ${\mathit{\beta}}_{\mathit{\gamma}}|{\mathit{\lambda}}_{\mathit{r}},{\sigma}^{2},\widehat{\mathit{r}},\widehat{\mathit{\gamma}},\mathit{Y}\sim {\mathcal{N}}_{{d}_{\gamma}}\left(\right)open="("\; close=")">{\displaystyle \frac{{\mathit{T}}_{\mathit{\gamma}}{\mathit{X}}_{\mathit{\gamma}}^{\prime}(\mathit{Y}-{\mathit{F}}_{\mathit{r}}{\mathit{\lambda}}_{\mathit{r}})}{{\sigma}^{2}}},{\mathit{T}}_{\mathit{\gamma}}$${\mathit{T}}_{\mathit{\gamma}}={\sigma}^{2}{\left(\right)}^{{\displaystyle \frac{1+{c}_{1}}{{c}_{1}}}}-1$
- ${\mathit{\lambda}}_{\mathit{r}}|{\mathit{\beta}}_{\mathit{\gamma}},{\sigma}^{2},\widehat{\mathit{r}},\widehat{\mathit{\gamma}},\mathit{Y}\sim {\mathcal{N}}_{{d}_{r}}\left(\right)open="("\; close=")">{\displaystyle \frac{{\mathit{W}}_{\mathit{r}}{\mathit{F}}_{\mathit{r}}^{\prime}(\mathit{Y}-{\mathit{X}}_{\mathit{\gamma}}{\mathit{\beta}}_{\mathit{\gamma}})}{{\sigma}^{2}}},{\mathit{W}}_{\mathit{r}}$${\mathit{W}}_{\mathit{r}}={\sigma}^{2}{\left(\right)}^{{\displaystyle \frac{1+{c}_{2}}{{c}_{2}}}}-1$
- ${\sigma}^{2}|{\mathit{\beta}}_{\mathit{\gamma}},{\mathit{\lambda}}_{\mathit{r}},\widehat{\mathit{r}},\widehat{\mathit{\gamma}},\mathit{Y}\sim IG\left(\right)open="("\; close=")">a,{\displaystyle \frac{b}{2}}$$a={\displaystyle \frac{n}{2}}+{\displaystyle \frac{{d}_{\gamma}}{2}}+{\displaystyle \frac{{d}_{r}}{2}}$$b={\left(\mathit{Y}-{\mathit{X}}_{\mathit{\gamma}}{\mathit{\beta}}_{\mathit{\gamma}}-{\mathit{F}}_{\mathit{r}}{\mathit{\lambda}}_{\mathit{r}}\right)}^{\prime}\left(\mathit{Y}-{\mathit{X}}_{\mathit{\gamma}}{\mathit{\beta}}_{\mathit{\gamma}}-{\mathit{F}}_{\mathit{r}}{\mathit{\lambda}}_{\mathit{r}}\right)+{\mathit{\beta}}_{\mathit{\gamma}}^{\prime}\left({\displaystyle \frac{{\mathit{X}}_{\mathit{\gamma}}^{\prime}{\mathit{X}}_{\mathit{\gamma}}}{{c}_{1}}}\right){\mathit{\beta}}_{\mathit{\gamma}}+{\mathit{\lambda}}_{\mathit{r}}^{\prime}\left({\displaystyle \frac{{\mathit{F}}_{\mathit{r}}^{\prime}{\mathit{F}}_{\mathit{r}}}{{c}_{2}}}\right){\mathit{\lambda}}_{\mathit{r}}.$

## 3. Simulation Study

#### Metropolis–Hastings Performance

## 4. Application to the USD/CLP Dataset

#### 4.1. USD/CLP without Prior Knowledge

- 3 May 2018:
- The curve shows an increase in the dollar value that differs from its previous trend. We must mention that during March 2018, the president of the United States Donald Trump announced the imposition of tariffs for USD 50 mil to products of Chinese origin, under the assumption of “unfair trade practices” and “theft of intellectual property”. After this announcement, China informed that tariffs would be applied to 128 products from the United States. Given these facts, we associate this change point with a consequence of the trade war started between China and the United States.
- 1 August 2019:
- This date could be related by the beginning of the economic war between the USA and China since President Trump unveiled the 10% tariff plan on 1 August 2018, blaming China for not following through on promises to buy more American agricultural products.
- 13 November 2019:
- The abrupt rise in the value of the dollar is clearly appreciated on this date. We know that on 18 October 2019 the social protests began in Chile, with the dollar reaching an observed value of $713.23$ Chilean pesos, and then on 29 November 2019 reaching a historical maximum of $828.25$ pesos. One day before the date of this change point was detected, Tuesday 12 November 2019, there was a national strike in Chile, being the day with the greatest violence registered. This day of great violence motivated the agreement for social peace and the new constitution on 15 November 2019, which is focused on the creation of a new Magna Carta, to replace the one of 1980. Consequently, this change point can be explained given the particular situation that occurred in Chile in this period.
- 2 June 2020:
- At this point on the curve, we see a sharp fall in the dollar both in Chile and globally. In the Chilean case, it is mainly due to the fact that during June 2020 copper presented a significant rise due to the reopening of the US and European economies.
- 18 June 2020:
- This date could be associated with the reopening of the economy in the US and Europe after going through the peak period of the COVID-19 pandemic.

#### 4.2. Changing Prior Probabilities

- 2 May 2018
- We detected again this point, which is associated with the trade war between the USA and China.
- 12 November 2019
- As in the case without prior knowledge, the model detected this change point, which was expected both visually and by known facts, as it corresponds to the social crisis. This time, the date on which the change point was detected is closer to the date set with prior knowledge than to the date set without prior knowledge.
- 3 June 2020
- At this point, it can be seen how the model fits well to the fall in the value of the dollar, which did not occur without applying prior knowledge. This date coincides with the reopening of the economy in the US and Europe after going through the peak period of the COVID-19 pandemic.
- 18 June 2020
- This date could be associated with the reopening of the economy in the US and Europe after going through the peak period of the COVID-19 pandemic.
- 8 July 2020
- This date could be associated with the reopening of the economy in the US and Europe after going through the peak period of the COVID-19 pandemic.

## 5. Discussion

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## Appendix A. Settings for Some Simulated Series

## References

- Chowdhury, M.F.; Selouani, S.A.; O’Shaughnessy, D. Bayesian on-line spectral change point detection: A soft computing approach for on-line asr. Int. J. Speech Technol.
**2012**, 15, 5–23. [Google Scholar] [CrossRef] - Ducré-Robitaille, J.-F.; Vincent, L.A.; Boulet, G. Comparison of techniques for detection of discontinuities in temperature series. Int. J. Climatol.
**2003**, 23, 1087–1101. [Google Scholar] [CrossRef] - Bosc, M.; Heitz, F.; Armspach, J.-P.; Namer, I.; Gounot, D.; Rumbach, L. Automatic change detection in multimodal serial mri: Application to multiple sclerosis lesion evolution. NeuroImage
**2003**, 20, 643–656. [Google Scholar] [CrossRef] - Thies, S.; Molnár, P. Bayesian change point analysis of bitcoin returns. Financ. Res. Lett.
**2018**, 27, 223–227. [Google Scholar] [CrossRef] - van den Burg, G.J.; Williams, C.K. An evaluation of change point detection algorithms. arXiv
**2020**, arXiv:2003.06222. [Google Scholar] - Baragatti, M.; Bertin, K.; Lebarbier, E.; Meza, C. A Bayesian approach for the segmentation of series with a functional effect. Stat. Model.
**2019**, 19, 194–220. [Google Scholar] [CrossRef] - Picard, F.; Lebarbier, E.; Hoebeke, M.; Rigaill, G.; Thiam, B.; Robin, S. Joint segmentation, calling, and normalization of multiple CGH profiles. Biostatistics
**2011**, 12, 413–428. [Google Scholar] [CrossRef] - Bertin, K.; Collilieux, X.; Lebarbier, E.; Meza, C. Semi-parametric segmentation of multiple series using a dp-lasso strategy. J. Stat. Comput. Simul.
**2017**, 87, 1255–1268. [Google Scholar] [CrossRef] - Sharma, S.; Swayne, D.A.; Obimbo, C. Trend analysis and change point techniques: A survey. Energy Ecol. Environ.
**2016**, 1, 123–130. [Google Scholar] [CrossRef] - Ruggieri, E.; Antonellis, M. An exact approach to bayesian sequential change point detection. Comput. Stat. Data Anal.
**2016**, 97, 71–86. [Google Scholar] [CrossRef] - Aminikhanghahi, S.; Cook, D.J. A survey of methods for time series change point detection. Knowl. Inf. Syst.
**2017**, 51, 339–367. [Google Scholar] [CrossRef] [PubMed][Green Version] - Truong, C.; Oudre, L.; Vayatis, N. Selective review of offline change point detection methods. Signal Process.
**2020**, 167, 107299. [Google Scholar] [CrossRef] - Jiang, F.; Zhao, Z.; Shao, X. Time series analysis of covid-19 infection curve: A change-point perspective. J. Econom.
**2020**. [Google Scholar] [CrossRef] [PubMed] - Zhang, S.; Xu, Z.; Peng, H. Change point modeling of COVID-19 data in the united states. Stat. Appl.
**2021**, 18, 307–318. [Google Scholar] - Jegede, S.L.; Szajowski, K.J. Change-point detection in homogeneous segments of COVID-19 daily infection. Axioms
**2022**, 11, 213. [Google Scholar] [CrossRef] - Lavielle, M.; Lebarbier, E. An application of MCMC methods for the multiple change-points problem. Signal Process.
**2001**, 81, 39–53. [Google Scholar] [CrossRef] - Boys, R.J.; Henderson, D.A. A bayesian approach to dna sequence segmentation. Biometrics
**2004**, 60, 573–581. [Google Scholar] [CrossRef] - Erdman, C.; Emerson, J.W. A fast Bayesian change point analysis for the segmentation of microarray data. Bioinformatics
**2008**, 24, 2143–2148. [Google Scholar] [CrossRef] - R Core Team. R: A Language and Environment for Statistical Computing; R Foundation for Statistical Computing: Vienna, Austria, 2020. [Google Scholar]
- Rossum, G.V.; Drake, F.L. Python 3 Reference Manual; CreateSpace: Scotts Valley, CA, USA, 2009. [Google Scholar]
- Harchaoui, Z.; Lévy-Leduc, C. Multiple change-point estimation with a total variation penalty. J. Am. Stat. Assoc.
**2010**, 105, 1480–1493. [Google Scholar] [CrossRef] - Edward, G.; McCulloch, R. Variable selection via gibbs sampling. J. Am. Stat. Assoc.
**1993**, 88, 881–889. [Google Scholar] - Casella, G.; George, E.I. Explaining the gibbs sampler. Am. Stat.
**1992**, 46, 167–174. [Google Scholar] - Chib, S.; Greenberg, E. Understanding the metropolis-hastings algorithm. Am. Stat.
**1995**, 49, 327–335. [Google Scholar] - Zellner, A. On assessing prior distributions and bayesian regression analysis with g-prior distributions. Bayesian Inference Decis. Tech.
**1986**, 6, 233–243. [Google Scholar] - Garcia-Donato, G.; Forte, A.; Steel, M. Methods and tools for bayesian variable selection and model averaging in normal linear regression. Int. Stat. Rev.
**2018**, 86, 237–258. [Google Scholar] - Ley, E.; Fernández, C.; Steel, M.F.J. Benchmark priors for bayesian model averaging. J. Econom.
**2001**, 100, 381–427. [Google Scholar] - Christensen, M.G.; Cemgil, A.T.; Nielsen, J.K.; Jensen, S.H. Bayesian model comparison with the g-prior. IEEE Trans. Signal Process.
**2014**, 62, 225–238. [Google Scholar] - Härdle, W.; Kerkyacharian, G.; Picard, D.; Tsybakov, A. Wavelets; Springer: New York, NY, USA, 1998; pp. 1–16. [Google Scholar]
- Eilers, P.H.C.; Marx, B.D. Flexible smoothing with b-splines and penalties. Stat. Sci.
**1996**, 11, 89–102. [Google Scholar] [CrossRef] - Rodriguez, F.F. Interest rate term structure modeling using free knot splines. J. Bus.
**2006**, 79, 3083–3099. [Google Scholar] [CrossRef]

**Figure 1.**

**Left**panel: simulated functional part for the peaks $0.1,0.5$ and $0.6$.

**Right**panel: example for $K=4$ randomly simulated means, considering the constraints of distance of at least three to the peaks and a minimum length of five.

**Figure 2.**In (

**a**–

**d**), one of the 100 series is shown for each $\sigma $ standard deviation in $\{0.1,0.5,1.0,1.5\}$ including the adjusted curve.

**Figure 3.**RMSE for $\sigma $ in $\{0.1,0.5,1.0,1.5\}$.

**Left**panel: RMSE($\mu $).

**Right**panel: RMSE for the functions.

**Figure 4.**Average of the estimates $\widehat{\sigma}$ (“+” symbol) for different levels of standard deviations $\sigma $ in $\{0.1,0.5,1.0,1.5\}$ used in the simulation of the 100 series. The true value is represented by the “x” symbol.

**Figure 5.**Execution times in seconds (in the y axis), using R (in light gray) and Python (dark gray), for standard deviations $\sigma $ in $\{0.1,0.5,1.0,1.5\}$ for the 100 simulated series.

**Figure 6.**Dollar/Chilean peso series. The start dates of the social outburst and COVID-19 pandemic are indicated in vertical dashed lines.

**Figure 7.**

**Top**: Posterior probabilities for selection of change points (

**a**) and functions (

**b**) without prior knowledge.

**Bottom**: (

**c**) Estimated expectation and change points.

**Figure 8.**

**Top**: Posterior probabilities for selection of change points (

**a**) and functions (

**b**) with a prior probability of $0.3$ for the onset of social protests and the declaration of COVID-19 as world pandemic by the World Health Organization, for the segmentation part.

**Bottom**: (

**c**) Estimated expectation and change points.

Index | Function |
---|---|

1 | $Constant=1$ |

2 | Haar function in $t=1$ |

⋮ | ⋮ |

65 | Haar function in $t=64$ |

66 | $sin\left(\right)open="("\; close=")">2\pi \times 1\times {\displaystyle \frac{t}{100}}$ |

67 | $cos\left(\right)open="("\; close=")">2\pi \times 1\times {\displaystyle \frac{t}{100}}$ |

⋮ | ⋮ |

90 | $sin\left(\right)open="("\; close=")">2\pi \times 13\times {\displaystyle \frac{t}{100}}$ |

91 | $cos\left(\right)open="("\; close=")">2\pi \times 13\times {\displaystyle \frac{t}{100}}$ |

92 | t |

93 | ${t}^{2}$ |

94 | B-Splines order 1, with 1 node |

⋮ | ⋮ |

124 | B-Splines order 1, with 30 nodes |

125 | B-Splines order 2, with 1 node |

⋮ | ⋮ |

154 | B-Splines order 2, with 31 nodes |

155 | B-Splines order 3, with 1 node |

⋮ | ⋮ |

186 | B-Splines order 3, with 32 nodes |

187 | B-Splines order 4, with 1 node |

⋮ | ⋮ |

248 | B-Splines order 4, with 62 nodes |

Constants | Value |
---|---|

Iteration number | 160,000 |

First simulated values (burn-in) | 40,000 |

${c}_{1}$ and ${c}_{2}$ | 50 |

Number of initial segments | 5 |

Number of initial dictionary functions | 5 |

Number of proposed change points in each iteration | 1 |

Number of dictionary functions proposed in each iteration | 1 |

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

© 2022 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**

de la Cruz, R.; Meza, C.; Narria, N.; Fuentes, C.
A Bayesian Change Point Analysis of the USD/CLP Series in Chile from 2018 to 2020: Understanding the Impact of Social Protests and the COVID-19 Pandemic. *Mathematics* **2022**, *10*, 3380.
https://doi.org/10.3390/math10183380

**AMA Style**

de la Cruz R, Meza C, Narria N, Fuentes C.
A Bayesian Change Point Analysis of the USD/CLP Series in Chile from 2018 to 2020: Understanding the Impact of Social Protests and the COVID-19 Pandemic. *Mathematics*. 2022; 10(18):3380.
https://doi.org/10.3390/math10183380

**Chicago/Turabian Style**

de la Cruz, Rolando, Cristian Meza, Nicolás Narria, and Claudio Fuentes.
2022. "A Bayesian Change Point Analysis of the USD/CLP Series in Chile from 2018 to 2020: Understanding the Impact of Social Protests and the COVID-19 Pandemic" *Mathematics* 10, no. 18: 3380.
https://doi.org/10.3390/math10183380