-
Notifications
You must be signed in to change notification settings - Fork 1
/
011_application_banrep.Rmd
389 lines (292 loc) · 16.7 KB
/
011_application_banrep.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
---
title: "The Board of Directors' Report to the Congress of Colombia (July 2020)"
author: "Luis Francisco Gomez Lopez"
date: 2021-03-12 12:31:33 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 libraries}
library(tidyverse)
library(knitr)
library(kableExtra)
library(readxl)
library(lubridate)
library(zoo)
library(tidyquant)
```
# Contents
- Please Read Me
- Purpose
- Why read the Board of Directors' Report to the Congress of Colombia?
- Variables indicated in the report and seen throughout the course
- Observations about data of the Labor Market shown in the report
- Inflation measures mentioned in the report
- 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 [@carrasquilla-barrera_informe_2020, Chapter 2]
# Purpose
Examine an application of the macroeconomic concepts seen throughout the course.
# Why read the Board of Directors' Report to the Congress of Colombia?
- The Bank of the Republic of Colombia publishes different institutional reports such as:
+ The Board of Directors' Report to the Congress of Colombia
+ Monetary Policy Report (former Inflation Report)
+ Financial Stability Report
+ Foreign Reserve Management Report
+ Payment Systems Report
# Why read the Board of Directors' Report to the Congress of Colombia?
- One way to know in general the macroeconomic environment that affects companies is the **The Board of Directors' Report to the Congress of Colombia** where by law[^1] the Bank of the Republic presents to the congress the execution of monetary, exchange and credit policies, the foreign reserve management and the financial situation of the central bank.
- This report usually includes information about economic activity, the labor market, inflation, the financial sector and a balance of the external sector. The above aspects are relevant to understand the macroeconomic environment of the companies in Colombia.
[^1]: Ley 31 de 1992, Artículo 5
# Why read the Board of Directors' Report to the Congress of Colombia?
- Although there are other more detailed reports regarding certain aspects[^2], this report gives an overview of the landscape facing Colombian companies.
[^2]: For example the __Monetary Policy Report (former Inflation Report)__, __Financial Stability Report__, __Foreign Reserve Management Report__ and the __Payment Systems Report__
# Variables indicated in the report and seen throughout the course
\tiny
- Real GDP growth [@carrasquilla-barrera_informe_2020, p 37, table 2.1]
```{r, out.width = '65%'}
library(knitr)
include_graphics(path = '011_Cuadro_2-1.png')
```
# Variables indicated in the report and seen throughout the course
- "Gasto de consumo final de los hogares": $\widehat{C}_t$
- "Gasto de consumo final del gobierno general": $\widehat{G}_t$
- "Formación Bruta de Capital": $\widehat{I}_t$
- "Demand Interna": $\widehat{C}_t + \widehat{I}_t + \widehat{G}_t$
- "Exportaciones": $\widehat{X}_t$
- "Importaciones": $\widehat{IM}_t$
- "PIB"[^3]: $\widehat{Z}_t \equiv \widehat{C}_t + \widehat{I}_t + \widehat{G}_t + \widehat{X}_t - \widehat{IM}_t$
[^3]: Measure using the macroeconomic identity
# Variables indicated in the report and seen throughout the course
\tiny
- Real GDP growth by sectors [@carrasquilla-barrera_informe_2020, p 36, table 2.2]
```{r, out.width = '65%'}
include_graphics(path = '011_Cuadro_2-2.png')
```
# Variables indicated in the report and seen throughout the course
- "PIB"[^4]: $\widehat{Y}_t$ which includes taxes minus subsidies, $\widehat{T}_t$[^5], and where 12 sectors are taking into account:
```{r}
tibble(Sector = c("Agriculture, hunting, forestry and fishing",
"Mining and quarrying",
"Manufacturing Industries",
"Electricity, gas and water supply",
"Construction",
"Wholesale and retail trade, repair, transport and accommodation",
"Information and communication",
"Financial and insurance activities",
"Real estate activities",
"Professional, scientific and technical activities",
"Public administration and defence, education and human health",
"Arts, entertainment and recreation")) %>%
kable(format = "latex", booktabs = TRUE) %>%
kable_styling(font_size = 5, latex_options = "striped") %>%
row_spec(row = 0, bold = TRUE)
```
[^4]: Measure as the sum of the aggregate value of companies
[^5]: An explanation about, $\widehat{T}_t$, can be found in [@united_nations_national_2004, Chapter 1, p 5, Item 1.5]
# Observations about data of the Labor Market used in the report
\tiny
- Unemployment rate [@carrasquilla-barrera_informe_2020, p 39, plot 2.23a]
```{r, out.width = '60%'}
include_graphics(path = '011_Grafico_2-23a.png')
```
# Observations about data of the Labor Market used in the report
\tiny
- Unemployment rate [@carrasquilla-barrera_informe_2020, p 39, plot 2.23b]
```{r, out.width = '60%'}
include_graphics(path = '011_Grafico_2-23b.png')
```
# Observations about data of the Labor Market shown in the report
- **Seasonally adjusted series** (*Serie desestacionalizada*)[^6]: result of adjusting and removing from the original series the effects of the seasonal component and the calendar effect (**Holy week and holidays**) in order to make a reasonable comparison of the data between different periods.
- **Quarterly moving average** (*Trimestre Móvil*): $$\overline{x}_{t,qma} = \frac{1}{3}\sum\limits_{n\;=\:t-2}^{t} x_n$$
+ Where $x_n$ is monthly data.
[^6]: For more information about the methods used please check [@bee_dagum_seasonal_2016]
# Observations about data of the Labor Market shown in the report
- The data used to generate **"Gráfico 2.23 Tasa de desempleo por dominios (series desestacionalizadas)"** can be examine in:
+ https://www.dane.gov.co/ > "Estadísticas por Tema" > Mercado Laboral > "Gran Encuesta Integrada de Hogares - GHEI -" > "Empleo y Desempleo" > "Series desestacionalizadas"
# Observations about data of the Labor Market shown in the report
```{r, out.width = '80%'}
# Data not seasonally adjusted series
vars <- read_excel(path = "011_anexo_empleo_ene_21.xlsx",
sheet = 2,
range = "A14:IH17",
col_names = FALSE) %>%
slice(3:4) %>%
set_names(c("variable", seq.Date(from = ymd("2001-01-01"),
to = ymd("2021-01-01"), by = "1 month") %>% as.character())) %>%
pivot_longer(cols = -variable,
names_to = "date",
values_to = "value") %>%
pivot_wider(id_cols = date, names_from = variable, values_from = value) %>%
set_names(nm = c("date", "er", "ur")) %>%
mutate(date = ymd(date))
# Data seasonally adjusted series
vars_season_adj <- read_excel(path = "011_anexo_desestacionalizado_empleo_ene_21.xlsx",
sheet = 2,
range = "A14:IH20",
col_names = FALSE) %>%
slice(2:3) %>%
set_names(c("variable", seq.Date(from = ymd("2001-01-01"),
to = ymd("2021-01-01"), by = "1 month") %>% as.character())) %>%
pivot_longer(cols = -variable,
names_to = "date",
values_to = "value") %>%
pivot_wider(id_cols = date, names_from = variable, values_from = value) %>%
set_names(nm = c("date", "er_season_adj", "ur_season_adj")) %>%
mutate(date = ymd(date))
# Data clean
vars_season_adj_roll3 <- vars %>%
left_join(vars_season_adj, by = "date") %>%
mutate(er_season_adj_roll3 = rollmean(er_season_adj,
k = 3,
align = "right",
fill = NA),
ur_season_adj_roll3 = rollmean(ur_season_adj,
k = 3,
align = "right",
fill = NA))
# Plot ur vs ur_season_adj
vars_season_adj_roll3 %>%
select(date, ur, ur_season_adj) %>%
pivot_longer(cols = ur:ur_season_adj,
names_to = "variable", values_to = "value") %>%
mutate(variable = case_when(
variable == "ur" ~ "Total unemployment rate (UR)",
variable == "ur_season_adj" ~ "Total unemployment rate (UR)\nseasonally adjusted",
TRUE ~ variable)) %>%
ggplot(aes(x = date,
y = value)) +
geom_line(aes(color = variable,
group = variable)) +
labs(x = "",
y = "Percent",
color = "",
title = str_glue("Total monthly unemployment rate (UR) vs
total monthly unemployment rate (UR) seasonally adjusted"),
subtitle = str_glue("Period: from {vars_season_adj_roll3$date[1] %>% format(format = '%Y-%m') } to {vars_season_adj_roll3$date[length(vars_season_adj_roll3$date)] %>% format(format = '%Y-%m')}"),
caption = str_glue("Source: Departamento Admnistrativo Nacional de Estadística - DANE
Last update date: 2021-02-26")) +
scale_y_continuous(labels = scales::number_format(suffix = "%", accuracy = 1)) +
scale_x_date(breaks = seq.Date(from = vars_season_adj_roll3$date[1],
to = vars_season_adj_roll3$date[length(vars_season_adj_roll3$date)],
by = "1 year"),
date_labels = "%Y-%m", limits = c(vars_season_adj_roll3$date[1],
vars_season_adj_roll3$date[length(vars_season_adj_roll3$date)])) +
scale_color_tq() +
scale_fill_tq() +
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"),
legend.position = "bottom",
plot.title = element_text(face = "bold"),
axis.title = element_text(face = "bold"),
legend.title = element_text(face = "bold"),
axis.text = element_text(face = "bold"),
axis.text.x = element_text(angle = 90, vjust = 0.5))
```
# Observations about data of the Labor Market shown in the report
```{r, out.width="80%"}
# Plot ur vs ur_season_adj_roll3
vars_season_adj_roll3 %>%
select(date, ur, ur_season_adj_roll3) %>%
pivot_longer(cols = ur:ur_season_adj_roll3,
names_to = "variable", values_to = "value") %>%
mutate(variable = case_when(
variable == "ur" ~ "Total unemployment rate (UR)",
variable == "ur_season_adj_roll3" ~ "Total unemployment rate (UR)\nseasonally adjusted quarterly moving average",
TRUE ~ variable)) %>%
ggplot(aes(x = date,
y = value)) +
geom_line(aes(color = variable,
group = variable)) +
labs(x = "",
y = "Percent",
color = "",
title = str_glue("Total unemployment rate (UR) vs
total unemployment rate (UR) seasonally adjusted quarterly moving average"),
subtitle = str_glue("Period: from {vars_season_adj_roll3$date[1] %>% format(format = '%Y-%m') } to {vars_season_adj_roll3$date[length(vars_season_adj_roll3$date)] %>% format(format = '%Y-%m')}"),
caption = str_glue("Source: Departamento Admnistrativo Nacional de Estadística - DANE
Last update date: 2021-02-26")) +
scale_y_continuous(labels = scales::number_format(suffix = "%", accuracy = 1)) +
scale_x_date(breaks = seq.Date(from = vars_season_adj_roll3$date[1],
to = vars_season_adj_roll3$date[length(vars_season_adj_roll3$date)],
by = "1 year"),
date_labels = "%Y-%m", limits = c(vars_season_adj_roll3$date[1],
vars_season_adj_roll3$date[length(vars_season_adj_roll3$date)])) +
scale_color_tq() +
scale_fill_tq() +
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"),
legend.position = "bottom",
plot.title = element_text(face = "bold"),
axis.title = element_text(face = "bold"),
legend.title = element_text(face = "bold"),
axis.text = element_text(face = "bold"),
axis.text.x = element_text(angle = 90, vjust = 0.5))
```
# Inflation measures mentioned in the report
\tiny
- Inflation [@carrasquilla-barrera_informe_2020, p 42, table 2.3]
```{r, out.width = '55%'}
include_graphics(path = '011_Cuadro_2-3.png')
```
# Inflation measures mentioned in the report[^7]
- **Tradable inflation**
+ Include domestic market products that compete with foreign products and therefore their prices are affected by external factors.
- **Non-Tradable inflation**
+ Include domestic market products that do not compete abroad and their price is determined by domestic demand.
- **Regulated products inflation**
+ Products whose prices have a defined regulatory framework:
+ Fuels
+ Public services
+ Some transportation services
[^7]: Please check out [@gonzalez-molano_nueva_2020] for an update about this aspect and specially Annex 4
# Inflation measures mentioned in the report[^8]
- **Food inflation**
+ Food prices are affected by supply factors. Therefore they are not easily predictable and are not directly affected by monetary policy decisions.
- **Core Inflation Indicators**
+ Is the inflation that is directly affected by monetary policy decisions. Therefore, items with volatile prices or that are outside the control of monetary policy are excluded from the Consumer Price Index (CPI) basket like:
+ Food
+ Fuels, public services or transportation services that are regulated
[^8]: Please check out [@gonzalez-molano_nueva_2020] for an update about this aspect and specially Annex 4
# 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)__, __[knitr](https://CRAN.R-project.org/package=knitr)__, __[kableExtra](https://CRAN.R-project.org/package=kableExtra)__, __[readxl](https://CRAN.R-project.org/package=readxl)__, __[zoo](https://CRAN.R-project.org/package=zoo)__ 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 {.allowframebreaks}