Forecasting Labour Market Outcomes Using

Bayesian Panel Vector Autoregressions

\[ \]

\[ \]

\[ \]

\[ \]

\[ \]

\[ \]

Tomasz Woźniak

Coming up next

\[ \]

modelling and forecasting framework

the R package bpvars

Materials

\[ \]

Presentation Slides as a website

GitHub repo to reproduce the slides and results

bpvars website and CRAN profile

vignette, tutorial and manual

bsvars.org website

\[ \]

\[ \]

\[ \]

\[ \]

\[ \]

\[ \]

\[ \]

This research was funded by the International Labour Organization.

The bpvars package, vignette, and other outputs are copyrighted by the ILO.

Thank you!

modelling and forecasting framework

modelling and forecasting framework

characterisation

  • contemporary Bayesian modelling and institutional setup
  • incorporates best knowledge and practices
  • a balance between model size, flexibility, and its capacity to extract signal from data
  • highly computational, application-specific modelling
  • inspirations: UN, IPCC, ECB, FED, Christopher Sims

modelling and forecasting framework

data

  • annual country-level time series
  • \(\begin{bmatrix} gdp_{c.t} & UR_{c.t} & EPR_{c.t} & LFPR_{c.t} \end{bmatrix}\)
  • sampling period 1991-2024
  • 189 countries

modelling and forecasting framework

data

modelling and forecasting framework

modelling features

  • Bayesian nonstationary variables handling
  • system modelling
  • dynamic approach
  • country-specific vector autoregression
  • global vector autoregression for prior mean
  • hierarchical modelling
  • model-coherent missing observation handling
  • parameter grouping
  • parameter estimation risk accountability

modelling and forecasting framework

country-specific vector autoregression

\[\begin{align} &\\ \mathbf{y}_{c.t} &= \mathbf{A}_{c.1} \mathbf{y}_{c.t-1} + \mathbf{A}_{d.c}\mathbf{x}_{c.t} + \boldsymbol\epsilon_{c.t}\\[1ex] \boldsymbol\epsilon_{c.t}\mid \mathbf{y}_{c.t-1} & \sim N_4\left(\mathbf{0}_4, \boldsymbol\Sigma_c\right)\\[2ex] \end{align}\]

  • subscript \(c\) is for country, and \(t\) is for time
  • captures country-specific dynamics, uncertainty and heterogeneity
  • parameters \(\mathbf{A}_{c.1}\), \(\mathbf{A}_{d.c}\) and \(\boldsymbol\Sigma_c\) are estimated

modelling and forecasting framework

global model for the prior mean

  • prior expectations are parameters

