-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path010_gdp_i_E.Rmd
518 lines (380 loc) · 20.4 KB
/
010_gdp_i_E.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
---
title: "Output, the interest rate and the exchange rate"
author: "Luis Francisco Gomez Lopez"
date: 2021-03-10 12:11:04 GMT -05:00
output:
beamer_presentation:
colortheme: dolphin
fonttheme: structurebold
theme: AnnArbor
ioslides_presentation: default
slidy_presentation: default
bibliography: macro_faedis.bib
link-citations: yes
header-includes:
- \usepackage{booktabs}
- \usepackage{longtable}
- \usepackage{array}
- \usepackage{multirow}
- \usepackage{wrapfig}
- \usepackage{float}
- \usepackage{colortbl}
- \usepackage{pdflscape}
- \usepackage{tabu}
- \usepackage{threeparttable}
- \usepackage{threeparttablex}
- \usepackage[normalem]{ulem}
- \usepackage{makecell}
- \usepackage{xcolor}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE,
warning = FALSE,
message = FALSE,
fig.align = "center")
```
```{r}
library(tidyverse)
library(latex2exp)
library(DiagrammeR)
library(timetk)
library(tidyquant)
library(lubridate)
```
# Contents
- Please Read Me
- Purpose
- Equilibrium in the Goods Market in an open economy and some simplifications
- Equilibrium in the Financial Market in an open economy and some simplifications
- Equilibrium in the Goods and Financial Markets in an open economy with some simplifications
- Exchange rate regimes
- Exchange Policy in Colombia
- Acknowledgments
- References
# Please Read Me
- Check the message __Welcome greeting__ published in the News Bulletin Board.
- Dear student please edit your profile uploading a photo where your face is clearly visible.
- The purpose of the virtual meetings is to answer questions and not to make a summary of the study material.
- This presentation is based on [@blanchard_macroeconomics_2017, Chapter 19]
# Purpose
Characterize the equilibrium of the markets of goods and the financial markets in an open economy
# Equilibrium in the Goods Market in an open economy and some simplifications
- **IS** curve:
$$\begin{split}
\widehat{Y} & = \widehat{Z} \\
& = \widehat{C}(\widehat{Y}-\widehat{T}) + \widehat{I}(\widehat{Y}, r) + \widehat{G} + \widehat{X}(\widehat{Y}^*,\varepsilon) - \varepsilon\widehat{IM}(\widehat{Y},\varepsilon) \\
& = \widehat{C}(\widehat{Y}-\widehat{T}) + \widehat{I}(\widehat{Y}, r) + \widehat{G} + \widehat{NX}(\widehat{Y}^*, \widehat{Y},\varepsilon)
\end{split}$$
Where $\widehat{NX}(\widehat{Y}^*, \widehat{Y},\varepsilon) \equiv \widehat{X}(\widehat{Y}^*,\varepsilon) - \varepsilon\widehat{IM}(\widehat{Y},\varepsilon)$
- Also it is assumed that the **Marshall–Lerner condition** is fulfilled: $\frac{d\widehat{NX}}{d\varepsilon} > 0$
- Furthermore, the **nominal** exchange rate, $E$, that affect $\varepsilon$ is defined, in this case, as the amount of units of national currency that must be given in exchange for a unit of foreign currency.
# Equilibrium in the Goods Market in an open economy and some simplifications
- To simplify the analysis we will assume that the rest of the world trades with only one currency and the economy that is being analyzed with a local currency. In the colombian case, it can be assumed that it is the USD and the COP:
+ $\varepsilon = \frac{P_j*E}{P_i}$ where $\varepsilon$ is the **real bilateral** exchange rate between 2 territories, i and j, where j is the **rest of the world** that trades with only one currency and i is the **economy being analyzed**.
- Also to facilitate the analysis, the index numbers, $P_j$ and $P_i$, are set equal to $\frac{P_j}{P_i} = 1$ such that $\varepsilon = E$. Furthermore because $r \approx i - \pi^e$ we will assume that $\pi^e = 0$ such that $r \approx i$.
- Taking into account this simplifications:
+ $\widehat{Y} = \widehat{C}(\widehat{Y}-\widehat{T}) + \widehat{I}(\widehat{Y}, i) + \widehat{G} + \widehat{NX}(\widehat{Y}^*, \widehat{Y},E)$
# Equilibrium in the Financial Market in an open economy and some simplifications
- **LM** curve
+ Because $r \approx i - \pi^e$ and we assume that $\pi^e = 0$:
+ $r = \overline{r}$
+ $i - \pi^e = \overline{i} - \pi^e$
+ $i = \overline{i}$
- **Uncovered interest parity relation**[^1]
+ $1 + i = (1 + i^*)*\frac{E^e}{E}$
+ $E = \frac{1 + i^*}{1 + i}E^e$
[^1]: The subscripts are removed to facilitate the notation
# Equilibrium in the Goods and Financial Markets in an open economy with some simplifications
- **IS** curve:
+ $\widehat{Y} = \widehat{C}(\widehat{Y}-\widehat{T}) + \widehat{I}(\widehat{Y}, i) + \widehat{G} + \widehat{NX}(\widehat{Y}^*, \widehat{Y},E)$
+ **Marshall–Lerner condition**
+ Because $\varepsilon = E$ then $\frac{d\widehat{NX}}{dE} > 0$. Therefore $\frac{\widehat{X}(\widehat{Y}^*,E)}{E*\widehat{IM}(\widehat{Y},E)}\eta_{\widehat{X},E} - \eta_{\widehat{IM},E} > 1$
- **LM** curve:
+ $i = \overline{i}$
- **Uncovered interest parity relation**:
+ $E = \frac{1 + i^*}{1 + i}E^e$
- **Equilibrium in the Goods and Financial Markets** :
+ $\widehat{Y} = \widehat{C}(\widehat{Y}-\widehat{T}) + \widehat{I}(\widehat{Y}, \overline{i}) + \widehat{G} + \widehat{NX}(\widehat{Y}^*, \widehat{Y},\frac{1 + i^*}{1 + \overline{i}}E^e)$
+ Where $\frac{d\widehat{NX}}{d\left[\frac{1 + i^*}{1 + \overline{i}}E^e\right]} > 0$ so $\frac{\widehat{X}(\widehat{Y}^*,\frac{1 + i^*}{1 + \overline{i}}E^e)}{\left[\frac{1 + i^*}{1 + \overline{i}}E^e\right]*\widehat{IM}(\widehat{Y},\frac{1 + i^*}{1 + \overline{i}}E^e)}\eta_{\widehat{X},\frac{1 + i^*}{1 + \overline{i}}E^e} - \eta_{\widehat{IM},\frac{1 + i^*}{1 + \overline{i}}E^e} > 1$
+ $i = \overline{i}$
+ $E = \frac{1 + i^*}{1 + \overline{i}}E^e$
# Equilibrium in the Goods and Financial Markets in an open economy with some simplifications
```{r, out.width = '80%'}
ggplot(data = tibble(x = c(0, 5, 2, 6, 11, 8),
y = c(5, 0, 2, 5, 0, 2))
) +
# First plot
geom_point(aes(x = x, y = y),
color = "blue",
size = 3) +
geom_segment(aes(x = 0, y = 2,
xend = 4, yend = 2),
color = 'red') +
geom_segment(aes(x = 0, y = 4,
xend = 4, yend = 0),
color = 'green') +
geom_segment(aes(x = 0, y = 0,
xend = 0, yend = 5)) +
geom_segment(aes(x = 0, y = 0,
xend = 5, yend = 0)) +
geom_segment(aes(x = 2, y = 2,
xend = 2, yend = 0),
linetype = 'dashed') +
annotate(geom = 'text',
x = 2.25, y = 0.25,
label = TeX('$\\widehat{Y}^{eq}$')) +
annotate(geom = 'text',
x = 0.25, y = 2.25,
label = TeX('$\\bar{i}$')) +
annotate(geom = 'text',
x = 5.25, y = 0,
label = TeX('$\\widehat{Y}$')) +
annotate(geom = 'text',
x = 0, y = 5.25,
label = TeX('$i')) +
annotate(geom = 'text',
x = 4.25, y = 2.125,
label = TeX('$LM')) +
annotate(geom = 'text',
x = 1, y = 3.5,
label = TeX('$IS')) +
# Second plot
geom_segment(aes(x = 6, y = 4,
xend = 10, yend = 0),
color = 'purple') +
geom_segment(aes(x = 6, y = 0,
xend = 6, yend = 5)) +
geom_segment(aes(x = 6, y = 0,
xend = 11, yend = 0)) +
geom_segment(aes(x = 8, y = 2,
xend = 8, yend = 0),
linetype = 'dashed') +
geom_segment(aes(x = 4, y = 2,
xend = 8, yend = 2),
linetype = 'dotted') +
annotate(geom = 'text',
x = 8.25, y = 0.25,
label = TeX('$\\E^{eq}$')) +
annotate(geom = 'text',
x = 6.25, y = 2.25,
label = TeX('$\\bar{i}$')) +
annotate(geom = 'text',
x = 11.25, y = 0,
label = TeX('$E$')) +
annotate(geom = 'text',
x = 6, y = 5.25,
label = TeX('$i')) +
annotate(geom = 'text',
x = 7.5, y = 3.5,
label = str_glue('Uncovered interest
parity relation')) +
annotate(geom = 'text',
x = 1, y = 1.5,
label = str_glue('Equilibrium in
the goods and the
financial markets
in an open
economy')) +
annotate(geom = 'text',
x = 7, y = 1.5,
label = str_glue('Equilibrium in
the goods and the
financial markets
in an open
economy')) +
theme_void()
```
# Exchange rate regimes
- __De jure__ exchange rate regime:
+ Regime that a country claim to officially follow
- __De facto__ exchange rate regime:
+ Regime that a country actually follow
# Exchange rate regimes
- Classification of __de facto__ exchange arrangements [@imf_annual_2020, p 43-45]:
```{r, out.width = '100%'}
grViz(diagram = '
digraph boxes_and_circles {
graph [rankdir = TB]
node [shape = circle, color = "#2C3E50"]
"De facto\nexchange\narrangements";
node [shape = oval, color = "#E31A1C"]
"Hard\npegs";
"Soft\npegs";
"Floating\nregimes";
"Residual";
node [shape = oval, color = "#18BC9C"]
"No\nseparate\nlegal\ntender";
"Currency\nboard";
"Conventional\npeg";
"Stabilized\narrangement";
"Crawling\npeg";
"Crawl-like\narrangement";
"Pegged\nexchange\nrate\nwithin\nhorizontal\nbands";
"Floating";
"Free\nfloating";
"Other\nmanaged\narrangement";
"De facto\nexchange\narrangements" -> "Hard\npegs";
"De facto\nexchange\narrangements" -> "Soft\npegs";
"De facto\nexchange\narrangements" -> "Floating\nregimes";
"De facto\nexchange\narrangements" -> "Residual";
"Hard\npegs" -> "No\nseparate\nlegal\ntender";
"Hard\npegs" -> "Currency\nboard";
"Soft\npegs" -> "Conventional\npeg";
"Soft\npegs" -> "Stabilized\narrangement";
"Soft\npegs" -> "Crawling\npeg";
"Soft\npegs" -> "Crawl-like\narrangement";
"Soft\npegs" -> "Pegged\nexchange\nrate\nwithin\nhorizontal\nbands";
"Floating\nregimes" -> "Floating";
"Floating\nregimes" -> "Free\nfloating";
"Residual" -> "Other\nmanaged\narrangement";
}
')
```
# Exchange rate regimes
- __De facto__ exchange arrangements around the world [@imf_annual_2020]
```{r, out.width = "80%"}
data_exchange_rta <- read_csv(file = "010_AREAER_data_query_report_2021_03_10.csv",
skip = 2) %>%
select(Year, Country, Code, Index, Category, Status) %>%
count(Year, Category) %>%
mutate(Category = case_when(
Category == "Pegged exchange rate within horizontal bands" ~ str_glue("Pegged exchange rate
within horizontal bands"),
TRUE ~ Category),
Category = Category %>% fct_reorder(.x = n, .fun = max) %>% fct_rev())
initial_year <- min(data_exchange_rta$Year)
last_year <- max(data_exchange_rta$Year)
data_exchange_rta %>%
filter(between(x = Year, left = initial_year, right = last_year)) %>%
ggplot(aes(Year, Category %>% fct_rev())) +
geom_point(aes(fill = Category, size = n), shape = 21) +
geom_text(aes(label = n),
fontface = "bold",
position = position_nudge(x = -0.3, y = 0)) +
scale_x_continuous(breaks = initial_year:last_year) +
scale_fill_tq() +
guides(size = guide_none()) +
labs(x = "",
y = "",
title = str_glue("Number of de facto exchange rate arrangements around the world {initial_year}-{last_year}"),
subtitle = "Classification of Exchange arrangements (2008 onwards)",
caption = str_glue("Source: IMF AREAER Database
Last date update: 2021-03-10"),
fill = "") +
theme(panel.border = element_rect(fill = NA, color = "black"),
plot.background = element_rect(fill = "#f3fcfc"),
panel.background = element_rect(fill = "#f3f7fc"),
legend.background = element_rect(fill = "#f3fcfc"),
plot.title = element_text(face = "bold"),
axis.title = element_text(face = "bold"),
legend.title = element_text(face = "bold"),
legend.position = "bottom",
axis.text = element_text(face = "bold"),
axis.text.y = element_blank(),
axis.ticks.y = element_blank())
```
# Exchange Policy in Colombia
- __De jure__ exchange rate regime[^2]:
+ Crawling peg
+ From 1967-03-22 to 1991-10-28
+ "Decreto 444 de 1967"
+ Pegged exchange rate within horizontal bands
+ From 1991-10-29 to 1999-09-24
+ "Certificados de Cambio" (from 1991-10-29 to 1994-01-23): "Resolución Externa No 10 de 1991 Banco de la República de Colombia, Artículo 1"
+ "Bandas cambiarias" (from 1994-01-24 to 1999-11-24): "Resolución Externa No 2 de 1994 Banco de la República de Colombia, Artículos 2-3"
[^2]: Author's own interpretation
# Exchange Policy in Colombia
- __De jure__ exchange rate regime[^3]:
+ Free floating
+ From 1999-11-25
+ "Resolución Externa No 21 de 1999 Banco de la República de Colombia, Artículo 2"
[^3]: Author's own interpretation
# Exchange Policy in Colombia
- __De jure__ exchange rate regime COP/USD[^4]:
```{r, out.width = "75%"}
# Data 1: monthly average exchange rate COP/USD
col_cop_usd_monthly_mean <- read_csv(file = "010_TCM_Serie empalmada_de_datos_promedio_por_meses_y_datos_a_fin_de_mes.csv",
locale = locale(decimal_mark = ",")) %>%
set_names(nm = c("date", "mean", "last")) %>%
mutate(date = as.character(date)
%>% timetk::parse_date2()) %>%
select(date, mean)
initial_date <- col_cop_usd_monthly_mean$date[1]
last_date <- col_cop_usd_monthly_mean$date[length(col_cop_usd_monthly_mean$date)]
# Data 2: clasiffication exchange rate regimes
classif <- tibble(regime = c("Crawling peg",
"Pegged exchange rate within horizontal bands",
"Free floating") %>% as_factor(),
start = c(ymd("1967-03-01"), ymd("1991-10-01"), ymd("1999-11-01")),
end = c(ymd("1991-10-01"), ymd("1999-11-01"), last_date))
col_cop_usd_monthly_mean %>%
ggplot() +
geom_line(aes(x = date, y = mean),
color = palette_light()[1]) +
geom_rect(data = classif,
aes(xmin = start, xmax = end, fill = regime),
ymin = -Inf,
ymax = Inf,
alpha = 0.2,
color = "black",
show.legend = TRUE) +
scale_fill_tq() +
scale_x_date(breaks = c(initial_date,
ymd("1967-03-01"),
ymd("1991-10-01"),
ymd("1999-11-01"),
last_date),
date_labels = "%Y-%m") +
labs(x = "",
y = "COP/USD",
fill = "",
title = str_glue("Colombia monthly average exchange rate and
de jure exchange rate regime classification: COP/USD"),
caption = str_glue("Source monthly average exchange rate: Banco de la República (Colombia)
Source de jure exchange rate regime classification: Author's own interpretation
Last update date: {last_date}")) +
theme(panel.border = element_rect(fill = NA, color = "black"),
plot.background = element_rect(fill = "#f3fcfc"),
panel.background = element_rect(fill = "#f3f7fc"),
legend.background = element_rect(fill = "#f3fcfc"),
plot.title = element_text(face = "bold"),
axis.title = element_text(face = "bold"),
legend.title = element_text(face = "bold"),
legend.position = "bottom",
axis.text = element_text(face = "bold"))
```
[^4]: Author's own interpretation
# Exchange Policy in Colombia
- Exchange Policy and the position of the **Bank of the Republic (Colombia)**
+ http://www.banrep.gov.co/ > Navegue por temas > Política de intervención cambiaria
+ "... en un régimen con flexibilidad cambiaria la tasa de cambio opera como una variable de ajuste ante los choques que recibe la economía, reduciendo la volatilidad de la actividad económica."
+ " ... la flexibilidad cambiaria permite utilizar de forma independiente la tasa de interés como un instrumento para acercar la inflación y el producto a sus valores deseados."
+ " ... la flexibilidad cambiaria reduce los incentivos a la toma excesiva de riesgo cambiario por parte de los agentes de la economía, lo cual es vital para mantener la estabilidad financiera."
# Exchange Policy in Colombia
- Exchange Policy and the position of the **Bank of the Republic (Colombia)**
+ http://www.banrep.gov.co/ > Navegue por temas > Política de intervención cambiaria
+ "No obstante lo anterior, el Banco de la República como autoridad cambiaria tiene la potestad de intervenir en el mercado de divisas. Dicha intervención no limita la flexibilidad cambiaria, no pretende fijar o alcanzar algún nivel específico de la tasa de cambio y persigue objetivos compatibles con la estrategia de inflación objetivo."
# Exchange Policy in Colombia
- Purporses of the inverventions in the Foreign Exchange Market by the **Bank of the Republic (Colombia)**
+ http://www.banrep.gov.co/ > Navegue por temas > Política de intervención cambiaria
+ " ... incrementar el nivel de reservas internacionales para reducir la vulnerabilidad externa y mejorar las condiciones de acceso al crédito externo ..."
+ " mitigar movimientos de la tasa de cambio que no reflejen claramente el comportamiento de los fundamentales de la economía y que puedan afectar negativamente la inflación y la actividad económica ..."
+ " ... moderar desviaciones rápidas y sostenidas de la tasa de cambio respecto a su tendencia con el fin de evitar comportamientos desordenados de los mercados financieros."
# Exchange Policy in Colombia
- Relation with the simplified IS-LM model
+ **Hard pegged regimes**
+ $E_t = E_{t+1}^e$
+ **Uncovered interest parity relation**
+ $E_t = \frac{1 + i_t^*}{1 + i_t}E_{t+1}^e$
- Therefore we have that:
+ $E_t = \frac{1 + i_t^*}{1 + i_t}E_t$
+ $1 = \frac{1 + i_t^*}{1 + i_t}$
+ $i_t^* = i_t$
+ In **hard pegged regimes** central banks lose the possibility of fixing the interest rate and the possibility to use it as an instrument of the monetary policy.
# Acknowledgments
- To my family that supports me
- To the taxpayers of Colombia and the __[UMNG students](https://www.umng.edu.co/estudiante)__ who pay my salary
- To the __[Business Science](https://www.business-science.io/)__ and __[R4DS Online Learning](https://www.rfordatasci.com/)__ communities where I learn __[R](https://www.r-project.org/about.html)__
- To the __[R Core Team](https://www.r-project.org/contributors.html)__, the creators of __[RStudio IDE](https://rstudio.com/products/rstudio/)__ and the authors and maintainers of the packages __[tidyverse](https://CRAN.R-project.org/package=tidyverse)__, __[tidyquant](https://CRAN.R-project.org/package=tidyquant)__, __[lubridate](https://CRAN.R-project.org/package=lubridate)__, __[latex2exp](https://CRAN.R-project.org/package=latex2exp)__, __[DiagrammeR](https://CRAN.R-project.org/package=DiagrammeR)__, __[timetk](https://CRAN.R-project.org/package=timetk)__ and __[tinytex](https://CRAN.R-project.org/package=tinytex)__ for allowing me to access these tools without paying for a license
- To the __[Linux kernel community](https://www.kernel.org/category/about.html)__ for allowing me the possibility to use some __[Linux distributions](https://static.lwn.net/Distributions/)__ as my main __[OS](https://en.wikipedia.org/wiki/Operating_system)__ without paying for a license
# References