-
Notifications
You must be signed in to change notification settings - Fork 0
/
2023_02.qmd
434 lines (322 loc) · 17.4 KB
/
2023_02.qmd
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
---
title: "February 2023"
author:
- name: "Tomasz Woźniak"
affiliations:
- University of Melbourne
orcid: 0000-0003-2212-2378
execute:
freeze: auto
---
```{r interest data}
#| echo: false
#| message: false
#| warning: false
# download daily interest rates
icr_dwnld = readrba::read_rba(series_id = "FIRMMCRTD") # Cash Rate Target
icr_tmp = xts::xts(icr_dwnld$value, icr_dwnld$date)
dates_tmp = xts::xts(as.Date(icr_dwnld$date), icr_dwnld$date)
by1m_dwnld = readrba::read_rba(series_id = "FIRMMBAB30D")
by1m_tmp = xts::xts(by1m_dwnld$value, by1m_dwnld$date)
by3m_dwnld = readrba::read_rba(series_id = "FIRMMBAB90D")
by3m_tmp = xts::xts(by3m_dwnld$value, by3m_dwnld$date)
by6m_dwnld = readrba::read_rba(series_id = "FIRMMBAB180D")
by6m_tmp = xts::xts(by6m_dwnld$value, by6m_dwnld$date)
by2y_dwnld = readrba::read_rba(series_id = "FCMYGBAG2D")
by2y_tmp = xts::xts(by2y_dwnld$value, by2y_dwnld$date)
by3y_dwnld = readrba::read_rba(series_id = "FCMYGBAG3D")
by3y_tmp = xts::xts(by3y_dwnld$value, by3y_dwnld$date)
by5y_dwnld = readrba::read_rba(series_id = "FCMYGBAG5D")
by5y_tmp = xts::xts(by5y_dwnld$value, by5y_dwnld$date)
by10y_dwnld = readrba::read_rba(series_id = "FCMYGBAG10D")
by10y_tmp = xts::xts(by10y_dwnld$value, by10y_dwnld$date)
long_ou_tmp = na.omit(merge(by2y_tmp, by3y_tmp, by5y_tmp, by10y_tmp))
long_be = long_ou_tmp["/2013-05-16"]
long_af = long_ou_tmp["2022-01-01/"]
long_in_tmp = readxl::read_xls(path = "f02d.xls", skip = 10)
long_in = xts::xts(long_in_tmp[,2:5], as.Date(long_in_tmp$`Series ID`))
long_in = long_in["2013-05-17/2021-12-31"]
colnames(long_in) <- colnames(long_af)
short = na.omit(merge(icr_tmp, by1m_tmp, by3m_tmp, by6m_tmp))
long = rbind(long_be, long_in, long_af)
# daily systems
forecast_day = "/2023-02"
variables_all = na.omit(merge(short, long))
colnames(variables_all) = c("cash rate", "1m", "3m", "6m", "2y", "3y", "5y", "10y")
variables_all = variables_all[forecast_day]
variables_long = na.omit(merge(icr_tmp, long))
colnames(variables_long) = c("cash rate", "2y", "3y", "5y", "10y")
variables_long = variables_long[forecast_day]
variables_short = short
colnames(variables_short) = c("cash rate", "1m", "3m", "6m")
variables_short = variables_short[forecast_day]
# weekly and monthly systems
vwa = xts::to.weekly(variables_all, OHLC = FALSE)
vwl = xts::to.weekly(variables_long, OHLC = FALSE)
vws = xts::to.weekly(variables_short, OHLC = FALSE)
vma = xts::to.monthly(variables_all, OHLC = FALSE)
vml = xts::to.monthly(variables_long, OHLC = FALSE)
vms = xts::to.monthly(variables_short, OHLC = FALSE)
# create a dummy for the interest raise regime
T = nrow(vma)
dm = xts::xts(as.matrix(rep(0, T)), zoo::index(vma))
dm[(T - 9):T] = 1
colnames(dm) = "dum"
dmf = as.matrix(rep(1,12))
colnames(dmf) = "dum"
Tw = nrow(vwa)
dw = xts::xts(as.matrix(rep(0, Tw)), zoo::index(vwa))
dw[(Tw - 42):Tw] = 1
colnames(dw) = "dum"
dwf = as.matrix(rep(1,55))
colnames(dwf) = "dum"
```
```{r cointegrating rank}
#| echo: false
#| message: false
#| warning: false
#| results: hide
library(vars)
# Johansen's cointegrating rank test
vecm_vma = ca.jo(vma, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vma) # r = 5, N = 8
vecm_vms = ca.jo(vms, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vms) # r = 3, N = 4
vecm_vml = ca.jo(vml, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vml) # r = 4, N = 5
vecm_vwa = ca.jo(vwa, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vwa) # r = 7, N = 8
vecm_vws = ca.jo(vws, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vws) # r = 3, N = 4
vecm_vwl = ca.jo(vwl, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vwl) # r = 4, N = 5
```
```{r forecasting}
#| echo: false
# forecast with monthly data
f = 1
forecasts = array(NA, c(12, 3, 18))
vm = list(vma, vms, vml)
rr = c(5, 3, 4)
for (v in 1:3) {
for (p in c(3, 5, 7)) {
vecm = ca.jo(vm[[v]], type = "trace", ecdet = "const", K = p, spec = "transitory", dumvar = dm)
var_cr = vec2var(vecm, r = rr[v])
var_pr = predict(var_cr, n.ahead = 12, ci = .68, dumvar = dmf)
forecasts[,,f] = var_pr$fcst$cash.rate[,1:3]
f = f + 1
vecm = ca.jo(vm[[v]], type = "trace", ecdet = "const", K = p, spec = "transitory")
var_cr = vec2var(vecm, r = rr[v])
var_pr = predict(var_cr, n.ahead = 12, ci = .68)
forecasts[,,f] = var_pr$fcst$cash.rate[,1:3]
f = f + 1
}
}
ym1 = zoo::as.yearmon("2023-03") # the first forecasted period
ym2 = zoo::as.yearmon("2024-02") # the last forecasted period
s = seq(ym1, ym2, 1/12) # create yearmon sequence
pooled_forecasts_m = apply(forecasts, 1:2, mean)
colnames(pooled_forecasts_m) = c("forecast", "lower", "upper")
pooled_forecasts_m = xts::xts(pooled_forecasts_m, s)
ym13 = zoo::as.yearmon("2023-02") # forecast origin
s3 = seq(ym13, ym2, 1/12) # create yearmon sequence
ym12 = zoo::as.yearmon("2010-1")
s2 = seq(ym12, ym2, 1/12) # create yearmon sequence
datainforecast = as.vector(vm[[1]][(dim(vm[[1]])[1] - (length(s2) - 12 - 1)):dim(vm[[1]])[1], 1])
last_point = datainforecast[length(datainforecast)]
cols = c("darkorchid4","mediumorchid1","mediumorchid2","mediumorchid3","hotpink1","hotpink2","hotpink3","hotpink4")
# forecast with weekly data
f = 1
forecastsw = array(NA, c(55, 3, 18))
vw = list(vwa, vws, vwl)
rrw = c(7, 3, 4)
for (v in 1:3) {
for (p in c(3, 5, 7)) {
vecm = ca.jo(vw[[v]], type = "trace", ecdet = "const", K = p, spec = "transitory", dumvar = dw)
var_cr = vec2var(vecm, r = rrw[v])
var_pr = predict(var_cr, n.ahead = 55, ci = .68, dumvar = dwf)
forecastsw[,,f] = var_pr$fcst$cash.rate[,1:3]
f = f + 1
vecm = ca.jo(vw[[v]], type = "trace", ecdet = "const", K = p, spec = "transitory")
var_cr = vec2var(vecm, r = rrw[v])
var_pr = predict(var_cr, n.ahead = 55, ci = .68)
forecastsw[,,f] = var_pr$fcst$cash.rate[,1:3]
f = f + 1
}
}
sw = as.Date(rep(NA, 55))
sw[1] = as.Date("2023-03-01")
for (i in 2:55) {
sw[i] = sw[i - 1] + 7
}
pooled_forecasts_w = apply(forecastsw, 1:2, mean)
colnames(pooled_forecasts_w) = c("forecast", "lower", "upper")
pooled_forecasts_w = xts::xts(pooled_forecasts_w, sw)
pooled_forecasts_wm = xts::to.monthly(pooled_forecasts_w, OHLC = FALSE)
# pool forecasts
pooled_forecasts = 0.5 * (pooled_forecasts_m + pooled_forecasts_wm)
zoo::write.zoo(pooled_forecasts, sep = ",", file = "forecasts/2023-02.csv")
```
```{r rates data}
#| echo: false
#| message: false
#| warning: false
# download the rates
icr_dwnld = readrba::read_rba(series_id = "FIRMMCRTD") # Cash Rate Target
icr_tmp = xts::xts(icr_dwnld$value, icr_dwnld$date)
dates_tmp = xts::xts(as.Date(icr_dwnld$date), icr_dwnld$date, tclass = 'yearqtr')
icr = xts::to.quarterly(icr_tmp, OHLC = FALSE)
icr = icr[-nrow(icr),]
by10y_dwnld = readrba::read_rba(series_id = "FCMYGBAG10D") # 10-year bonds
by10y_tmp = xts::xts(by10y_dwnld$value, by10y_dwnld$date)
long_be = by10y_tmp["/2013-05-16"]
long_af = by10y_tmp["2022-01-01/"]
long_in = long_in[,4]
colnames(long_in) = colnames(long_af) = colnames(long_be) = "by10y"
long = rbind(long_be, long_in, long_af)
by10y = xts::to.quarterly(long, OHLC = FALSE)
by10y = by10y[-nrow(by10y),]
# "GMAREXPY" # Survey measure of market economists' inflation expectations; Median inflation for 1 year ahead; Year-ended
piexpe1y_dwnld = readrba::read_rba(series_id = "GMAREXPY")
piexpe1y_tmp = xts::xts(piexpe1y_dwnld$value, piexpe1y_dwnld$date, tclass = 'yearqtr')
piexpe1y = xts::to.quarterly(piexpe1y_tmp, OHLC = FALSE)
# "GUNIEXPY" # Survey measure of union officials' inflation expectations; Median inflation for 1 year ahead; Year-ended
piexpu1y_dwnld = readrba::read_rba(series_id = "GUNIEXPY")
piexpu1y_tmp = xts::xts(piexpu1y_dwnld$value, piexpu1y_dwnld$date, tclass = 'yearqtr')
piexpu1y = xts::to.quarterly(piexpu1y_tmp, OHLC = FALSE)
# "GCPIAGSAQP" # Consumer price index; All groups; Quarterly change (in per cent)
picpi_dwnld = readrba::read_rba(series_id = "GCPIAGSAQP")
picpi_tmp = 4 * xts::xts(picpi_dwnld$value, picpi_dwnld$date, tclass = 'yearqtr')
picpi = xts::to.quarterly(picpi_tmp, OHLC = FALSE)
# "GLFSURSA" # Unemployed persons as percentage of labour force
ur_dwnld = readrba::read_rba(series_id = "GLFSURSA")
ur_tmp = xts::xts(ur_dwnld$value, ur_dwnld$date, tclass = 'yearqtr')
ur = xts::to.quarterly(ur_tmp, OHLC = FALSE)
# "GLFSEPTPOP" # Employed persons as percentage of working age civilian population
er_dwnld = readrba::read_rba(series_id = "GLFSEPTPOP")
er_tmp = xts::xts(er_dwnld$value, er_dwnld$date, tclass = 'yearqtr')
er = xts::to.quarterly(er_tmp, OHLC = FALSE)
with_exp = na.omit(merge(icr, by10y, piexpe1y, piexpu1y, picpi, ur, er))
colnames(with_exp) = c("cash rate", "10yb", "Epi_eco", "Epi_uni", "pi", "ur", "er")
with_exp = with_exp["2002-01/2022-12"]
no_exp = na.omit(merge(icr, by10y, picpi, ur, er))
colnames(no_exp) = c("cash rate", "10yb", "pi", "ur", "er")
no_exp = no_exp["/2022-12"]
```
```{r forecasting quarterly}
#| echo: false
#| message: false
#| warning: false
#| results: hide
# Johansen's test
library(vars)
vecm_we = ca.jo(with_exp, type = "trace", ecdet = "none", K = 3, spec = "transitory")
summary(vecm_we) # r = 2, N = 7
vecm_noe = ca.jo(no_exp, type = "trace", ecdet = "none", K = 3, spec = "transitory")
summary(vecm_noe) # r = 2, N = 5
# forecast with quarterly data
f = 1
forecasts = array(NA, c(4, 3, 2))
vmq = list(with_exp, no_exp)
for (v in 1:2) {
vecm = ca.jo(vmq[[v]], type = "trace", ecdet = "none", K = 3, spec = "transitory")
var_cr = vec2var(vecm, r = 2)
var_pr = predict(var_cr, n.ahead = 4, ci = .68)
forecasts[,,f] = var_pr$fcst$cash.rate[,1:3]
f = f + 1
}
ym1q = zoo::as.yearqtr("2023-01") # the first forecasted period
ym2q = zoo::as.yearqtr("2023-04") # the last forecasted period
sq = seq(ym1, ym2, 1/4) # create yearqtr sequence
pooled_forecasts_q = apply(forecasts, 1:2, mean)
colnames(pooled_forecasts_q) = c("forecast", "lower", "upper")
pooled_forecasts_q = xts::xts(pooled_forecasts_q, sq + 1/12)
ym13q = zoo::as.yearqtr("2022-04") # forecast origin
s3q = seq(ym13q, ym2q, 1/4) # create yearmon sequence
ym12q = zoo::as.yearqtr("2010-01")
s2q = seq(ym12q, ym2q, 1/4) # create yearmon sequence
datainforecastq = as.vector(vmq[[1]][(dim(vmq[[1]])[1] - (length(s2q) - 4 - 1)):dim(vmq[[1]])[1], 1])
last_pointq = datainforecastq[length(datainforecastq)]
cols = c("darkorchid4","mediumorchid1","mediumorchid2","mediumorchid3","hotpink1","hotpink2","hotpink3","hotpink4")
zoo::write.zoo(pooled_forecasts_q, sep = ",", file = "forecasts/2023-02-quarterly.csv")
```
> The end-of-February forecasting for the RBA cash rate survey by [finder.com.au](https://www.finder.com.au/rba-cash-rate) brought about interesting finding. The forecasts clearly indicate the increase of the cash rate in March and until June, but then they give contradictory conclusions regarding the further developments. I interpret this instance indicating difficulties in predicting the break point, that is, the first time the RBA will not increase the rates.\
## Cash rate forecasts
The figure below presents the monthly cash rate series starting from January 2010, with the forecasts reported from March 2023 to February 2024 as the forecast mean and the 68% forecasting intervals. These forecasts clearly indicate the increases in the first half of 2023. After that period, however, the forecasts obtained using the system of weekly and monthly cash rate target series and bond yields tell a different story than those obtained using a macroeconomic system of quarterly series. The former indicates continuing increases in the cash rate until the end of the year, whereas the latter suggests stabilisation of its level halfway through the year. This discrepancy is a strong indicator that the arrival of new data will be decisive in predicting the first month in which the RBA will not increase the interest rates and when it will start decreasing them.
```{r forecast plot}
#| echo: false
ci1_tmp = col2rgb(cols[2])
ci2_tmp = col2rgb(cols[4])
ci1 = rgb(ci1_tmp[1], ci1_tmp[2], ci1_tmp[3], 100, maxColorValue = 255)
ci2 = rgb(ci2_tmp[1], ci2_tmp[2], ci2_tmp[3], 100, maxColorValue = 255)
plot(x = s2, y = c(datainforecast, pooled_forecasts[,1]), main = "Cash rate forecast",
type = "l", ylab = "[%]", xlab = "time",
ylim = range(pooled_forecasts, datainforecast), bty = "n",
lwd = 1, col = cols[1]
)
polygon(x = c(s3, s3[13:1]),
y = c(last_point,as.vector(pooled_forecasts[,2]), as.vector(pooled_forecasts[,3])[12:1], last_point),
col = ci1, border = ci1)
polygon(x = c(s3q + .25, s3q[5:1] + .25),
y = c(last_pointq,as.vector(pooled_forecasts_q[,2]), as.vector(pooled_forecasts_q[,3])[4:1], last_pointq),
col = ci2, border = ci2)
lines(x = s2, y = c(datainforecast, pooled_forecasts[,1]), lwd = 2, col = cols[1])
lines(x = s3q + .25, y = c(last_pointq, pooled_forecasts_q[,1]), lwd = 2, col = cols[4])
abline(v = ym13, col = cols[6], lty = 3)
```
The table below makes the numerical values presented in the figure more accessible.
```{r forecast table}
#| echo: false
options(knitr.kable.NA = '')
pooled_mq = merge(pooled_forecasts,pooled_forecasts_q)
colnames(pooled_mq) = c("monthly", "lower", "upper", "quarterly", "lower", "upper")
knitr::kable(as.matrix(pooled_mq), caption = "Monthly and quarterly cash rate forecasts", digits = 2)
```
## Survey answers
Based on the forecasts above, and the analysis of forecasts from individual models, I formed the following survey answers:
**When you think the RBA will change the cash rate?**
| | Mar 2023 | Apr 2023 | May 2023 | Jun 2023 | Jul 2023 | Aug 2023 | Sep 2023 | Oct 2023 | Nov 2023 | Jan 2024 or later |
|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
| Increase | ✓ | ✓ | ✓ | ✓ | | | | | | |
| Decrease | | | | | | | | | | |
**Why do you think this?**
> My predictive systems for monthly and quarterly data unequivocally indicate further increases in the value of the cash rate by around 18 basis points in March. Moreover, the cash rate will likely increase to about 3.7 or 3.9% by June 2023. However, after that period, the forecasts give contradictory conclusions. Therefore, the arrival of new data will play a decisive role in shaping expectations for the year's second half. My projections are available at https://donotdespair.github.io/cash-rate-survey-forecasts/
**By how much do you think the RBA will change the cash rate in the next meeting?**
> 15 pbs
**By how much do you think the RBA should change the cash rate in the next meeting?**
> 15 pbs
**At what level do you think the cash rate will peak?**
> 3.75%
**When do you think the cash rate will peak?**
> June 2023
## RBA's decision
On 7 March 2023, the RBA announced an **increase** in the cash rate target by **25** basis points.
## Forecasting system
Due to an extensive research and teaching agenda for February and March I did not expand the forecasting system to prepare my answers for this month's survey. Therefore, the forecasts using the quarterly system stayed the same as in [January forecasts](2023_01.qmd). The quarterly data spanning the period starting in the second quarter of 2002 and finishing in the last one of 2022 is plotted below.
```{r data plot rates}
#| echo: false
plot(x = index(with_exp), y = as.vector(with_exp[,1]), main = "Quarterly data",
type = "l", ylab = "[%]", xlab = "time",
ylim = range(with_exp[,1:6], with_exp[,7]-60), bty = "n",
lwd = 2, col = "darkorchid4"
)
for (i in 2:6) lines(x = index(with_exp), y = as.vector(with_exp[,i]), col = cols[i])
lines(x = index(with_exp), y = as.vector(with_exp[,7]) - 60, col = cols[7], lwd = 2)
lines(x = index(with_exp), y = as.vector(with_exp[,1]), col = "darkorchid4", lwd = 2)
axis(2, lwd = 2, col = "darkorchid4")
axis(4, c(-1, 2, 5), c(59, NA, 65), lwd = 2, col = cols[7])
var_names = c("cash rate", "10y bond yield", "inflation expectation eco", "inflation expectation union", "inflation", "unemployment", "employment")
legend("bottomleft", legend = var_names, col = cols[1:7], lwd = c(2, rep(1, 5), 2), bty = "n")
```
The monthly forecasts were based on the same forecasting system as the one I developed for [November forecasts](2022_11.qmd). The updated data is plotted below.
```{r data plot yields}
#| echo: false
plot(x = index(vwa), y = as.vector(vwa[,2]), main = "Australian interest rates at various maturities",
type = "l", ylab = "yield [%]", xlab = "time",
ylim = range(vwa), bty = "n",
lwd = 1, col = "mediumorchid1"
)
for (i in 3:8) lines(x = index(vwa), y = as.vector(vwa[,i]), col = cols[i])
lines(x = index(vwa), y = as.vector(vwa[,1]), col = "darkorchid4", lwd = 2)
legend("topright", legend = colnames(vwa), col = cols, lwd = c(2, rep(1, 7)), bty = "n")
```