\[\begin{align} E_\pi\left[\mathbf{A}_{c}\right] &= \mathbf{A}, \qquad \mathbf{A}_{c} = \begin{bmatrix} \mathbf{A}_{c.1} & \mathbf{A}_{d.c} \end{bmatrix}'\\[1ex] E_\pi\left[\boldsymbol\Sigma_c\right] &= \boldsymbol\Sigma\\ \end{align}\]

  • a global model under the prior mean

\[\begin{align} \mathbf{y}_{c.t} &= \mathbf{A}_{1} \mathbf{y}_{c.t-1} + \mathbf{A}_{d}\mathbf{x}_{c.t} + \boldsymbol\epsilon_{c.t}\\[1ex] \boldsymbol\epsilon_{c.t}\mid \mathbf{y}_{c.t-1} & \sim N_4\left(\mathbf{0}_4, \boldsymbol\Sigma\right) \end{align}\]

  • parameters \(\mathbf{A}_{1}\), \(\mathbf{A}_{d}\) and \(\boldsymbol\Sigma\) are estimated
  • panel data efficiency gains and interpretations

modelling and forecasting framework

group modelling

  • let each country be assigned to a group \(g\in\{1,\dots,G\}\)

  • country grouping \[\begin{align} \mathbf{y}_{c.t} &= \mathbf{A}_{g.1} \mathbf{y}_{c.t-1} + \mathbf{A}_{d.g}\mathbf{x}_{c.t} + \boldsymbol\epsilon_{c.t}, \qquad \boldsymbol\epsilon_{c.t}\mid \mathbf{y}_{c.t-1} \sim N_4\left(\mathbf{0}_4, \boldsymbol\Sigma_g\right)\\[2ex] \end{align}\]

  • global prior grouping

\[\begin{align} E_\pi\left[\mathbf{A}_{c}\right] &= \mathbf{A}_g, \qquad E_\pi\left[\boldsymbol\Sigma_c\right] = \boldsymbol\Sigma_g\\ \end{align}\]

  • pre-specified or estimated group membership

modelling and forecasting framework

  • country-specific VARs with global prior
  • country-specific VARs with global prior by Jarociński (2010, JAE)
  • country-grouping VARs with global prior (fixed or estimated groupings)
  • country-specific VARs with global prior grouping (fixed or estimated groupings)
  • country-specific VARs
  • VAR lag order modification
  • exogenous variables
  • constrained forecasting of rates
  • prior hyper-parameters adjustment
  • global prior mean set to pooled estimator by Zellner, Hong (1989, JOE)

modelling and forecasting framework

forecasting features

  • original non-stationary variables
  • point and density forecasting
  • forecasting for models with exogenous variables
  • restricted forecasting of rates
  • marginal forecasts of labour market indicators
  • expanding-window recursive forecasting
  • forecast performance evaluation
  • forecast error variance decomposition

modelling and forecasting framework

one-period-ahead conditional predictive density

\[\begin{align} &\\ {\color{lig}p\left(\mathbf{y}_{c.t+1}\mid \mathbf{y}_{c.t},\mathbf{A}_{c},\boldsymbol\Sigma_c\right)} & = N_4\left(\mathbf{A}_{c.1} \mathbf{y}_{c.t} + \mathbf{A}_{d.c}\mathbf{x}_{c.t+1}, \boldsymbol\Sigma_c\right)\\[5ex] \end{align}\]

  • implied by the model
  • equivalent to the frequentist predictive density

joint predictive density

\[\begin{align} p\left(\mathbf{y}_{c.t+h},\dots,\mathbf{y}_{c.t+1}\mid \mathbf{Y}_{c.t}\right) &= \int p\left(\mathbf{y}_{c.t+h},\dots,\mathbf{y}_{c.t+1},\mathbf{A}_{c},\boldsymbol\Sigma_c\mid \mathbf{Y}_{c.t}\right)d\left(\mathbf{A}_{c},\boldsymbol\Sigma_c\right) \end{align}\]

  • accounts for parameter uncertainty
  • used to generate forecast summaries

the R package bpvars

the R package bpvars

features

  • precise estimation and forecasting
  • simple workflows in R
  • excellent computational speed
    • frontier econometric and numerical techniques
    • algorithms written in C++
  • extensive documentation
  • meeting all CRAN standards
  • to install the package run
install.packages("bpvars")
  • upload it in R using
library(bpvars)

the R package bpvars

the R package bpvars

inspect the data

library(bpvars)                                   # load the package
tail(ilo_dynamic_panel$COL, 8)                    # inspect Colombian data
Time Series:
Start = 2017 
End = 2024 
Frequency = 1 
          gdp     UR     EPR    LFPR
2017 26.43928  9.086 60.0148 66.0127
2018 26.46460  9.360 59.1306 65.2368
2019 26.49597 10.280 57.7094 64.3217
2020 26.42140 15.983 53.2794 63.4150
2021 26.52396 13.898 55.3892 64.3298
2022 26.59468 10.541 56.4978 63.1550
2023 26.60178  9.591 57.6234 63.7363
2024 26.61907  9.619 57.4175 63.5283

the R package bpvars

specify and estimate the model

spec = specify_bvarPANEL$new(                           # specify the model
  ilo_dynamic_panel,                                    # data
  exogenous = ilo_exogenous_variables                   # exogenous variables
)

burn = estimate(spec, S = 5000, show_progress = FALSE) # run the burn-in
post = estimate(burn, S = 5000)                        # estimate the model
**************************************************|
bpvars: Forecasting with Bayesian Panel VARs      |
**************************************************|
 Progress of the MCMC simulation for 5000 draws
    Every draw is saved via MCMC thinning
 Press Esc to interrupt the computations
**************************************************|

the R package bpvars

forecast labour market outcomes

fore = forecast(                                    # forecast the model
  post,                                             # estimation output
  horizon = 5,                                      # forecast horizon
  exogenous_forecast = ilo_exogenous_forecasts,     # forecasts for exogenous variables
) 
plot(fore, "COL", main = "Forecasts for Colombia")  # plot the forecasts

the R package bpvars

report the forecasts

summ = summary(fore, "COL")                       # compute forecast summaries
 **************************************************|
 bsvars: Bayesian Structural Vector Autoregressions|
 **************************************************|
   Posterior summary of forecasts                  |
 **************************************************|
summ$variable2                                    # report forecasts for UR
      mean       sd 5% quantile 95% quantile
1 8.973474 1.747242   6.1337811     11.87172
2 8.441901 2.382514   4.5622894     12.39060
3 8.032808 2.910939   3.2775874     12.71294
4 7.617333 3.377959   2.0246760     13.00899
5 7.303411 3.823682   0.8388716     13.26242

the R package bpvars

forecast error variance decomposition

post |>                                              # estimation output
  compute_variance_decompositions(horizon = 5) |>    # compute variance decompositions
  plot(which_c = "COL")                              # plot variance decompositions 

the R package bpvars

forecast performance evaluation

# Benchmark model
spec = specify_bvarPANEL$new(ilo_dynamic_panel)   # specify the model
poos = specify_poosf_exercise$new(                # specify forecasting exercise
          spec,
          S = 1000,
          S_burn = 1000,
          horizons = 1,
          training_sample = 30
)
fore = forecast_poos_recursively(spec, poos)      # run the forecasting exercise 
**************************************************|
 bpvars: Forecasting with Bayesian Panel VARs     |
**************************************************|
 Recursive pseudo-out-of-sample forecasting using
         expanding window samples.
 Press Esc to interrupt the computations
**************************************************|
 Step 1: Estimate a model for a full sample to get
         starting values for subsequent steps.
 Step 2: Recursive pseudo out-of-sample
         forecasting performed for 4 samples.
**************************************************|
fper = compute_forecast_performance(fore)         # compute performance metrics 

the R package bpvars

forecast performance evaluation

# Model with country-grouping
spec_g = specify_bvarGroupPANEL$new(                # specify the model
          ilo_dynamic_panel,
          group_allocation = country_grouping_region
)
poos_g = specify_poosf_exercise$new(                # specify forecasting exercise
          spec_g,
          S = 1000,
          S_burn = 1000,
          horizons = 1,
          training_sample = 30
)
fore_g = forecast_poos_recursively(spec_g, poos_g)  # run the forecasting exercise 
**************************************************|
 bpvars: Forecasting with Bayesian Panel VARs     |
**************************************************|
 Recursive pseudo-out-of-sample forecasting using
         expanding window samples.
 Press Esc to interrupt the computations
**************************************************|
 Step 1: Estimate a model for a full sample to get
         starting values for subsequent steps.
 Step 2: Recursive pseudo out-of-sample
         forecasting performed for 4 samples.
**************************************************|
fper_g = compute_forecast_performance(fore_g)       # compute performance metrics 

the R package bpvars

forecast performance evaluation

# density forecast performance comparison
cbind(fper$PLS$Global, fper_g$PLS$Global)
               1           1
gdp    2.0029142  1.38461653
UR    -0.3189408 -1.11473429
EPR   -0.7699760 -2.23051976
LFPR  -0.4199861 -2.26197923
joint  5.3925000 -0.07476067
# point forecast performance comparison
cbind(fper$RMSFE$Global, fper_g$RMSFE$Global)
               1          1
gdp   0.04835066 0.06344612
UR    0.66996438 0.37080192
EPR   0.95221640 3.02070408
LFPR  0.83349208 3.37976098
joint 0.71634754 2.27425575