| Title: | Forecasting with Bayesian Panel Vector Autoregressions |
|---|---|
| Description: | Provides Bayesian estimation and forecasting of dynamic panel data using Bayesian Panel Vector Autoregressions with hierarchical prior distributions. The models include country-specific Vector Autoregressions (VARs) that share a global prior distribution that extend the model by Jarociński (2010) <doi:10.1002/jae.1082>. Under this prior expected value, each country's system follows a global VAR with country-invariant parameters. Further flexibility is provided by the hierarchical prior structure that retains the Minnesota prior interpretation for the global VAR and features estimated prior covariance matrices, shrinkage, and persistence levels. Bayesian forecasting is developed for models including exogenous variables, allowing conditional forecasts given the future trajectories of some variables and restricted forecasts assuring that rates are forecasted to stay positive and less than 100. The package implements the model specification, estimation, and forecasting routines, facilitating coherent workflows and reproducibility. It also includes automated pseudo-out-of-sample forecasting and computation of forecasting performance measures. Beautiful plots, informative summary functions, and extensive documentation complement all this. Extraordinary computational speed is achieved thanks to employing frontier econometric and numerical techniques and algorithms written in 'C++'. The 'bpvars' package is aligned regarding objects, workflows, and code structure with the 'R' packages 'bsvars' by Woźniak (2024) <doi:10.32614/CRAN.package.bsvars> and 'bsvarSIGNs' by Wang & Woźniak (2025) <doi:10.32614/CRAN.package.bsvarSIGNs>, and they constitute an integrated toolset. Copyright: 2025 International Labour Organization. The International Labour Organization should not be held responsible for any issues arising from the use of the 'bpvars' package or from the results obtained with it. |
| Authors: | Tomasz Woźniak [aut, cre] (ORCID: <https://orcid.org/0000-0003-2212-2378>), Miguel Sanchez-Martinez [ctb], International Labour Organization [cph] (The International Labour Organization should not be held responsible for any issues arising from the use of the 'bpvars' package or from the results obtained with it.) |
| Maintainer: | Tomasz Woźniak <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.0.9000 |
| Built: | 2026-05-20 09:49:49 UTC |
| Source: | https://github.com/bsvars/bpvars |
Provides Bayesian estimation and forecasting of dynamic panel data using Bayesian Panel Vector Autoregressions with hierarchical prior distributions. The models include country-specific Vector Autoregressions (VARs) that share a global prior distribution that extend the model by Jarociński (2010) doi:10.1002/jae.1082. Under this prior expected value, each country's system follows a global VAR with country-invariant parameters. Further flexibility is provided by the hierarchical prior structure that retains the Minnesota prior interpretation for the global VAR and features estimated prior covariance matrices, shrinkage, and persistence levels. Bayesian forecasting is developed for models including exogenous variables, allowing conditional forecasts given the future trajectories of some variables and restricted forecasts assuring that rates are forecasted to stay positive and less than 100. The package implements the model specification, estimation, and forecasting routines, facilitating coherent workflows and reproducibility. It also includes automated pseudo-out-of-sample forecasting and computation of forecasting performance measures. Beautiful plots, informative summary functions, and extensive documentation complement all this. Extraordinary computational speed is achieved thanks to employing frontier econometric and numerical techniques and algorithms written in 'C++'. The 'bpvars' package is aligned regarding objects, workflows, and code structure with the R packages 'bsvars' by Woźniak (2024) doi:10.32614/CRAN.package.bsvars and 'bsvarSIGNs' by Wang & Woźniak (2025) doi:10.32614/CRAN.package.bsvarSIGNs, and they constitute an integrated toolset. Copyright: 2025 International Labour Organization. The International Labour Organization should not be held responsible for any issues arising from the use of the 'bpvars' package or from the results obtained with it.
The package provides a set of functions for predictive analysis with the Bayesian Hierarchical Panel Vector Autoregression.
The Model. The model specification is initiated using function
specify_bvarPANEL that creates an object of class
BVARPANEL containing the prior specification, starting values for
estimation, data matrices, and the setup of the Monte Carlo Markov
Chain sampling algorithm.
The model features country-specific Vector Autoregressive
(VAR) equation for N dependent variables with T_c observations
for each country c. Its equation is given by
where is an T_c x N matrix of dependent variables for
country c, is a T_c x K matrix of explanatory
variables, is an T_c x N matrix of error terms, and
is an NxK matrix of country-specific autoregressive slope
coefficients and parameters on deterministic terms in . The
parameter matrix includes autoregressive matrices capturing the
effects of the lagged vectors of dependent variables at lags from 1 to p,
a constant term and a set of exogenous variables.
The error terms for each of the periods have zero conditional mean and
conditional covariance given by the NxN matrix . The errors
are jointly normally distributed and serially uncorrelated. These
assumptions are summarised using a matrix-variate normal distribution
(see Woźniak, 2016):
where the identity matrix of order T_c and joint
normality imply no serial autocorrelation. Matrix
denotes a T_c x N matrix of zeros.
Global Prior Distributions. The Hierarchical Panel VAR model features a sophisticated hierarchical prior structure that grants the model flexibility, interpretability, and improved forecasting performance.
The country-specific parameters follow a prior distribution that, at its
mean value, represents a global VAR model with a global autoregressive
parameter matrix of dimension KxN and an NxN global
covariance matrix :
This global VAR model under the prior mean is represented by the parameters of the matrix-variate normal inverted Wishart distribution (see Woźniak, 2016) given by:
where is a KxK column-specific covariance matrix,
is the row-specific matrix, and is the
degrees-of-freedom parameter.
All of the parameters of the prior distribution above feature their own prior distributions and are estimated. These prior distributions are given by:
with the KxN mean matrix , the KxK
column-specific covariance matrix , and the NxN matrix of
row-specific covariance .
The global error term covariance matrix, , follows a Wishart
distribution with NxN scale matrix
and shape parameter
Other Prior Distributions.
The column-specific covariance follows the inverse-Wishart
distribution with scale and shape
:
The shape parameter follows an exponential distribution with mean
:
Finally, the priors for the remaining scalar hyper-parameters are:
The prior hyper-parameters in this note are grouped into those that are:
and denoted using underscore, such as e.g.
, , or
. These hyper-parameters must be fixed and their
default values are set by initiating the model specification using function
specify_bvarPANEL. These values can be accesses from such
generated object in its element prior and can be modified by the user.
not featuring the underscore in the notation, such as e.g.
, , or . These hyper-parameters
are estimated and their posterior draws are available from an object
generated after the estimation running the function estimate.
Estimation. The package implements Bayesian estimation using the Gibbs sampler. This algorithm provides a sample of random draws from the posterior distribution of the parameters of the model. The posterior distribution is defined by Bayes' Rule stating that the posterior distribution of the parameters given data and is proportional to the likelihood function and the prior distribution of the parameters:
where collects all the parameters of the model to be
estimated. At each of its iterations a single draw of all of the
parameters of the model, including the estimated hyper-parameters, is obtained.
This Bayesian procedure estimates jointly all the parameters of the model and
is implemented in the estimate.BVARPANEL and
estimate.PosteriorBVARPANEL functions.
Forecasting.
The package implements Bayesian forecasting providing the a sample of draws
from the joint predictive density defined as the joint density of the future
unknown values to be predicted, , given data,
closely following Karlsson (2013):
The package offers the possibility of:
given the provided future values of the exogenous variables.
given provided future projections for some of the variables.
for variables that represents rates from the
interval .
The forecasting is performed using function forecast.PosteriorBVARPANEL.
This package is currently in active development.
Tomasz Woźniak [email protected]
Jarociński, M. (2010). Responses to Monetary Policy Shocks in the East and the West of Europe: a Comparison. Journal of Applied Econometrics, 25(5), 833-868, doi:10.1002/jae.1082.
Karlsson, S. (2013). Forecasting with Bayesian Vector Autoregression, in: Handbook of Economic Forecasting, Elsevier. volume 2, 791–897, doi:10.1016/B978-0-444-62731-5.00015-4.
Woźniak, T. (2016). Bayesian Vector Autoregressions, Australian Economic Review, 49, 365-380, doi:10.1111/1467-8462.12179.
specify_bvarPANEL, estimate.BVARPANEL,
forecast.PosteriorBVARPANEL
# Basic estimation and forecasting example ############################################################ specification = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model burn_in = estimate(specification, S = 5) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, S = 5) # estimate the model; use say S = 10000 predictive = forecast(posterior, 2) # forecast the future # workflow with the pipe |> ilo_dynamic_panel[1:5] |> specify_bvarPANEL$new() |> estimate(S = 5) |> estimate(S = 5) |> forecast(horizon = 2) -> predictive# Basic estimation and forecasting example ############################################################ specification = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model burn_in = estimate(specification, S = 5) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, S = 5) # estimate the model; use say S = 10000 predictive = forecast(posterior, 2) # forecast the future # workflow with the pipe |> ilo_dynamic_panel[1:5] |> specify_bvarPANEL$new() |> estimate(S = 5) |> estimate(S = 5) |> forecast(horizon = 2) -> predictive
Computes forecasting performance measures selected from:
log-predictive score "lps", root-mean-squared-forecast error "rmsfe",
mean-absolute-forecast error "mafe" from the output of the recursive
pseudo-out-of-sample forecastinge exercise performed using function
forecast_poos_recursively.
compute_forecast_performance(forecasts, measures = c("pls", "rmsfe", "mafe"))compute_forecast_performance(forecasts, measures = c("pls", "rmsfe", "mafe"))
forecasts |
an object containing the
outcome of Bayesian recursive pseudo-out-of-sample forecasting exercise
using expanding window samples generated using function |
measures |
a character vector with any of the values |
An object of class ForecastingPerformance
Tomasz Woźniak [email protected]
forecast_poos_recursively,
forecast_poos_recursively.BVARPANEL,
forecast_poos_recursively.BVARGROUPPANEL
spec = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model poos = specify_poosf_exercise$new(spec, 2, 5, 1, 30) # specify the forecasting exercise fore = forecast_poos_recursively(spec, poos) # perform the forecasting exercise fp = compute_forecast_performance(fore, "pls") # compute forecasting performance measuresspec = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model poos = specify_poosf_exercise$new(spec, 2, 5, 1, 30) # specify the forecasting exercise fore = forecast_poos_recursively(spec, poos) # perform the forecasting exercise fp = compute_forecast_performance(fore, "pls") # compute forecasting performance measures
Computes forecasting performance measures selected from:
log-predictive score "lps", root-mean-squared-forecast error "rmsfe",
mean-absolute-forecast error "mafe" from the output of the recursive
pseudo-out-of-sample forecastinge exercise performed using function
forecast_poos_recursively.
## S3 method for class 'ForecastsPANELpoos' compute_forecast_performance(forecasts, measures = c("pls", "rmsfe", "mafe"))## S3 method for class 'ForecastsPANELpoos' compute_forecast_performance(forecasts, measures = c("pls", "rmsfe", "mafe"))
forecasts |
an object of class |
measures |
a character vector with any of the values |
An object of class ForecastingPerformance
Tomasz Woźniak [email protected]
forecast_poos_recursively,
forecast_poos_recursively.BVARPANEL,
forecast_poos_recursively.BVARGROUPPANEL
spec = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model poos = specify_poosf_exercise$new(spec, 2, 5, 1, 30) # specify the forecasting exercise fore = forecast_poos_recursively(spec, poos) # perform the forecasting exercise fp = compute_forecast_performance(fore, "pls") # compute forecasting performance measuresspec = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model poos = specify_poosf_exercise$new(spec, 2, 5, 1, 30) # specify the forecasting exercise fore = forecast_poos_recursively(spec, poos) # perform the forecasting exercise fp = compute_forecast_performance(fore, "pls") # compute forecasting performance measures
For each country, each of the draws from the posterior estimation of the model is transformed into a draw from the posterior distribution of the forecast error variance decomposition.
## S3 method for class 'PosteriorBVARGROUPPANEL' compute_variance_decompositions(posterior, horizon)## S3 method for class 'PosteriorBVARGROUPPANEL' compute_variance_decompositions(posterior, horizon)
posterior |
posterior estimation outcome - an object of class
|
horizon |
a positive integer number denoting the forecast horizon for the forecast error variance decompositions. |
An object of class PosteriorFEVDPANEL, that is, a list with
C elements containing NxNx(horizon+1)xS arrays of class
PosteriorFEVD with S draws of country-specific forecast error
variance decompositions.
Tomasz Woźniak [email protected]
Lütkepohl, H. (2017). Structural VAR Tools, Chapter 4, In: Structural vector autoregressive analysis. Cambridge University Press.
estimate.PosteriorBVARGROUPPANEL,
summary.PosteriorFEVDPANEL,
plot.PosteriorFEVDPANEL
# specify the model and set seed specification = specify_bvarGroupPANEL$new( # specify the model ilo_dynamic_panel[1:5], group_allocation = country_grouping_region[1:5] ) # run the burn-in burn_in = estimate(specification, 5) # estimate the model posterior = estimate(burn_in, 5) # compute forecast error variance decomposition 4 years ahead fevd = compute_variance_decompositions(posterior, horizon = 4)# specify the model and set seed specification = specify_bvarGroupPANEL$new( # specify the model ilo_dynamic_panel[1:5], group_allocation = country_grouping_region[1:5] ) # run the burn-in burn_in = estimate(specification, 5) # estimate the model posterior = estimate(burn_in, 5) # compute forecast error variance decomposition 4 years ahead fevd = compute_variance_decompositions(posterior, horizon = 4)
For each country, each of the draws from the posterior estimation of the model is transformed into a draw from the posterior distribution of the forecast error variance decomposition.
## S3 method for class 'PosteriorBVARPANEL' compute_variance_decompositions(posterior, horizon)## S3 method for class 'PosteriorBVARPANEL' compute_variance_decompositions(posterior, horizon)
posterior |
posterior estimation outcome - an object of class
|
horizon |
a positive integer number denoting the forecast horizon for the forecast error variance decompositions. |
An object of class PosteriorFEVDPANEL, that is, a list with
C elements containing NxNx(horizon+1)xS arrays of class
PosteriorFEVD with S draws of country-specific forecast error
variance decompositions.
Tomasz Woźniak [email protected]
Lütkepohl, H. (2017). Structural VAR Tools, Chapter 4, In: Structural vector autoregressive analysis. Cambridge University Press.
estimate.PosteriorBVARPANEL,
summary.PosteriorFEVDPANEL,
plot.PosteriorFEVDPANEL
# specify the model and set seed specification = specify_bvarPANEL$new(ilo_dynamic_panel[1:5], p = 1) # run the burn-in burn_in = estimate(specification, 5) # estimate the model posterior = estimate(burn_in, 5) # compute forecast error variance decomposition 4 years ahead fevd = compute_variance_decompositions(posterior, horizon = 4)# specify the model and set seed specification = specify_bvarPANEL$new(ilo_dynamic_panel[1:5], p = 1) # run the burn-in burn_in = estimate(specification, 5) # estimate the model posterior = estimate(burn_in, 5) # compute forecast error variance decomposition 4 years ahead fevd = compute_variance_decompositions(posterior, horizon = 4)
For each country, each of the draws from the posterior estimation of the model is transformed into a draw from the posterior distribution of the forecast error variance decomposition.
## S3 method for class 'PosteriorBVARs' compute_variance_decompositions(posterior, horizon)## S3 method for class 'PosteriorBVARs' compute_variance_decompositions(posterior, horizon)
posterior |
posterior estimation outcome - an object of class
|
horizon |
a positive integer number denoting the forecast horizon for the forecast error variance decompositions. |
An object of class PosteriorFEVDPANEL, that is, a list with
C elements containing NxNx(horizon+1)xS arrays of class
PosteriorFEVD with S draws of country-specific forecast error
variance decompositions.
Tomasz Woźniak [email protected]
Lütkepohl, H. (2017). Structural VAR Tools, Chapter 4, In: Structural vector autoregressive analysis. Cambridge University Press.
estimate.PosteriorBVARs,
summary.PosteriorFEVDPANEL,
plot.PosteriorFEVDPANEL
# specify the model and set seed specification = specify_bvars$new(ilo_dynamic_panel[1:5]) # specify the model # run the burn-in burn_in = estimate(specification, 5) # estimate the model posterior = estimate(burn_in, 5) # compute forecast error variance decomposition 4 years ahead fevd = compute_variance_decompositions(posterior, horizon = 4)# specify the model and set seed specification = specify_bvars$new(ilo_dynamic_panel[1:5]) # specify the model # run the burn-in burn_in = estimate(specification, 5) # estimate the model posterior = estimate(burn_in, 5) # compute forecast error variance decomposition 4 years ahead fevd = compute_variance_decompositions(posterior, horizon = 4)
Each of the country is classified into one of the 4 categories according to their geographical location. The categories are:
Low-income countries
Lower-middle-income countries
Upper-middle-income countries
High-income countries
Last data update was implemented on 2026-04-18.
data(country_grouping_incomegroup)data(country_grouping_incomegroup)
A numeric vector with values from 1 to 4
International Labour Organization. (2020). ILO modelled estimates database, ILOSTAT [database]. Available from https://ilostat.ilo.org/data/.
data(country_grouping_incomegroup) # upload the data # setup a fixed group allocation Panel VAR model spec = specify_bvarGroupPANEL$new( ilo_dynamic_panel, group_allocation = country_grouping_incomegroup )data(country_grouping_incomegroup) # upload the data # setup a fixed group allocation Panel VAR model spec = specify_bvarGroupPANEL$new( ilo_dynamic_panel, group_allocation = country_grouping_incomegroup )
Each of the country is classified into one of the 5 categories according to their geographical location. The categories are:
Asia and the Pacific
Africa
Europe and Central Asia
Arab States
Americas
Last data update was implemented on 2026-04-18.
data(country_grouping_region)data(country_grouping_region)
A numeric vector with values from 1 to 5
International Labour Organization. (2020). ILO modelled estimates database, ILOSTAT [database]. Available from https://ilostat.ilo.org/data/.
data(country_grouping_region) # upload the data # setup a fixed group allocation Panel VAR model spec = specify_bvarGroupPANEL$new( ilo_dynamic_panel, group_allocation = country_grouping_region )data(country_grouping_region) # upload the data # setup a fixed group allocation Panel VAR model spec = specify_bvarGroupPANEL$new( ilo_dynamic_panel, group_allocation = country_grouping_region )
Each of the country is classified into one of the 11 categories according to their geographical location. The categories are:
Southern Asia
Sub-Saharan Africa
Northern, Southern and Western Europe
Arab States
Latin America and the Caribbean
Central and Western Asia
South-Eastern Asia and the Pacific
Eastern Europe
Northern America
Eastern Asia
Northern Africa
Last data update was implemented on 2026-04-18.
data(country_grouping_subregionbroad)data(country_grouping_subregionbroad)
A numeric vector with values from 1 to 11
International Labour Organization. (2020). ILO modelled estimates database, ILOSTAT [database]. Available from https://ilostat.ilo.org/data/.
data(country_grouping_subregionbroad) # upload the data # setup a fixed group allocation Panel VAR model spec = specify_bvarGroupPANEL$new( ilo_dynamic_panel, group_allocation = country_grouping_subregionbroad )data(country_grouping_subregionbroad) # upload the data # setup a fixed group allocation Panel VAR model spec = specify_bvarGroupPANEL$new( ilo_dynamic_panel, group_allocation = country_grouping_subregionbroad )
Each of the country is classified into one of the 20 categories according to their geographical location. The categories are:
Southern Asia
Central Africa
Southern Europe
Arab States
South America
Western Asia
Pacific Islands
Western Europe
Eastern Africa
Western Africa
Eastern Europe
Caribbean
Central America
South-Eastern Asia
Southern Africa
Northern America
Northern Europe
Eastern Asia
Northern Africa
Central Asia
Last data update was implemented on 2026-04-18.
data(country_grouping_subregiondetailed)data(country_grouping_subregiondetailed)
A numeric vector with values from 1 to 20
International Labour Organization. (2020). ILO modelled estimates database, ILOSTAT [database]. Available from https://ilostat.ilo.org/data/.
data(country_grouping_subregiondetailed) # upload the data # setup a fixed group allocation Panel VAR model spec = specify_bvarGroupPANEL$new( ilo_dynamic_panel, group_allocation = country_grouping_subregiondetailed )data(country_grouping_subregiondetailed) # upload the data # setup a fixed group allocation Panel VAR model spec = specify_bvarGroupPANEL$new( ilo_dynamic_panel, group_allocation = country_grouping_subregiondetailed )
Estimates the Bayesian Hierarchical Panel VAR with fixed or estimated country grouping using the Gibbs sampler proposed by Sanchez-Martinez & Woźniak (2024).
## S3 method for class 'BVARGROUPPANEL' estimate(specification, S, thin = 1L, show_progress = TRUE)## S3 method for class 'BVARGROUPPANEL' estimate(specification, S, thin = 1L, show_progress = TRUE)
specification |
an object of class |
S |
a positive integer, the number of posterior draws to be generated |
thin |
a positive integer, specifying the frequency of MCMC output thinning |
show_progress |
a logical value, if |
The Bayesian Hierarchical Panel Vector Autoregressive model with fixed or estimated country grouping is estimated using the Gibbs sampler. In this estimation procedure all the parameters of the model are estimated jointly. The list of parameters of the model includes:
a KxN country-specific autoregressive
parameters matrix for each of the countries
an NxN country-specific covariance
matrix for each of the countries
a KxN global autoregressive parameters matrix
an NxN global covariance matrix
a KxK covariance matrix of prior for global autoregressive parameters
prior degrees of freedom parameter
prior average global persistence parameter
prior scaling parameter
prior scaling parameter
Parameters and are subject to
country grouping which sets them to the group-specific values.
Gibbs sampler
is an algorithm to sample random draws from the posterior distribution of the
parameters of the model given the data. The algorithm is briefly explained
on an example of a two-parameter model with parameters and
. In order to sample from the joint posterior distribution
the Gibbs sampler proceeds by sampling
from full-conditional posterior distributions of each parameter given data
and all the other parameters, denoted by
and . These distributions are available
from derivations and should be in a form of distributions that are easy to
sample random numbers from.
To obtain S draws from the posterior distribution:
Set the initial values of the parameters
At each of the s iterations:
Sample from
Sample from
Repeat step 2. S times. Return
as a sample drawn from the posterior distribution .
The estimate() function returns the draws from the posterior distribution
of the parameters of the hierarchical panel VAR model listed above.
Thinning.
Thinning is a procedure to reduce the dependence in the returned sample from
the posterior distribution. It is obtained by returning every thin
draw in the final sample. This procedure reduces the number of draws returned
by the estimate() function.
An object of class PosteriorBVARGROUPPANEL containing the Bayesian
estimation output and containing two elements:
posteriora list with a collection of S draws from the
posterior distribution generated via Gibbs sampler. Elements of the list
correspond to the parameters of the model listed in section Details
and are named respectively:
A_c, Sigma_c, A, Sigma,
V, nu, m, w, s.
last_drawan object of class BVARGROUPPANEL with the last draw of the
current MCMC run as the starting value to be passed to the continuation of
the MCMC estimation using the estimate() method.
Tomasz Woźniak [email protected]
bpvars, specify_bvarGroupPANEL,
specify_posterior_bvarGroupPANEL, summary.PosteriorBVARGROUPPANEL,
forecast.PosteriorBVARGROUPPANEL
# specify the model specification = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000# specify the model specification = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000
Estimates the Bayesian Hierarchical Panel VAR with fixed or estimated country grouping for global prior parameters using the Gibbs sampler proposed by Sanchez-Martinez & Woźniak (2024).
## S3 method for class 'BVARGROUPPRIORPANEL' estimate(specification, S, thin = 1L, show_progress = TRUE)## S3 method for class 'BVARGROUPPRIORPANEL' estimate(specification, S, thin = 1L, show_progress = TRUE)
specification |
an object of class |
S |
a positive integer, the number of posterior draws to be generated |
thin |
a positive integer, specifying the frequency of MCMC output thinning |
show_progress |
a logical value, if |
The Bayesian Hierarchical Panel Vector Autoregressive model with fixed or estimated country grouping for global prior parametrs is estimated using the Gibbs sampler. In this estimation procedure all the parameters of the model are estimated jointly. The list of parameters of the model includes:
a KxN country-specific autoregressive
parameters matrix for each of the countries
an NxN country-specific covariance
matrix for each of the countries
a KxNxG group-specific global autoregressive parameters matrix
an NxN group-specific global covariance matrix
a KxK covariance matrix of prior for global autoregressive parameters
prior degrees of freedom parameter
prior average global persistence parameter
prior scaling parameter
prior scaling parameter
Parameters and have prior expected values
determined by the group-specific prior parameters and .
Gibbs sampler
is an algorithm to sample random draws from the posterior distribution of the
parameters of the model given the data. The algorithm is briefly explained
on an example of a two-parameter model with parameters and
. In order to sample from the joint posterior distribution
the Gibbs sampler proceeds by sampling
from full-conditional posterior distributions of each parameter given data
and all the other parameters, denoted by
and . These distributions are available
from derivations and should be in a form of distributions that are easy to
sample random numbers from.
To obtain S draws from the posterior distribution:
Set the initial values of the parameters
At each of the s iterations:
Sample from
Sample from
Repeat step 2. S times. Return
as a sample drawn from the posterior distribution .
The estimate() function returns the draws from the posterior distribution
of the parameters of the hierarchical panel VAR model listed above.
Thinning.
Thinning is a procedure to reduce the dependence in the returned sample from
the posterior distribution. It is obtained by returning every thin
draw in the final sample. This procedure reduces the number of draws returned
by the estimate() function.
An object of class PosteriorBVARGROUPPRIORPANEL containing the Bayesian
estimation output and containing two elements:
posteriora list with a collection of S draws from the
posterior distribution generated via Gibbs sampler. Elements of the list
correspond to the parameters of the model listed in section Details
and are named respectively:
A_c, Sigma_c, A_g, Sigma_g,
V, nu, m, w, s.
last_drawan object of class BVARGROUPPRIORPANEL with the last draw of the
current MCMC run as the starting value to be passed to the continuation of
the MCMC estimation using the estimate() method.
Tomasz Woźniak [email protected]
bpvars, specify_bvarGroupPriorPANEL,
specify_posterior_bvarGroupPriorPANEL, summary.PosteriorBVARGROUPPRIORPANEL,
forecast.PosteriorBVARGROUPPRIORPANEL
# specify the model specification = specify_bvarGroupPriorPANEL$new( data = ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000# specify the model specification = specify_bvarGroupPriorPANEL$new( data = ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000
Estimates the Bayesian Hierarchical Panel VAR using the Gibbs sampler proposed by Sanchez-Martinez & Woźniak (2024).
## S3 method for class 'BVARPANEL' estimate(specification, S, thin = 1L, show_progress = TRUE)## S3 method for class 'BVARPANEL' estimate(specification, S, thin = 1L, show_progress = TRUE)
specification |
an object of class |
S |
a positive integer, the number of posterior draws to be generated |
thin |
a positive integer, specifying the frequency of MCMC output thinning |
show_progress |
a logical value, if |
The Bayesian Hierarchical Panel Vector Autoregressive model described in
bpvars is estimated using the Gibbs sampler. In this
estimation procedure all the parameters of the model are estimated jointly.
The list of parameters of the model includes:
a KxN country-specific autoregressive
parameters matrix for each of the countries
an NxN country-specific covariance
matrix for each of the countries
a KxN global autoregressive parameters matrix
an NxN global covariance matrix
a KxK covariance matrix of prior for global autoregressive parameters
prior degrees of freedom parameter
prior average global persistence parameter
prior scaling parameter
prior scaling parameter
Gibbs sampler
is an algorithm to sample random draws from the posterior distribution of the
parameters of the model given the data. The algorithm is briefly explained
on an example of a two-parameter model with parameters and
. In order to sample from the joint posterior distribution
the Gibbs sampler proceeds by sampling
from full-conditional posterior distributions of each parameter given data
and all the other parameters, denoted by
and . These distributions are available
from derivations and should be in a form of distributions that are easy to
sample random numbers from.
To obtain S draws from the posterior distribution:
Set the initial values of the parameters
At each of the s iterations:
Sample from
Sample from
Repeat step 2. S times. Return
as a sample drawn from the posterior distribution .
The estimate() function returns the draws from the posterior distribution
of the parameters of the hierarchical panel VAR model listed above.
Thinning.
Thinning is a procedure to reduce the dependence in the returned sample from
the posterior distribution. It is obtained by returning every thin
draw in the final sample. This procedure reduces the number of draws returned
by the estimate() function.
An object of class PosteriorBVARPANEL containing the Bayesian
estimation output and containing two elements:
posteriora list with a collection of S draws from the
posterior distribution generated via Gibbs sampler. Elements of the list
correspond to the parameters of the model listed in section Details
and are named respectively:
A_c, Sigma_c, A, Sigma,
V, nu, m, w, s.
last_drawan object of class BVARPANEL with the last draw of the
current MCMC run as the starting value to be passed to the continuation of
the MCMC estimation using the estimate() method.
Tomasz Woźniak [email protected]
bpvars, specify_bvarPANEL,
specify_posterior_bvarPANEL, summary.PosteriorBVARPANEL,
forecast.PosteriorBVARPANEL
# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000
Estimates the Bayesian Hierarchical VARs for cubic data using the Gibbs sampler proposed by Sanchez-Martinez & Woźniak (2024).
## S3 method for class 'BVARs' estimate(specification, S, thin = 1L, show_progress = TRUE)## S3 method for class 'BVARs' estimate(specification, S, thin = 1L, show_progress = TRUE)
specification |
an object of class |
S |
a positive integer, the number of posterior draws to be generated |
thin |
a positive integer, specifying the frequency of MCMC output thinning |
show_progress |
a logical value, if |
The Bayesian Hierarchical Vector Autoregressive models described in
bpvars is estimated using the Gibbs sampler. In this
estimation procedure all the parameters of the model are estimated jointly.
The list of parameters of the model includes:
a KxN country-specific autoregressive
parameters matrix for each of the countries
an NxN country-specific covariance
matrix for each of the countries
prior degrees of freedom parameter
prior average global persistence parameter
prior scaling parameter
prior scaling parameter
Gibbs sampler
is an algorithm to sample random draws from the posterior distribution of the
parameters of the model given the data. The algorithm is briefly explained
on an example of a two-parameter model with parameters and
. In order to sample from the joint posterior distribution
the Gibbs sampler proceeds by sampling
from full-conditional posterior distributions of each parameter given data
and all the other parameters, denoted by
and . These distributions are available
from derivations and should be in a form of distributions that are easy to
sample random numbers from.
To obtain S draws from the posterior distribution:
Set the initial values of the parameters
At each of the s iterations:
Sample from
Sample from
Repeat step 2. S times. Return
as a sample drawn from the posterior distribution .
The estimate() function returns the draws from the posterior distribution
of the parameters of the hierarchical VAR model listed above.
Thinning.
Thinning is a procedure to reduce the dependence in the returned sample from
the posterior distribution. It is obtained by returning every thin
draw in the final sample. This procedure reduces the number of draws returned
by the estimate() function.
An object of class PosteriorBVARs containing the Bayesian
estimation output and containing two elements:
posteriora list with a collection of S draws from the
posterior distribution generated via Gibbs sampler. Elements of the list
correspond to the parameters of the model listed in section Details
and are named respectively:
A_c, Sigma_c, nu, m, w, s.
last_drawan object of class BVARs with the last draw of the
current MCMC run as the starting value to be passed to the continuation of
the MCMC estimation using the estimate() method.
Tomasz Woźniak [email protected]
bpvars, specify_bvars,
specify_posterior_bvars, summary.PosteriorBVARs,
forecast.PosteriorBVARs
# specify the model specification = specify_bvars$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000# specify the model specification = specify_bvars$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000
Estimates the Bayesian Hierarchical Panel VAR with fixed or estimated country grouping using the Gibbs sampler proposed by Sanchez-Martinez & Woźniak (2024).
## S3 method for class 'PosteriorBVARGROUPPANEL' estimate(specification, S, thin = 1, show_progress = TRUE)## S3 method for class 'PosteriorBVARGROUPPANEL' estimate(specification, S, thin = 1, show_progress = TRUE)
specification |
an object of class |
S |
a positive integer, the number of posterior draws to be generated |
thin |
a positive integer, specifying the frequency of MCMC output thinning |
show_progress |
a logical value, if |
The Bayesian Hierarchical Panel Vector Autoregressive model with fixed or estimated country grouping is estimated using the Gibbs sampler. In this estimation procedure all the parameters of the model are estimated jointly. The list of parameters of the model includes:
a KxN country-specific autoregressive
parameters matrix for each of the countries
an NxN country-specific covariance
matrix for each of the countries
a KxN global autoregressive parameters matrix
an NxN global covariance matrix
a KxK covariance matrix of prior for global autoregressive parameters
prior degrees of freedom parameter
prior average global persistence parameter
prior scaling parameter
prior scaling parameter
Parameters and are subject to
country grouping which sets them to the group-specific values.
Gibbs sampler
is an algorithm to sample random draws from the posterior distribution of the
parameters of the model given the data. The algorithm is briefly explained
on an example of a two-parameter model with parameters and
. In order to sample from the joint posterior distribution
the Gibbs sampler proceeds by sampling
from full-conditional posterior distributions of each parameter given data
and all the other parameters, denoted by
and . These distributions are available
from derivations and should be in a form of distributions that are easy to
sample random numbers from.
To obtain S draws from the posterior distribution:
Set the initial values of the parameters
At each of the s iterations:
Sample from
Sample from
Repeat step 2. S times. Return
as a sample drawn from the posterior distribution .
The estimate() function returns the draws from the posterior distribution
of the parameters of the hierarchical panel VAR model listed above.
Thinning.
Thinning is a procedure to reduce the dependence in the returned sample from
the posterior distribution. It is obtained by returning every thin
draw in the final sample. This procedure reduces the number of draws returned
by the estimate() function.
An object of class PosteriorBVARGROUPPANEL containing the Bayesian
estimation output and containing two elements:
posteriora list with a collection of S draws from the
posterior distribution generated via Gibbs sampler. Elements of the list
correspond to the parameters of the model listed in section Details
and are named respectively:
A_c, Sigma_c, A, Sigma,
V, nu, m, w, s.
last_drawan object of class BVARGROUPPANEL with the last draw of the
current MCMC run as the starting value to be passed to the continuation of
the MCMC estimation using the estimate() method.
Tomasz Woźniak [email protected]
bpvars, specify_bvarGroupPANEL,
specify_posterior_bvarGroupPANEL, summary.PosteriorBVARGROUPPANEL,
forecast.PosteriorBVARGROUPPANEL
# specify the model specification = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000# specify the model specification = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000
Estimates the Bayesian Hierarchical Panel VAR with fixed or estimated country grouping for global prior parameters using the Gibbs sampler proposed by Sanchez-Martinez & Woźniak (2024).
## S3 method for class 'PosteriorBVARGROUPPRIORPANEL' estimate(specification, S, thin = 1, show_progress = TRUE)## S3 method for class 'PosteriorBVARGROUPPRIORPANEL' estimate(specification, S, thin = 1, show_progress = TRUE)
specification |
an object of class |
S |
a positive integer, the number of posterior draws to be generated |
thin |
a positive integer, specifying the frequency of MCMC output thinning |
show_progress |
a logical value, if |
The Bayesian Hierarchical Panel Vector Autoregressive model with fixed or estimated country grouping for global prior parametrs is estimated using the Gibbs sampler. In this estimation procedure all the parameters of the model are estimated jointly. The list of parameters of the model includes:
a KxN country-specific autoregressive
parameters matrix for each of the countries
an NxN country-specific covariance
matrix for each of the countries
a KxNxG group-specific global autoregressive parameters matrix
an NxN group-specific global covariance matrix
a KxK covariance matrix of prior for global autoregressive parameters
prior degrees of freedom parameter
prior average global persistence parameter
prior scaling parameter
prior scaling parameter
Parameters and have prior expected values
determined by the group-specific prior parameters and .
Gibbs sampler
is an algorithm to sample random draws from the posterior distribution of the
parameters of the model given the data. The algorithm is briefly explained
on an example of a two-parameter model with parameters and
. In order to sample from the joint posterior distribution
the Gibbs sampler proceeds by sampling
from full-conditional posterior distributions of each parameter given data
and all the other parameters, denoted by
and . These distributions are available
from derivations and should be in a form of distributions that are easy to
sample random numbers from.
To obtain S draws from the posterior distribution:
Set the initial values of the parameters
At each of the s iterations:
Sample from
Sample from
Repeat step 2. S times. Return
as a sample drawn from the posterior distribution .
The estimate() function returns the draws from the posterior distribution
of the parameters of the hierarchical panel VAR model listed above.
Thinning.
Thinning is a procedure to reduce the dependence in the returned sample from
the posterior distribution. It is obtained by returning every thin
draw in the final sample. This procedure reduces the number of draws returned
by the estimate() function.
An object of class PosteriorBVARGROUPPRIORPANEL containing the Bayesian
estimation output and containing two elements:
posteriora list with a collection of S draws from the
posterior distribution generated via Gibbs sampler. Elements of the list
correspond to the parameters of the model listed in section Details
and are named respectively:
A_c, Sigma_c, A_g, Sigma_g,
V, nu, m, w, s.
last_drawan object of class BVARGROUPPRIORPANEL with the last draw of the
current MCMC run as the starting value to be passed to the continuation of
the MCMC estimation using the estimate() method.
Tomasz Woźniak [email protected]
bpvars, specify_bvarGroupPriorPANEL,
specify_posterior_bvarGroupPriorPANEL, summary.PosteriorBVARGROUPPRIORPANEL,
forecast.PosteriorBVARGROUPPRIORPANEL
# specify the model specification = specify_bvarGroupPriorPANEL$new( data = ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000# specify the model specification = specify_bvarGroupPriorPANEL$new( data = ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000
Estimates the Bayesian Hierarchical Panel VAR using the Gibbs sampler proposed by Sanchez-Martinez & Woźniak (2024).
## S3 method for class 'PosteriorBVARPANEL' estimate(specification, S, thin = 1, show_progress = TRUE)## S3 method for class 'PosteriorBVARPANEL' estimate(specification, S, thin = 1, show_progress = TRUE)
specification |
an object of class |
S |
a positive integer, the number of posterior draws to be generated |
thin |
a positive integer, specifying the frequency of MCMC output thinning |
show_progress |
a logical value, if |
The Bayesian Hierarchical Panel Vector Autoregressive model described in
bpvars is estimated using the Gibbs sampler. In this
estimation procedure all the parameters of the model are estimated jointly.
The list of parameters of the model includes:
a KxN country-specific autoregressive
parameters matrix for each of the countries
an NxN country-specific covariance
matrix for each of the countries
a KxN global autoregressive parameters matrix
an NxN global covariance matrix
a KxK covariance matrix of prior for global autoregressive parameters
prior degrees of freedom parameter
prior average global persistence parameter
prior scaling parameter
prior scaling parameter
Gibbs sampler
is an algorithm to sample random draws from the posterior distribution of the
parameters of the model given the data. The algorithm is briefly explained
on an example of a two-parameter model with parameters and
. In order to sample from the joint posterior distribution
the Gibbs sampler proceeds by sampling
from full-conditional posterior distributions of each parameter given data
and all the other parameters, denoted by
and . These distributions are available
from derivations and should be in a form of distributions that are easy to
sample random numbers from.
To obtain S draws from the posterior distribution:
Set the initial values of the parameters
At each of the s iterations:
Sample from
Sample from
Repeat step 2. S times. Return
as a sample drawn from the posterior distribution .
The estimate() function returns the draws from the posterior distribution
of the parameters of the hierarchical panel VAR model listed above.
Thinning.
Thinning is a procedure to reduce the dependence in the returned sample from
the posterior distribution. It is obtained by returning every thin
draw in the final sample. This procedure reduces the number of draws returned
by the estimate() function.
An object of class PosteriorBVARPANEL containing the Bayesian
estimation output and containing two elements:
posteriora list with a collection of S draws from the
posterior distribution generated via Gibbs sampler. Elements of the list
correspond to the parameters of the model listed in section Details
and are named respectively:
A_c, Sigma_c, A, Sigma,
V, nu, m, w, s.
last_drawan object of class BVARPANEL with the last draw of the
current MCMC run as the starting value to be passed to the continuation of
the MCMC estimation using the estimate() method.
Tomasz Woźniak [email protected]
bpvars, specify_bvarPANEL,
specify_posterior_bvarPANEL, summary.PosteriorBVARPANEL,
forecast.PosteriorBVARPANEL
# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000
Estimates the Bayesian Hierarchical VARs for cubic data using the Gibbs sampler proposed by Sanchez-Martinez & Woźniak (2024).
## S3 method for class 'PosteriorBVARs' estimate(specification, S, thin = 1, show_progress = TRUE)## S3 method for class 'PosteriorBVARs' estimate(specification, S, thin = 1, show_progress = TRUE)
specification |
an object of class |
S |
a positive integer, the number of posterior draws to be generated |
thin |
a positive integer, specifying the frequency of MCMC output thinning |
show_progress |
a logical value, if |
The Bayesian Hierarchical Vector Autoregressive models described in
bpvars is estimated using the Gibbs sampler. In this
estimation procedure all the parameters of the model are estimated jointly.
The list of parameters of the model includes:
a KxN country-specific autoregressive
parameters matrix for each of the countries
an NxN country-specific covariance
matrix for each of the countries
prior degrees of freedom parameter
prior average global persistence parameter
prior scaling parameter
prior scaling parameter
Gibbs sampler
is an algorithm to sample random draws from the posterior distribution of the
parameters of the model given the data. The algorithm is briefly explained
on an example of a two-parameter model with parameters and
. In order to sample from the joint posterior distribution
the Gibbs sampler proceeds by sampling
from full-conditional posterior distributions of each parameter given data
and all the other parameters, denoted by
and . These distributions are available
from derivations and should be in a form of distributions that are easy to
sample random numbers from.
To obtain S draws from the posterior distribution:
Set the initial values of the parameters
At each of the s iterations:
Sample from
Sample from
Repeat step 2. S times. Return
as a sample drawn from the posterior distribution .
The estimate() function returns the draws from the posterior distribution
of the parameters of the hierarchical VAR model listed above.
Thinning.
Thinning is a procedure to reduce the dependence in the returned sample from
the posterior distribution. It is obtained by returning every thin
draw in the final sample. This procedure reduces the number of draws returned
by the estimate() function.
An object of class PosteriorBVARs containing the Bayesian
estimation output and containing two elements:
posteriora list with a collection of S draws from the
posterior distribution generated via Gibbs sampler. Elements of the list
correspond to the parameters of the model listed in section Details
and are named respectively:
A_c, Sigma_c, nu, m, w, s.
last_drawan object of class BVARs with the last draw of the
current MCMC run as the starting value to be passed to the continuation of
the MCMC estimation using the estimate() method.
Tomasz Woźniak [email protected]
bpvars, specify_bvars,
specify_posterior_bvars, summary.PosteriorBVARs,
forecast.PosteriorBVARs
# specify the model specification = specify_bvars$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000# specify the model specification = specify_bvars$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 10) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 10) # estimate the model; use say S = 10000
Performs the recursive pseudo-out-of-sample forecasting exercise using expanding window samples.
forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)
model_spec |
an object generated using one of the |
poos_spec |
an object of class |
show_progress |
a logical value, if |
An object of class ForecastsPOOS containing the outcome of Bayesian
recursive pseudo-out-of-sample forecasting exercise using expanding window
samples. The object is a list with forecasting_sample elements, where
forecasting_sample is equal to the sample size less the maximum of
horizons and the training_sample plus one. Each element of the
list is an object of class ForecastsPANEL containing the forecasts for
each country, see forecast.PosteriorBVARPANEL.
Tomasz Woźniak [email protected]
forecast.PosteriorBVARPANEL, specify_bvarPANEL,
specify_poosf_exercise, estimate.BVARPANEL
spec = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model poos = specify_poosf_exercise$new( # specify the forecasting exercise spec, S = 5, # use at least S = 5000 S_burn = 2, # use at least S_burn = 1000 horizons = 1, training_sample = 30 ) fore = forecast_poos_recursively(spec, poos) # execute the forecasting exercisespec = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model poos = specify_poosf_exercise$new( # specify the forecasting exercise spec, S = 5, # use at least S = 5000 S_burn = 2, # use at least S_burn = 1000 horizons = 1, training_sample = 30 ) fore = forecast_poos_recursively(spec, poos) # execute the forecasting exercise
Performs the recursive pseudo-out-of-sample forecasting exercise using expanding window samples.
## S3 method for class 'BVARGROUPPANEL' forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)## S3 method for class 'BVARGROUPPANEL' forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)
model_spec |
an object of class |
poos_spec |
an object of class |
show_progress |
a logical value, if |
An object of class ForecastsPOOS containing the outcome of Bayesian
recursive pseudo-out-of-sample forecasting exercise using expanding window
samples. The object is a list with forecasting_sample elements, where
forecasting_sample is equal to the sample size less the maximum of
horizons and the training_sample plus one. Each element of the
list is an object of class ForecastsPANEL containing the forecasts for
each country, see forecast.PosteriorBVARPANEL.
Tomasz Woźniak [email protected]
forecast.PosteriorBVARPANEL, specify_bvarPANEL,
specify_poosf_exercise, estimate.BVARPANEL
spec = specify_bvarGroupPANEL$new( # specify the model ilo_dynamic_panel[1:5], group_allocation = country_grouping_region[1:5] ) poos = specify_poosf_exercise$new( # specify the forecasting exercise spec, S = 5, # use at least S = 5000 S_burn = 2, # use at least S_burn = 1000 horizons = 1, training_sample = 30 ) fore = forecast_poos_recursively(spec, poos) # execute the forecasting exercisespec = specify_bvarGroupPANEL$new( # specify the model ilo_dynamic_panel[1:5], group_allocation = country_grouping_region[1:5] ) poos = specify_poosf_exercise$new( # specify the forecasting exercise spec, S = 5, # use at least S = 5000 S_burn = 2, # use at least S_burn = 1000 horizons = 1, training_sample = 30 ) fore = forecast_poos_recursively(spec, poos) # execute the forecasting exercise
Performs the recursive pseudo-out-of-sample forecasting exercise using expanding window samples.
## S3 method for class 'BVARGROUPPRIORPANEL' forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)## S3 method for class 'BVARGROUPPRIORPANEL' forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)
model_spec |
an object of class |
poos_spec |
an object of class |
show_progress |
a logical value, if |
An object of class ForecastsPOOS containing the outcome of Bayesian
recursive pseudo-out-of-sample forecasting exercise using expanding window
samples. The object is a list with forecasting_sample elements, where
forecasting_sample is equal to the sample size less the maximum of
horizons and the training_sample plus one. Each element of the
list is an object of class ForecastsPANEL containing the forecasts for
each country, see forecast.PosteriorBVARPANEL.
Tomasz Woźniak [email protected]
forecast.PosteriorBVARPANEL, specify_bvarPANEL,
specify_poosf_exercise, estimate.BVARPANEL
spec = specify_bvarGroupPriorPANEL$new( # specify the model ilo_dynamic_panel[1:5], group_allocation = country_grouping_region[1:5] ) poos = specify_poosf_exercise$new( # specify the forecasting exercise spec, S = 5, # use at least S = 5000 S_burn = 5, # use at least S_burn = 1000 horizons = 1, training_sample = 30 ) fore = forecast_poos_recursively(spec, poos) # execute the forecasting exercisespec = specify_bvarGroupPriorPANEL$new( # specify the model ilo_dynamic_panel[1:5], group_allocation = country_grouping_region[1:5] ) poos = specify_poosf_exercise$new( # specify the forecasting exercise spec, S = 5, # use at least S = 5000 S_burn = 5, # use at least S_burn = 1000 horizons = 1, training_sample = 30 ) fore = forecast_poos_recursively(spec, poos) # execute the forecasting exercise
Performs the recursive pseudo-out-of-sample forecasting exercise using expanding window samples.
## S3 method for class 'BVARPANEL' forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)## S3 method for class 'BVARPANEL' forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)
model_spec |
an object of class |
poos_spec |
an object of class |
show_progress |
a logical value, if |
An object of class ForecastsPOOS containing the outcome of Bayesian
recursive pseudo-out-of-sample forecasting exercise using expanding window
samples. The object is a list with forecasting_sample elements, where
forecasting_sample is equal to the sample size less the maximum of
horizons and the training_sample plus one. Each element of the
list is an object of class ForecastsPANEL containing the forecasts for
each country, see forecast.PosteriorBVARPANEL.
Tomasz Woźniak [email protected]
forecast.PosteriorBVARPANEL, specify_bvarPANEL,
specify_poosf_exercise, estimate.BVARPANEL
spec = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model poos = specify_poosf_exercise$new( # specify the forecasting exercise spec, S = 5, # use at least S = 5000 S_burn = 2, # use at least S_burn = 1000 horizons = 1, training_sample = 30 ) fore = forecast_poos_recursively(spec, poos) # execute the forecasting exercisespec = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model poos = specify_poosf_exercise$new( # specify the forecasting exercise spec, S = 5, # use at least S = 5000 S_burn = 2, # use at least S_burn = 1000 horizons = 1, training_sample = 30 ) fore = forecast_poos_recursively(spec, poos) # execute the forecasting exercise
Performs the recursive pseudo-out-of-sample forecasting exercise using expanding window samples.
## S3 method for class 'BVARs' forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)## S3 method for class 'BVARs' forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)
model_spec |
an object of class |
poos_spec |
an object of class |
show_progress |
a logical value, if |
An object of class ForecastsPOOS containing the outcome of Bayesian
recursive pseudo-out-of-sample forecasting exercise using expanding window
samples. The object is a list with forecasting_sample elements, where
forecasting_sample is equal to the sample size less the maximum of
horizons and the training_sample plus one. Each element of the
list is an object of class ForecastsPANEL containing the forecasts for
each country, see forecast.PosteriorBVARPANEL.
Tomasz Woźniak [email protected]
forecast.PosteriorBVARPANEL, specify_bvarPANEL,
specify_poosf_exercise, estimate.BVARPANEL
spec = specify_bvars$new(ilo_dynamic_panel[1:5]) # specify the model poos = specify_poosf_exercise$new( # specify the forecasting exercise spec, S = 5, # use at least S = 5000 S_burn = 5, # use at least S_burn = 1000 horizons = 1, training_sample = 30 ) fore = forecast_poos_recursively(spec, poos) # execute the forecasting exercisespec = specify_bvars$new(ilo_dynamic_panel[1:5]) # specify the model poos = specify_poosf_exercise$new( # specify the forecasting exercise spec, S = 5, # use at least S = 5000 S_burn = 5, # use at least S_burn = 1000 horizons = 1, training_sample = 30 ) fore = forecast_poos_recursively(spec, poos) # execute the forecasting exercise
Samples from the joint predictive density of the dependent
variables for all countries at forecast horizons
from 1 to horizon specified as an argument of the function.
Also implements conditional forecasting based on the provided projections
for some of the variables.
## S3 method for class 'PosteriorBVARGROUPPANEL' forecast( object, horizon = 1, exogenous_forecast = NULL, conditional_forecast = NULL, ... )## S3 method for class 'PosteriorBVARGROUPPANEL' forecast( object, horizon = 1, exogenous_forecast = NULL, conditional_forecast = NULL, ... )
object |
posterior estimation outcome - an object of class
|
horizon |
a positive integer, specifying the forecasting horizon. |
exogenous_forecast |
not used here ATM; included for compatibility with
generic |
conditional_forecast |
a list of length |
... |
not used |
The package provides a range of options regarding the forecasting procedure. They are dependent on the model and forecast specifications and include Bayesian forecasting many periods ahead, conditional forecasting, and forecasting for models with exogenous variables.
One-period-ahead predictive density.
The model assumptions provided in the documentation for bpvars
determine the country-specific one-period ahead conditional predictive density
for the unknown vector given the data available at
time and the parameters of the model. It is multivariate normal with
the mean and the covariance matrix
where includes the lagged
values of , the constant term, and, potentially,
exogenous variables if they were specified by the user.
Bayesian predictive density.
The one-period ahead predictive density is used to sample from the joint
predictive density of the unknown future values. This predictive density is
defined as a joint density of at horizons
, where corresponds to the value of argument
horizon, given the data available at time :
Therefore, the Bayesian forecast does not depend on the parameter values as the parameters are integrated out with respect to their posterior distribution. Consequently, Bayesian forecasts incorporate the uncertainty with respect to estimation. Sampling from the density is facilitated using the draws from the posterior density and sequential sampling from the one-period ahead predictive density.
Conditional forecasting of some of the variables given the future values of the remaining variables is implemented following Waggoner and Zha (1999) and is based on the conditional normal density given the future projections of some of the variables created basing on the one-period ahead predictive density.
Exogenous variables.
Forecasting with models for which specification argument
exogenous_variables was specified required providing the future values
of these exogenous variables in the argument exogenous_forecast of the
forecast.PosteriorBVARPANEL function.
Truncated forecasts for variables of type 'rate'.
The package provides the option to truncate the forecasts for variables of
for which the corresponding element of argument type of the function
specify_bvarPANEL$new() is set to "rate". The one-period-ahead
predictive normal density for such variables is truncated to values from
interval .
A list of class ForecastsPANEL with C elements containing
the draws from the country-specific predictive density and data in a form of
object class Forecasts that includes:
an NxhorizonxS array with the draws from the
country-specific predictive density
an NxhorizonxS array with the mean of the
country-specific predictive density
an NxNxhorizonxS array with the covariance of the
country-specific predictive density
a T_cxN matrix with the country-specific data
Tomasz Woźniak [email protected]
Waggoner, D. F., & Zha, T. (1999) Conditional forecasts in dynamic multivariate models, Review of Economics and Statistics, 81(4), 639-651, doi:10.1162/003465399558508.
specify_bvarGroupPANEL, estimate.PosteriorBVARGROUPPANEL,
summary.ForecastsPANEL, plot.ForecastsPANEL
# specify the model specification = specify_bvarGroupPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_incomegroup[1:5] ) burn_in = estimate(specification, 5) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 5) # estimate the model; use say S = 10000 # forecast 3 years ahead predictive = forecast( posterior, horizon = 3, exogenous_forecast = ilo_exogenous_forecasts[1:5] )# specify the model specification = specify_bvarGroupPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_incomegroup[1:5] ) burn_in = estimate(specification, 5) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 5) # estimate the model; use say S = 10000 # forecast 3 years ahead predictive = forecast( posterior, horizon = 3, exogenous_forecast = ilo_exogenous_forecasts[1:5] )
Samples from the joint predictive density of the dependent
variables for all countries at forecast horizons
from 1 to horizon specified as an argument of the function.
Also implements conditional forecasting based on the provided projections
for some of the variables.
## S3 method for class 'PosteriorBVARGROUPPRIORPANEL' forecast( object, horizon = 1, exogenous_forecast = NULL, conditional_forecast = NULL, ... )## S3 method for class 'PosteriorBVARGROUPPRIORPANEL' forecast( object, horizon = 1, exogenous_forecast = NULL, conditional_forecast = NULL, ... )
object |
posterior estimation outcome - an object of class
|
horizon |
a positive integer, specifying the forecasting horizon. |
exogenous_forecast |
not used here ATM; included for compatibility with
generic |
conditional_forecast |
a list of length |
... |
not used |
The package provides a range of options regarding the forecasting procedure. They are dependent on the model and forecast specifications and include Bayesian forecasting many periods ahead, conditional forecasting, and forecasting for models with exogenous variables.
One-period-ahead predictive density.
The model assumptions provided in the documentation for bpvars
determine the country-specific one-period ahead conditional predictive density
for the unknown vector given the data available at
time and the parameters of the model. It is multivariate normal with
the mean and the covariance matrix
where includes the lagged
values of , the constant term, and, potentially,
exogenous variables if they were specified by the user.
Bayesian predictive density.
The one-period ahead predictive density is used to sample from the joint
predictive density of the unknown future values. This predictive density is
defined as a joint density of at horizons
, where corresponds to the value of argument
horizon, given the data available at time :
Therefore, the Bayesian forecast does not depend on the parameter values as the parameters are integrated out with respect to their posterior distribution. Consequently, Bayesian forecasts incorporate the uncertainty with respect to estimation. Sampling from the density is facilitated using the draws from the posterior density and sequential sampling from the one-period ahead predictive density.
Conditional forecasting of some of the variables given the future values of the remaining variables is implemented following Waggoner and Zha (1999) and is based on the conditional normal density given the future projections of some of the variables created basing on the one-period ahead predictive density.
Exogenous variables.
Forecasting with models for which specification argument
exogenous_variables was specified required providing the future values
of these exogenous variables in the argument exogenous_forecast of the
forecast.PosteriorBVARPANEL function.
Truncated forecasts for variables of type 'rate'.
The package provides the option to truncate the forecasts for variables of
for which the corresponding element of argument type of the function
specify_bvarPANEL$new() is set to "rate". The one-period-ahead
predictive normal density for such variables is truncated to values from
interval .
A list of class ForecastsPANEL with C elements containing
the draws from the country-specific predictive density and data in a form of
object class Forecasts that includes:
an NxhorizonxS array with the draws from the
country-specific predictive density
an NxhorizonxS array with the mean of the
country-specific predictive density
an NxNxhorizonxS array with the covariance of the
country-specific predictive density
a T_cxN matrix with the country-specific data
Tomasz Woźniak [email protected]
Waggoner, D. F., & Zha, T. (1999) Conditional forecasts in dynamic multivariate models, Review of Economics and Statistics, 81(4), 639-651, doi:10.1162/003465399558508.
specify_bvarGroupPriorPANEL, estimate.PosteriorBVARGROUPPRIORPANEL,
summary.ForecastsPANEL, plot.ForecastsPANEL
# specify the model specification = specify_bvarGroupPriorPANEL$new( ilo_dynamic_panel[1:5], group_allocation = country_grouping_incomegroup[1:5] ) burn_in = estimate(specification, 5) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 5) # estimate the model; use say S = 10000 # forecast 3 years ahead predictive = forecast(posterior, horizon = 3)# specify the model specification = specify_bvarGroupPriorPANEL$new( ilo_dynamic_panel[1:5], group_allocation = country_grouping_incomegroup[1:5] ) burn_in = estimate(specification, 5) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 5) # estimate the model; use say S = 10000 # forecast 3 years ahead predictive = forecast(posterior, horizon = 3)
Samples from the joint predictive density of the dependent
variables for all countries at forecast horizons
from 1 to horizon specified as an argument of the function.
Also implements conditional forecasting based on the provided projections
for some of the variables.
## S3 method for class 'PosteriorBVARPANEL' forecast( object, horizon = 1, exogenous_forecast = NULL, conditional_forecast = NULL, ... )## S3 method for class 'PosteriorBVARPANEL' forecast( object, horizon = 1, exogenous_forecast = NULL, conditional_forecast = NULL, ... )
object |
posterior estimation outcome - an object of class
|
horizon |
a positive integer, specifying the forecasting horizon. |
exogenous_forecast |
not used here ATM; included for compatibility with
generic |
conditional_forecast |
a list of length |
... |
not used |
The package provides a range of options regarding the forecasting procedure. They are dependent on the model and forecast specifications and include Bayesian forecasting many periods ahead, conditional forecasting, and forecasting for models with exogenous variables.
One-period-ahead predictive density.
The model assumptions provided in the documentation for bpvars
determine the country-specific one-period ahead conditional predictive density
for the unknown vector given the data available at
time and the parameters of the model. It is multivariate normal with
the mean and the covariance matrix
where includes the lagged
values of , the constant term, and, potentially,
exogenous variables if they were specified by the user.
Bayesian predictive density.
The one-period ahead predictive density is used to sample from the joint
predictive density of the unknown future values. This predictive density is
defined as a joint density of at horizons
, where corresponds to the value of argument
horizon, given the data available at time :
Therefore, the Bayesian forecast does not depend on the parameter values as the parameters are integrated out with respect to their posterior distribution. Consequently, Bayesian forecasts incorporate the uncertainty with respect to estimation. Sampling from the density is facilitated using the draws from the posterior density and sequential sampling from the one-period ahead predictive density.
Conditional forecasting of some of the variables given the future values of the remaining variables is implemented following Waggoner and Zha (1999) and is based on the conditional normal density given the future projections of some of the variables created basing on the one-period ahead predictive density.
Exogenous variables.
Forecasting with models for which specification argument
exogenous_variables was specified required providing the future values
of these exogenous variables in the argument exogenous_forecast of the
forecast.PosteriorBVARPANEL function.
Truncated forecasts for variables of type 'rate'.
The package provides the option to truncate the forecasts for variables of
for which the corresponding element of argument type of the function
specify_bvarPANEL$new() is set to "rate". The one-period-ahead
predictive normal density for such variables is truncated to values from
interval .
A list of class ForecastsPANEL with C elements containing
the draws from the country-specific predictive density and data in a form of
object class Forecasts that includes:
an NxhorizonxS array with the draws from the
country-specific predictive density
an NxhorizonxS array with the mean of the
country-specific predictive density
an NxNxhorizonxS array with the covariance of the
country-specific predictive density
a T_cxN matrix with the country-specific data
Tomasz Woźniak [email protected]
Waggoner, D. F., & Zha, T. (1999) Conditional forecasts in dynamic multivariate models, Review of Economics and Statistics, 81(4), 639-651, doi:10.1162/003465399558508.
specify_bvarPANEL, estimate.PosteriorBVARPANEL,
summary.ForecastsPANEL, plot.ForecastsPANEL
# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 5) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 5) # estimate the model; use say S = 10000 # forecast 3 years ahead predictive = forecast(posterior, 3, exogenous_forecast = ilo_exogenous_forecasts[1:5])# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 5) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 5) # estimate the model; use say S = 10000 # forecast 3 years ahead predictive = forecast(posterior, 3, exogenous_forecast = ilo_exogenous_forecasts[1:5])
Samples from the joint predictive density of the dependent
variables for all countries at forecast horizons
from 1 to horizon specified as an argument of the function.
Also implements conditional forecasting based on the provided projections
for some of the variables.
## S3 method for class 'PosteriorBVARs' forecast( object, horizon = 1, exogenous_forecast = NULL, conditional_forecast = NULL, ... )## S3 method for class 'PosteriorBVARs' forecast( object, horizon = 1, exogenous_forecast = NULL, conditional_forecast = NULL, ... )
object |
posterior estimation outcome - an object of class
|
horizon |
a positive integer, specifying the forecasting horizon. |
exogenous_forecast |
not used here ATM; included for compatibility with
generic |
conditional_forecast |
a list of length |
... |
not used |
The package provides a range of options regarding the forecasting procedure. They are dependent on the model and forecast specifications and include Bayesian forecasting many periods ahead, conditional forecasting, and forecasting for models with exogenous variables.
One-period-ahead predictive density.
The model assumptions provided in the documentation for bpvars
determine the country-specific one-period ahead conditional predictive density
for the unknown vector given the data available at
time and the parameters of the model. It is multivariate normal with
the mean and the covariance matrix
where includes the lagged
values of , the constant term, and, potentially,
exogenous variables if they were specified by the user.
Bayesian predictive density.
The one-period ahead predictive density is used to sample from the joint
predictive density of the unknown future values. This predictive density is
defined as a joint density of at horizons
, where corresponds to the value of argument
horizon, given the data available at time :
Therefore, the Bayesian forecast does not depend on the parameter values as the parameters are integrated out with respect to their posterior distribution. Consequently, Bayesian forecasts incorporate the uncertainty with respect to estimation. Sampling from the density is facilitated using the draws from the posterior density and sequential sampling from the one-period ahead predictive density.
Conditional forecasting of some of the variables given the future values of the remaining variables is implemented following Waggoner and Zha (1999) and is based on the conditional normal density given the future projections of some of the variables created basing on the one-period ahead predictive density.
Exogenous variables.
Forecasting with models for which specification argument
exogenous_variables was specified required providing the future values
of these exogenous variables in the argument exogenous_forecast of the
forecast.PosteriorBVARPANEL function.
Truncated forecasts for variables of type 'rate'.
The package provides the option to truncate the forecasts for variables of
for which the corresponding element of argument type of the function
specify_bvarPANEL$new() is set to "rate". The one-period-ahead
predictive normal density for such variables is truncated to values from
interval .
A list of class ForecastsPANEL with C elements containing
the draws from the country-specific predictive density and data in a form of
object class Forecasts that includes:
an NxhorizonxS array with the draws from the
country-specific predictive density
an NxhorizonxS array with the mean of the
country-specific predictive density
an NxNxhorizonxS array with the covariance of the
country-specific predictive density
a T_cxN matrix with the country-specific data
Tomasz Woźniak [email protected]
Waggoner, D. F., & Zha, T. (1999) Conditional forecasts in dynamic multivariate models, Review of Economics and Statistics, 81(4), 639-651, doi:10.1162/003465399558508.
specify_bvars, estimate.PosteriorBVARs,
summary.ForecastsPANEL, plot.ForecastsPANEL
# specify the model specification = specify_bvars$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 5) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 5) # estimate the model; use say S = 10000 # forecast 3 years ahead predictive = forecast(posterior, 3, exogenous_forecast = ilo_exogenous_forecasts[1:5])# specify the model specification = specify_bvars$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5] ) burn_in = estimate(specification, 5) # run the burn-in; use say S = 10000 posterior = estimate(burn_in, 5) # estimate the model; use say S = 10000 # forecast 3 years ahead predictive = forecast(posterior, 3, exogenous_forecast = ilo_exogenous_forecasts[1:5])
For each of the countries a time series of 3 observations on
the future values of gdp is provided. These future values are taken from
IMF projections. The future values of other variables are set to NA.
Last data update was implemented on 2026-04-18.
data(ilo_conditional_forecasts)data(ilo_conditional_forecasts)
A list of 189 ts objects with time series of 3 observations
on 4 variables:
logarithm of gross domestic product
annual unemployment rate
annual employment rate
annual labour force participation rate
data(ilo_conditional_forecasts) # upload the datadata(ilo_conditional_forecasts) # upload the data
For each of the countries a time series of 34 observations on 4 variables including the logarithm of Gross Domestic Product (gdp), as well as the labour market outcomes including the unemployment rate (UR), employment rate (EPR), labour force participation rate (LFPR). The missing observations are filled using imputation method. Last data update was implemented on 2026-04-18.
data(ilo_dynamic_panel)data(ilo_dynamic_panel)
A list of 189 ts objects with time series of 34 observations
on 4 variables:
logarithm of gross domestic product
annual unemployment rate
annual employment rate
annual labour force participation rate
International Labour Organization. (2020). ILO modelled estimates database, ILOSTAT [database]. Available from https://ilostat.ilo.org/data/.
data(ilo_dynamic_panel) # upload the datadata(ilo_dynamic_panel) # upload the data
For each of the countries a time series of observations on 4 variables including the logarithm of Gross Domestic Product (gdp), as well as the labour market outcomes including the unemployment rate (UR), employment rate (EPR), labour force participation rate (LFPR). The series are of various lengths and contain missing values due to data availability. Last data update was implemented on 2026-04-20.
data(ilo_dynamic_panel_missing)data(ilo_dynamic_panel_missing)
A list of 189 ts objects with time series on 4 variables:
logarithm of gross domestic product
annual unemployment rate
annual employment rate
annual labour force participation rate
International Labour Organization. (2020). ILO modelled estimates database, ILOSTAT [database]. Available from https://ilostat.ilo.org/data/.
data(ilo_dynamic_panel_missing) # upload the datadata(ilo_dynamic_panel_missing) # upload the data
ilo_exogenous_variables
For each of the countries a time series of 3 observations on
On the dummies is provided. These future values are all equal to zero. They
provide benchmark for the objects to be used when exogenous_variables
are used.
Last data update was implemented on 2026-04-18.
data(ilo_exogenous_forecasts)data(ilo_exogenous_forecasts)
A list of 189 ts objects with time series of 3 observations
on 3 variables:
the aftermath of the Global Financial Crisis
the COVID pandemic
the aftermath of the COVID pandemic
data(ilo_exogenous_forecasts) # upload the datadata(ilo_exogenous_forecasts) # upload the data
For each of the countries a time series of 33 observations on 3 dummy variables for the years 2008, 2020, and 2021 is provided. Last data update was implemented on 2026-04-18.
data(ilo_exogenous_variables)data(ilo_exogenous_variables)
A list of 189 ts objects with time series of 34 observations
on 3 variables:
the aftermath of the Global Financial Crisis
the COVID pandemic
the aftermath of the COVID pandemic
data(ilo_exogenous_variables) # upload the datadata(ilo_exogenous_variables) # upload the data
ilo_dynamic_panel_missing
For each of the countries a time series of observations on 3 dummy variables for the years 2008, 2020, and 2021 is provided. Last data update was implemented on 2026-04-20.
data(ilo_exogenous_variables_missing)data(ilo_exogenous_variables_missing)
A list of 189 ts objects with time series on 3 variables:
the aftermath of the Global Financial Crisis
the COVID pandemic
the aftermath of the COVID pandemic
data(ilo_exogenous_variables_missing) # upload the datadata(ilo_exogenous_variables_missing) # upload the data
Plots of fitted values of dependent variables including their median and percentiles.
## S3 method for class 'ForecastsPANEL' plot( x, which_c, probability = 0.9, data_in_plot = 1, col = "#1614B1", main, xlab, mar.multi = c(1, 4.6, 0, 2.1), oma.multi = c(6, 0, 5, 0), ... )## S3 method for class 'ForecastsPANEL' plot( x, which_c, probability = 0.9, data_in_plot = 1, col = "#1614B1", main, xlab, mar.multi = c(1, 4.6, 0, 2.1), oma.multi = c(6, 0, 5, 0), ... )
x |
an object of class |
which_c |
a positive integer or a character string specifying the country for which the forecast should be plotted. |
probability |
a parameter determining the interval to be plotted. The
interval stretches from the |
data_in_plot |
a fraction value in the range (0, 1) determining how many of the last observations in the data should be plotted with the forecasts. |
col |
a colour of the plot line and the ribbon |
main |
an alternative main title for the plot |
xlab |
an alternative x-axis label for the plot |
mar.multi |
the default |
oma.multi |
the default |
... |
additional arguments affecting the summary produced. |
Tomasz Woźniak [email protected]
specification = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model burn_in = estimate(specification, 10) # run the burn-in posterior = estimate(burn_in, 10) # estimate the model # forecast 6 years ahead predictive = forecast(posterior, 6) plot(predictive, which_c = "ARG") # plot forecastsspecification = specify_bvarPANEL$new(ilo_dynamic_panel[1:5]) # specify the model burn_in = estimate(specification, 10) # run the burn-in posterior = estimate(burn_in, 10) # estimate the model # forecast 6 years ahead predictive = forecast(posterior, 6) plot(predictive, which_c = "ARG") # plot forecasts
Plots of the posterior means of the forecast error variance decompositions.
## S3 method for class 'PosteriorFEVDPANEL' plot( x, which_c, cols, main, xlab, mar.multi = c(1, 4.6, 0, 4.6), oma.multi = c(6, 0, 5, 0), ... )## S3 method for class 'PosteriorFEVDPANEL' plot( x, which_c, cols, main, xlab, mar.multi = c(1, 4.6, 0, 4.6), oma.multi = c(6, 0, 5, 0), ... )
x |
an object of class |
which_c |
a positive integer or a character string specifying the country for which the forecast should be plotted. |
cols |
an |
main |
an alternative main title for the plot |
xlab |
an alternative x-axis label for the plot |
mar.multi |
the default |
oma.multi |
the default |
... |
additional arguments affecting the summary produced. |
Tomasz Woźniak [email protected]
set.seed(123) specification = specify_bvarPANEL$new(ilo_dynamic_panel[1:5])
# run the burn-in burn_in = estimate(specification, 10)
# estimate the model posterior = estimate(burn_in, 20)
# compute forecast error variance decomposition 4 years ahead fevd = compute_variance_decompositions(posterior, horizon = 4) plot(fevd, which_c = "ARG")
compute_variance_decompositions.PosteriorBVARPANEL
The class BVARGROUPPANEL presents complete specification for the Bayesian Panel
Vector Autoregression with county groups. The groups can be pre-specified,
which requires the argument group_allocation to be provided, or estimated,
which requires the argument G for the number of groups to be provided
and the argument group_allocation to be left empty.
bpvars::BVARPANEL -> BVARGROUPPANEL
pa non-negative integer specifying the autoregressive lag order of the model.
Ga non-negative integer specifying the number of country groupings.
estimate_groupsa logical value denoting whether the groups are to be estimated.
prioran object PriorBSVAR with the prior specification.
data_matricesan object DataMatricesBVARPANEL with the data matrices.
starting_valuesan object StartingValuesBVARGROUPPANEL with the starting values.
adaptiveMHa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
new()
Create a new specification of the Bayesian Panel VAR model with country
grouping BVARGROUPPANEL. The groups can be pre-specified,
which requires the argument group_allocation to be provided, or estimated,
which requires the argument G for the number of groups to be provided
and the argument group_allocation to be left empty.
specify_bvarGroupPANEL$new(
data,
p = 1L,
exogenous = NULL,
stationary = rep(FALSE, ncol(data[[1]])),
type = rep("real", ncol(data[[1]])),
G = NULL,
group_allocation = NULL
)dataa list with C elements of (T_c+p)xN matrices
with time series data.
pa positive integer providing model's autoregressive lag order.
exogenousa (T+p)xd matrix of exogenous variables.
stationaryan N logical vector - its element set to
FALSE sets the prior mean for the autoregressive parameters of the
Nth equation to the white noise process, otherwise to random walk.
typean N character vector with elements set to "rate" or "real"
determining the truncation of the predictive density to [0, 100] and
(-Inf, Inf) (no truncation) for each of the variables.
Ga positive integer specifying the number of country groups. Its
specification is required if group_allocation is not provided and
the country groups to be estimated.
group_allocationan argument that can be provided as a numeric vector with integer numbers denoting group allocations to pre-specify the the country groups, in which case they are not estimated, or left empty if the country groups are to be estimated.
A new complete specification for the Bayesian Panel VAR model BVARPANEL.
set_global2pooled()
Sets the prior mean of the global autoregressive parameters to the OLS pooled panel estimator following Zellner, Hong (1989).
specify_bvarGroupPANEL$set_global2pooled(x)
xa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
spec = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], G = 2 ) spec$set_global2pooled()
clone()
The objects of this class are cloneable with this method.
specify_bvarGroupPANEL$clone(deep = FALSE)
deepWhether to make a deep clone.
Zellner, Hong (1989). Forecasting international growth rates using Bayesian shrinkage and other procedures. Journal of Econometrics, 40(1), 183–202, doi:10.1016/0304-4076(89)90036-5.
spec = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], G = 2 ) ## ------------------------------------------------ ## Method `specify_bvarGroupPANEL$set_global2pooled` ## ------------------------------------------------ spec = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], G = 2 ) spec$set_global2pooled()spec = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], G = 2 ) ## ------------------------------------------------ ## Method `specify_bvarGroupPANEL$set_global2pooled` ## ------------------------------------------------ spec = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], G = 2 ) spec$set_global2pooled()
The class BVARGROUPPRIORPANEL presents complete specification for the Bayesian Panel
Vector Autoregression with county grouping for global prior parameters. The groups can be pre-specified,
which requires the argument group_allocation to be provided, or estimated,
which requires the argument G for the number of groups to be provided
and the argument group_allocation to be left empty.
pa non-negative integer specifying the autoregressive lag order of the model.
Ga non-negative integer specifying the number of country groupings.
estimate_groupsa logical value denoting whether the groups are to be estimated.
prioran object PriorBSVAR with the prior specification.
data_matricesan object DataMatricesBVARPANEL with the data matrices.
starting_valuesan object StartingValuesBVARGROUPPRIORPANEL with the starting values.
adaptiveMHa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
new()
Create a new specification of the Bayesian Panel VAR model with country
grouping for global prior parameters BVARGROUPPRIORPANEL. The groups can be pre-specified,
which requires the argument group_allocation to be provided, or estimated,
which requires the argument G for the number of groups to be provided
and the argument group_allocation to be left empty.
specify_bvarGroupPriorPANEL$new(
data,
p = 1L,
exogenous = NULL,
stationary = rep(FALSE, ncol(data[[1]])),
type = rep("real", ncol(data[[1]])),
G = NULL,
group_allocation = NULL
)dataa list with C elements of (T_c+p)xN matrices
with time series data.
pa positive integer providing model's autoregressive lag order.
exogenousa (T+p)xd matrix of exogenous variables.
stationaryan N logical vector - its element set to
FALSE sets the prior mean for the autoregressive parameters of the
Nth equation to the white noise process, otherwise to random walk.
typean N character vector with elements set to "rate" or "real"
determining the truncation of the predictive density to [0, 100] and
(-Inf, Inf) (no truncation) for each of the variables.
Ga positive integer specifying the number of country groups. Its
specification is required if group_allocation is not provided and
the country groups to be estimated.
group_allocationan argument that can be provided as a numeric vector with integer numbers denoting group allocations to pre-specify the the country groups, in which case they are not estimated, or left empty if the country groups are to be estimated.
A new complete specification for the Bayesian Panel VAR model BVARPANEL.
get_data_matrices()
Returns the data matrices as the DataMatricesBVARPANEL object.
specify_bvarGroupPriorPANEL$get_data_matrices()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_data_matrices()
get_prior()
Returns the prior specification as the PriorBVARPANEL object.
specify_bvarGroupPriorPANEL$get_prior()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_prior()
get_starting_values()
Returns the starting values as the StartingValuesBVARPANEL object.
specify_bvarGroupPriorPANEL$get_starting_values()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_starting_values()
get_type()
Returns the type of the model.
specify_bvarGroupPriorPANEL$get_type()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_type()
set_global2pooled()
Sets the prior mean of the global autoregressive parameters to the OLS pooled panel estimator following Zellner, Hong (1989).
specify_bvarGroupPriorPANEL$set_global2pooled(x)
xa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_global2pooled()
set_adaptiveMH()
Sets the parameters of adaptive Metropolis-Hastings sampler for the parameter nu.
specify_bvarGroupPriorPANEL$set_adaptiveMH(x)
xa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) spec$set_adaptiveMH(c(0.6, 0.4, 10, 0.1))
clone()
The objects of this class are cloneable with this method.
specify_bvarGroupPriorPANEL$clone(deep = FALSE)
deepWhether to make a deep clone.
Zellner, Hong (1989). Forecasting international growth rates using Bayesian shrinkage and other procedures. Journal of Econometrics, 40(1), 183–202, doi:10.1016/0304-4076(89)90036-5.
spec = specify_bvarGroupPriorPANEL$new( data = ilo_dynamic_panel, G = 2 ) ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$get_data_matrices` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_data_matrices() ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$get_prior` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_prior() ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$get_starting_values` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_starting_values() ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$get_type` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_type() ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$set_global2pooled` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_global2pooled() ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$set_adaptiveMH` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) spec$set_adaptiveMH(c(0.6, 0.4, 10, 0.1))spec = specify_bvarGroupPriorPANEL$new( data = ilo_dynamic_panel, G = 2 ) ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$get_data_matrices` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_data_matrices() ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$get_prior` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_prior() ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$get_starting_values` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_starting_values() ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$get_type` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_type() ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$set_global2pooled` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_global2pooled() ## ------------------------------------------------ ## Method `specify_bvarGroupPriorPANEL$set_adaptiveMH` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) spec$set_adaptiveMH(c(0.6, 0.4, 10, 0.1))
The class BVARPANEL presents complete specification for the Bayesian Panel Vector Autoregression.
pa non-negative integer specifying the autoregressive lag order of the model.
prioran object PriorBSVAR with the prior specification.
data_matricesan object DataMatricesBVARPANEL with the data matrices.
starting_valuesan object StartingValuesBVARPANEL with the starting values.
adaptiveMHa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
new()
Create a new specification of the Bayesian Panel VAR model BVARPANEL.
specify_bvarPANEL$new(
data,
p = 1L,
exogenous = NULL,
stationary = rep(FALSE, ncol(data[[1]])),
type = rep("real", ncol(data[[1]]))
)dataa list with C elements of (T_c+p)xN matrices
with time series data.
pa positive integer providing model's autoregressive lag order.
exogenousa (T+p)xd matrix of exogenous variables.
stationaryan N logical vector - its element set to
FALSE sets the prior mean for the autoregressive parameters of the
Nth equation to the white noise process, otherwise to random walk.
typean N character vector with elements set to "rate" or "real"
determining the truncation of the predictive density to [0, 100] and
(-Inf, Inf) (no truncation) for each of the variables.
A new complete specification for the Bayesian Panel VAR model BVARPANEL.
set_to_Jarocinski()
Sets the model in line with the specification by Jarocinski (2010) as presented by Dieppe, Legrand, Roye (2016).
specify_bvarPANEL$set_to_Jarocinski()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_to_Jarocinski()
get_data_matrices()
Returns the data matrices as the DataMatricesBVARPANEL object.
specify_bvarPANEL$get_data_matrices()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_data_matrices()
get_prior()
Returns the prior specification as the PriorBVARPANEL object.
specify_bvarPANEL$get_prior()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_prior()
get_starting_values()
Returns the starting values as the StartingValuesBVARPANEL object.
specify_bvarPANEL$get_starting_values()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_starting_values()
get_type()
Returns the type of the model.
specify_bvarPANEL$get_type()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_type()
set_global2pooled()
Sets the prior mean of the global autoregressive parameters to the OLS pooled panel estimator following Zellner, Hong (1989).
specify_bvarPANEL$set_global2pooled(x)
xa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_global2pooled()
set_adaptiveMH()
Sets the parameters of adaptive Metropolis-Hastings sampler for the parameter nu.
specify_bvarPANEL$set_adaptiveMH(x)
xa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_adaptiveMH(c(0.6, 0.4, 10, 0.1))
clone()
The objects of this class are cloneable with this method.
specify_bvarPANEL$clone(deep = FALSE)
deepWhether to make a deep clone.
Jarocinski (2010). Responses to monetary policy shocks in the east and the west of Europe: a comparison. Journal of Applied Econometrics, 25(5), 833-868, doi:10.1002/jae.1082.
Dieppe, Legrand, Roye (2016). The BEAR toolbox, ECB Working Papers, 1934, doi:10.2866/292952.
Zellner, Hong (1989). Forecasting international growth rates using Bayesian shrinkage and other procedures. Journal of Econometrics, 40(1), 183–202, doi:10.1016/0304-4076(89)90036-5.
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) ## ------------------------------------------------ ## Method `specify_bvarPANEL$set_to_Jarocinski` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_to_Jarocinski() ## ------------------------------------------------ ## Method `specify_bvarPANEL$get_data_matrices` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_data_matrices() ## ------------------------------------------------ ## Method `specify_bvarPANEL$get_prior` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_prior() ## ------------------------------------------------ ## Method `specify_bvarPANEL$get_starting_values` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_starting_values() ## ------------------------------------------------ ## Method `specify_bvarPANEL$get_type` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_type() ## ------------------------------------------------ ## Method `specify_bvarPANEL$set_global2pooled` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_global2pooled() ## ------------------------------------------------ ## Method `specify_bvarPANEL$set_adaptiveMH` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_adaptiveMH(c(0.6, 0.4, 10, 0.1))spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) ## ------------------------------------------------ ## Method `specify_bvarPANEL$set_to_Jarocinski` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_to_Jarocinski() ## ------------------------------------------------ ## Method `specify_bvarPANEL$get_data_matrices` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_data_matrices() ## ------------------------------------------------ ## Method `specify_bvarPANEL$get_prior` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_prior() ## ------------------------------------------------ ## Method `specify_bvarPANEL$get_starting_values` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_starting_values() ## ------------------------------------------------ ## Method `specify_bvarPANEL$get_type` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_type() ## ------------------------------------------------ ## Method `specify_bvarPANEL$set_global2pooled` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_global2pooled() ## ------------------------------------------------ ## Method `specify_bvarPANEL$set_adaptiveMH` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_adaptiveMH(c(0.6, 0.4, 10, 0.1))
The class BVARs presents complete specification for the Bayesian Vector Autoregressions for cubic data.
pa non-negative integer specifying the autoregressive lag order of the model.
prioran object PriorBSVAR with the prior specification.
data_matricesan object DataMatricesBVARPANEL with the data matrices.
starting_valuesan object StartingValuesBVARPANEL with the starting values.
adaptiveMHa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
new()
Create a new specification of the Bayesian Panel VAR model BVARPANEL.
specify_bvars$new(
data,
p = 1L,
exogenous = NULL,
stationary = rep(FALSE, ncol(data[[1]])),
type = rep("real", ncol(data[[1]]))
)dataa list with C elements of (T_c+p)xN matrices
with time series data.
pa positive integer providing model's autoregressive lag order.
exogenousa (T+p)xd matrix of exogenous variables.
stationaryan N logical vector - its element set to
FALSE sets the prior mean for the autoregressive parameters of the
Nth equation to the white noise process, otherwise to random walk.
typean N character vector with elements set to "rate" or "real"
determining the truncation of the predictive density to [0, 100] and
(-Inf, Inf) (no truncation) for each of the variables.
A new complete specification for the Bayesian Panel VAR model BVARPANEL.
get_data_matrices()
Returns the data matrices as the DataMatricesBVARPANEL object.
specify_bvars$get_data_matrices()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_data_matrices()
get_prior()
Returns the prior specification as the PriorBVARPANEL object.
specify_bvars$get_prior()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_prior()
get_starting_values()
Returns the starting values as the StartingValuesBVARPANEL object.
specify_bvars$get_starting_values()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_starting_values()
get_type()
Returns the type of the model.
specify_bvars$get_type()
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_type()
set_prior2objective()
Sets the VAR model priors to objective prior by Zellner (1972).
specify_bvars$set_prior2objective()
spec = specify_bvars$new( data = ilo_dynamic_panel ) spec$set_prior2objective()
set_global2pooled()
Sets the prior mean of the global autoregressive parameters to the OLS pooled panel estimator following Zellner, Hong (1989).
specify_bvars$set_global2pooled(x)
xa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_global2pooled()
set_adaptiveMH()
Sets the parameters of adaptive Metropolis-Hastings sampler for the parameter nu.
specify_bvars$set_adaptiveMH(x)
xa vector of four values setting the adaptive MH sampler for nu: adaptive rate, target acceptance rate, the iteration at which to start adapting, the initial scaling rate
spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_adaptiveMH(c(0.6, 0.4, 10, 0.1))
clone()
The objects of this class are cloneable with this method.
specify_bvars$clone(deep = FALSE)
deepWhether to make a deep clone.
Zellner (1971). An Introduction to Bayesian Inference in Econometrics. John Wiley & Sons.
Zellner, Hong (1989). Forecasting international growth rates using Bayesian shrinkage and other procedures. Journal of Econometrics, 40(1), 183–202, doi:10.1016/0304-4076(89)90036-5.
spec = specify_bvars$new( data = ilo_dynamic_panel ) ## ------------------------------------------------ ## Method `specify_bvars$get_data_matrices` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_data_matrices() ## ------------------------------------------------ ## Method `specify_bvars$get_prior` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_prior() ## ------------------------------------------------ ## Method `specify_bvars$get_starting_values` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_starting_values() ## ------------------------------------------------ ## Method `specify_bvars$get_type` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_type() ## ------------------------------------------------ ## Method `specify_bvars$set_prior2objective` ## ------------------------------------------------ spec = specify_bvars$new( data = ilo_dynamic_panel ) spec$set_prior2objective() ## ------------------------------------------------ ## Method `specify_bvars$set_global2pooled` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_global2pooled() ## ------------------------------------------------ ## Method `specify_bvars$set_adaptiveMH` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_adaptiveMH(c(0.6, 0.4, 10, 0.1))spec = specify_bvars$new( data = ilo_dynamic_panel ) ## ------------------------------------------------ ## Method `specify_bvars$get_data_matrices` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_data_matrices() ## ------------------------------------------------ ## Method `specify_bvars$get_prior` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_prior() ## ------------------------------------------------ ## Method `specify_bvars$get_starting_values` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_starting_values() ## ------------------------------------------------ ## Method `specify_bvars$get_type` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$get_type() ## ------------------------------------------------ ## Method `specify_bvars$set_prior2objective` ## ------------------------------------------------ spec = specify_bvars$new( data = ilo_dynamic_panel ) spec$set_prior2objective() ## ------------------------------------------------ ## Method `specify_bvars$set_global2pooled` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_global2pooled() ## ------------------------------------------------ ## Method `specify_bvars$set_adaptiveMH` ## ------------------------------------------------ spec = specify_bvarPANEL$new( data = ilo_dynamic_panel ) spec$set_adaptiveMH(c(0.6, 0.4, 10, 0.1))
The class DataMatricesBVARPANEL presents the data matrices of dependent
variables, , and regressors, , for the
Bayesian Panel VAR model for all countries .
Ya list with C elements with (T_c + p) x N matrices
of dependent variables, , possibly with missing
observations given by NA.
missinga list with C elements with T_c x N matrices
containing value 1 for missing observation and 0 otherwise.
typean N character vector with elements set to "rate" or "real"
determining the truncation of the predictive density to [0, 100] and
(-Inf, Inf) (no truncation) for each of the variables.
exogenousa list with C elements with (T_c + p) x N
matrices of exogenous variables.
new()
Create new data matrices DataMatricesBVARPANEL
specify_panel_data_matrices$new(
data,
p = 1L,
exogenous = NULL,
type = rep("real", ncol(data[[1]]))
)dataa list containing (T_c+p)xN matrices with country-specific
time series data.
pa positive integer providing model's autoregressive lag order.
exogenousa list containing (T_c+p)xd matrices with
country-specific of exogenous variables. This matrix should not include a
constant term.
typean N character vector with elements set to "rate" or "real"
determining the truncation of the predictive density to [0, 100] and
(-Inf, Inf) (no truncation) for each of the variables.
New data matrices DataMatricesBVARPANEL
get_data_matrices()
Returns the data matrices DataMatricesBVARPANEL as a list.
specify_panel_data_matrices$get_data_matrices()
data(ilo_dynamic_panel) YX = specify_panel_data_matrices$new(ilo_dynamic_panel) YX$get_data_matrices()
clone()
The objects of this class are cloneable with this method.
specify_panel_data_matrices$clone(deep = FALSE)
deepWhether to make a deep clone.
data(ilo_dynamic_panel) YX = specify_panel_data_matrices$new(data = ilo_dynamic_panel, p = 4) length(YX$Y); names(YX$Y) ## ------------------------------------------------ ## Method `specify_panel_data_matrices$get_data_matrices` ## ------------------------------------------------ data(ilo_dynamic_panel) YX = specify_panel_data_matrices$new(ilo_dynamic_panel) YX$get_data_matrices()data(ilo_dynamic_panel) YX = specify_panel_data_matrices$new(data = ilo_dynamic_panel, p = 4) length(YX$Y); names(YX$Y) ## ------------------------------------------------ ## Method `specify_panel_data_matrices$get_data_matrices` ## ------------------------------------------------ data(ilo_dynamic_panel) YX = specify_panel_data_matrices$new(ilo_dynamic_panel) YX$get_data_matrices()
The class POOSForecastSetup presents the specification of the
recursive pseudo-out-of-sample forecasting exercise using expanding window
samples.
Sa positive integer number - the number of MCMC draws from the posterior distribution in the estimation for each forecasts
S_burna positive integer number - the number of MCMC draws from to achieve convergence in the estimation for each forecasts
horizonsa vector with positive integer numbers - the forecast horizons used in the forecast performance evaluation
training_samplea positive integer number - the number of of the first observations to be used in the estimation for the first forecast
new()
Create a new specification POOSForecastSetup of the
recursive pseudo-out-of-sample forecasting exercise using expanding window
samples.
specify_poosf_exercise$new( spec, S, S_burn, horizons = 1L, training_sample = 1L )
speca model specification object of class BVARPANEL or
BVARGROUPPANEL.
Sa positive integer - number of draws from the posterior distribution for model estimation for each of the forecasts
S_burna positive integer - number of draws from the posterior distribution to obtain convergence for model estimation for each of the forecasts
horizonsa vector with positive integers - forecast horizons at which forecasting performance is to be verified
training_samplea positive integer - the number of the first observations to be used for estimation for the first forecast. The number of observations to be used for remaining forecasts increases recursively by one for each forecast.
A new specification POOSForecastSetup of the
recursive pseudo-out-of-sample forecasting exercise using expanding window
samples.
spec = specify_bvarPANEL$new(ilo_dynamic_panel) poos = specify_poosf_exercise$new(spec, 5000, 1000, 1:2, 10)
clone()
The objects of this class are cloneable with this method.
specify_poosf_exercise$clone(deep = FALSE)
deepWhether to make a deep clone.
spec = specify_bvarPANEL$new(ilo_dynamic_panel) poos = specify_poosf_exercise$new(spec, 5000, 1000, 1:2, 10) ## ------------------------------------------------ ## Method `specify_poosf_exercise$new` ## ------------------------------------------------ spec = specify_bvarPANEL$new(ilo_dynamic_panel) poos = specify_poosf_exercise$new(spec, 5000, 1000, 1:2, 10)spec = specify_bvarPANEL$new(ilo_dynamic_panel) poos = specify_poosf_exercise$new(spec, 5000, 1000, 1:2, 10) ## ------------------------------------------------ ## Method `specify_poosf_exercise$new` ## ------------------------------------------------ spec = specify_bvarPANEL$new(ilo_dynamic_panel) poos = specify_poosf_exercise$new(spec, 5000, 1000, 1:2, 10)
The class PosteriorBVARGROUPPANEL contains posterior output and the specification
including the last MCMC draw for the Bayesian Panel VAR model with country grouping.
Note that due to the thinning of the MCMC output the starting value in element
last_draw might not be equal to the last draw provided in
element posterior.
bpvars::PosteriorBVARPANEL -> PosteriorBVARGROUPPANEL
last_drawan object of class BVARGROUPPANEL with the last draw of the
current MCMC run as the starting value to be passed to the continuation
of the MCMC estimation using estimate().
posteriora list containing Bayesian estimation output.
new()
Create a new posterior output PosteriorBVARGROUPPANEL.
specify_posterior_bvarGroupPANEL$new(specification, posterior)
specificationan object of class BVARGROUPPANEL with the last draw of the current MCMC run as the starting value.
posteriora list containing Bayesian estimation output.
A posterior output PosteriorBVARGROUPPANEL.
clone()
The objects of this class are cloneable with this method.
specify_posterior_bvarGroupPANEL$clone(deep = FALSE)
deepWhether to make a deep clone.
spec = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], G = 2 ) #posterior = estimate(specification, 5) #class(posterior)spec = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], G = 2 ) #posterior = estimate(specification, 5) #class(posterior)
The class PosteriorBVARGROUPPRIORPANEL contains posterior output and the specification
including the last MCMC draw for the Bayesian Panel VAR model with country grouping.
Note that due to the thinning of the MCMC output the starting value in element
last_draw might not be equal to the last draw provided in
element posterior.
bpvars::PosteriorBVARPANEL -> bpvars::PosteriorBVARGROUPPANEL -> PosteriorBVARGROUPPRIORPANEL
last_drawan object of class BVARGROUPPRIORPANEL with the last draw of the
current MCMC run as the starting value to be passed to the continuation
of the MCMC estimation using estimate().
posteriora list containing Bayesian estimation output.
new()
Create a new posterior output PosteriorBVARGROUPPRIORPANEL.
specify_posterior_bvarGroupPriorPANEL$new(specification, posterior)
specificationan object of class BVARGROUPPRIORPANEL with the last draw of the current MCMC run as the starting value.
posteriora list containing Bayesian estimation output.
A posterior output PosteriorBVARGROUPPRIORPANEL.
clone()
The objects of this class are cloneable with this method.
specify_posterior_bvarGroupPriorPANEL$clone(deep = FALSE)
deepWhether to make a deep clone.
spec = specify_bvarGroupPriorPANEL$new( data = ilo_dynamic_panel[1:5], G = 2 ) #posterior = estimate(specification, 5) #class(posterior)spec = specify_bvarGroupPriorPANEL$new( data = ilo_dynamic_panel[1:5], G = 2 ) #posterior = estimate(specification, 5) #class(posterior)
The class PosteriorBVARPANEL contains posterior output and the specification
including the last MCMC draw for the Bayesian Panel VAR model.
Note that due to the thinning of the MCMC output the starting value in element
last_draw might not be equal to the last draw provided in
element posterior.
last_drawan object of class BVARPANEL with the last draw of the
current MCMC run as the starting value to be passed to the continuation
of the MCMC estimation using estimate().
posteriora list containing Bayesian estimation output.
new()
Create a new posterior output PosteriorBVARPANEL.
specify_posterior_bvarPANEL$new(specification_bvarPANEL, posterior_bvarPANEL)
specification_bvarPANELan object of class BVARPANEL with the last draw of the current MCMC run as the starting value.
posterior_bvarPANELa list containing Bayesian estimation output.
A posterior output PosteriorBVARPANEL.
get_posterior()
Returns a list containing Bayesian estimation output.
specify_posterior_bvarPANEL$get_posterior()
specification = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) posterior = estimate(specification, 5) posterior$get_posterior()
get_last_draw()
Returns an object of class BVARPANEL with the last draw of the current
MCMC run as the starting value to be passed to the continuation of the
MCMC estimation using estimate().
specify_posterior_bvarPANEL$get_last_draw()
specification = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) burn_in = estimate(specification, 5) posterior = estimate(burn_in, 5)
clone()
The objects of this class are cloneable with this method.
specify_posterior_bvarPANEL$clone(deep = FALSE)
deepWhether to make a deep clone.
specification = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) posterior = estimate(specification, 5) class(posterior) ## ------------------------------------------------ ## Method `specify_posterior_bvarPANEL$get_posterior` ## ------------------------------------------------ specification = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) posterior = estimate(specification, 5) posterior$get_posterior() ## ------------------------------------------------ ## Method `specify_posterior_bvarPANEL$get_last_draw` ## ------------------------------------------------ specification = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) burn_in = estimate(specification, 5) posterior = estimate(burn_in, 5)specification = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) posterior = estimate(specification, 5) class(posterior) ## ------------------------------------------------ ## Method `specify_posterior_bvarPANEL$get_posterior` ## ------------------------------------------------ specification = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) posterior = estimate(specification, 5) posterior$get_posterior() ## ------------------------------------------------ ## Method `specify_posterior_bvarPANEL$get_last_draw` ## ------------------------------------------------ specification = specify_bvarPANEL$new( data = ilo_dynamic_panel[1:5] ) burn_in = estimate(specification, 5) posterior = estimate(burn_in, 5)
The class PosteriorBVARs contains posterior output and the specification
including the last MCMC draw for the Bayesian Panel VAR model.
Note that due to the thinning of the MCMC output the starting value in element
last_draw might not be equal to the last draw provided in
element posterior.
last_drawan object of class BVARs with the last draw of the
current MCMC run as the starting value to be passed to the continuation
of the MCMC estimation using estimate().
posteriora list containing Bayesian estimation output.
new()
Create a new posterior output PosteriorBVARs.
specify_posterior_bvars$new(specification_bvarPANEL, posterior_bvarPANEL)
specification_bvarPANELan object of class BVARs with the last draw of the current MCMC run as the starting value.
posterior_bvarPANELa list containing Bayesian estimation output.
A posterior output PosteriorBVARs.
get_posterior()
Returns a list containing Bayesian estimation output.
specify_posterior_bvars$get_posterior()
specification = specify_bvars$new( data = ilo_dynamic_panel[1:5] ) posterior = estimate(specification, 5) posterior$get_posterior()
get_last_draw()
Returns an object of class BVARs with the last draw of the current
MCMC run as the starting value to be passed to the continuation of the
MCMC estimation using estimate().
specify_posterior_bvars$get_last_draw()
specification = specify_bvars$new( data = ilo_dynamic_panel[1:5] ) burn_in = estimate(specification, 5) posterior = estimate(burn_in, 5)
clone()
The objects of this class are cloneable with this method.
specify_posterior_bvars$clone(deep = FALSE)
deepWhether to make a deep clone.
specification = specify_bvars$new( data = ilo_dynamic_panel[1:5] ) posterior = estimate(specification, 5) class(posterior) ## ------------------------------------------------ ## Method `specify_posterior_bvars$get_posterior` ## ------------------------------------------------ specification = specify_bvars$new( data = ilo_dynamic_panel[1:5] ) posterior = estimate(specification, 5) posterior$get_posterior() ## ------------------------------------------------ ## Method `specify_posterior_bvars$get_last_draw` ## ------------------------------------------------ specification = specify_bvars$new( data = ilo_dynamic_panel[1:5] ) burn_in = estimate(specification, 5) posterior = estimate(burn_in, 5)specification = specify_bvars$new( data = ilo_dynamic_panel[1:5] ) posterior = estimate(specification, 5) class(posterior) ## ------------------------------------------------ ## Method `specify_posterior_bvars$get_posterior` ## ------------------------------------------------ specification = specify_bvars$new( data = ilo_dynamic_panel[1:5] ) posterior = estimate(specification, 5) posterior$get_posterior() ## ------------------------------------------------ ## Method `specify_posterior_bvars$get_last_draw` ## ------------------------------------------------ specification = specify_bvars$new( data = ilo_dynamic_panel[1:5] ) burn_in = estimate(specification, 5) posterior = estimate(burn_in, 5)
The class PriorBVARPANEL presents a prior specification for the Bayesian hierarchical panel VAR model.
Man KxN matrix, the mean of the second-level MNIW prior
distribution for the global parameter matrices
and
Wa KxK column-specific covariance matrix of the second-level
MNIW prior distribution for the global parameter matrices
and
S_invan NxN row-specific precision matrix of the second-level
MNIW prior distribution for the global parameter matrices
and
S_Sigma_invan NxN precision matrix of the second-level
Wishart prior distribution for the global parameter matrix .
etaa positive shape parameter of the second-level MNIW prior distribution
for the global parameter matrices
and
mu_Sigmaa positive shape parameter of the second-level Wishart prior
distribution for the global parameter matrix .
lambdaa positive shape of the second-level exp prior distribution
for the shape parameter .
mu_ma scalar mean of the third-level normal prior distribution
for the global average persistence parameter .
sigma2_ma positive scalar variance of the third-level normal prior
distribution for the global average persistence parameter .
s_wa positive scalar scale of the third-level gamma prior
distribution for parameter .
a_wa positive scalar shape of the third-level gamma prior
distribution for parameter .
s_sa positive scalar scale parameter of the third-level
inverted-gamma 2 prior distribution for parameter .
nu_sa positive scalar shape parameter of the third-level
inverted-gamma 2 prior distribution for parameter .
new()
Create a new prior specification PriorBVARPANEL.
specify_prior_bvarPANEL$new(C, N, p, d = 0, stationary = rep(FALSE, N))
Ca positive integer - the number of countries in the data.
Na positive integer - the number of dependent variables in the model.
pa positive integer - the autoregressive lag order of the SVAR model.
da positive integer - the number of exogenous variables in the model.
stationaryan N logical vector - its element set to
FALSE sets the prior mean for the autoregressive parameters of the
Nth equation to the white noise process, otherwise to random walk.
A new prior specification PriorBVARPANEL.
# a prior for 2-country, 3-variable example with one lag and stationary data prior = specify_prior_bvarPANEL$new(C = 2, N = 3, p = 1) prior$M
get_prior()
Returns the elements of the prior specification PriorBSVAR as a list.
specify_prior_bvarPANEL$get_prior()
# a prior for 2-coutnry, 3-variable example with four lags prior = specify_prior_bvarPANEL$new(C = 2, N = 3, p = 4) prior$get_prior() # show the prior as list
clone()
The objects of this class are cloneable with this method.
specify_prior_bvarPANEL$clone(deep = FALSE)
deepWhether to make a deep clone.
prior = specify_prior_bvarPANEL$new(C = 2, N = 3, p = 1) prior$M ## ------------------------------------------------ ## Method `specify_prior_bvarPANEL$new` ## ------------------------------------------------ # a prior for 2-country, 3-variable example with one lag and stationary data prior = specify_prior_bvarPANEL$new(C = 2, N = 3, p = 1) prior$M ## ------------------------------------------------ ## Method `specify_prior_bvarPANEL$get_prior` ## ------------------------------------------------ # a prior for 2-coutnry, 3-variable example with four lags prior = specify_prior_bvarPANEL$new(C = 2, N = 3, p = 4) prior$get_prior() # show the prior as listprior = specify_prior_bvarPANEL$new(C = 2, N = 3, p = 1) prior$M ## ------------------------------------------------ ## Method `specify_prior_bvarPANEL$new` ## ------------------------------------------------ # a prior for 2-country, 3-variable example with one lag and stationary data prior = specify_prior_bvarPANEL$new(C = 2, N = 3, p = 1) prior$M ## ------------------------------------------------ ## Method `specify_prior_bvarPANEL$get_prior` ## ------------------------------------------------ # a prior for 2-coutnry, 3-variable example with four lags prior = specify_prior_bvarPANEL$new(C = 2, N = 3, p = 4) prior$get_prior() # show the prior as list
The class PriorBVARs presents a prior specification for the Bayesian VAR model for each country.
Man KxN matrix, the mean of the MNIW prior
distribution for the autoregressive matrices
Wa KxK column-specific covariance matrix of the
MNIW prior distribution for the autoregressive matrices
S_invan NxN row-specific precision matrix of the
MNIW prior distribution for the covariance matrices
lambdaa positive shape of the exponential prior distribution
for the shape parameter .
mu_ma scalar mean of the normal prior distribution
for the average persistence parameter .
sigma2_ma positive scalar variance of the normal prior
distribution for the average persistence parameter .
s_wa positive scalar scale of the inverse-gamma 2 prior
distribution for parameter .
nu_wa positive scalar shape of the inverse-gamma 2 prior
distribution for parameter .
s_sa positive scalar scale parameter of the
gamma prior distribution for parameter .
a_sa positive scalar shape parameter of the
gamma prior distribution for parameter .
new()
Create a new prior specification PriorBVARs.
specify_prior_bvars$new(C, N, p, d = 0, stationary = rep(FALSE, N))
Ca positive integer - the number of countries in the data.
Na positive integer - the number of dependent variables in the model.
pa positive integer - the autoregressive lag order of the SVAR model.
da positive integer - the number of exogenous variables in the model.
stationaryan N logical vector - its element set to
FALSE sets the prior mean for the autoregressive parameters of the
Nth equation to the white noise process, otherwise to random walk.
A new prior specification PriorBVARs.
# a prior for 2-country, 3-variable example with one lag and stationary data prior = specify_prior_bvars$new(C = 2, N = 3, p = 1) prior$M
get_prior()
Returns the elements of the prior specification PriorBVARs as a list.
specify_prior_bvars$get_prior()
# a prior for 2-country, 3-variable example with four lags prior = specify_prior_bvars$new(C = 2, N = 3, p = 4) prior$get_prior() # show the prior as list
clone()
The objects of this class are cloneable with this method.
specify_prior_bvars$clone(deep = FALSE)
deepWhether to make a deep clone.
prior = specify_prior_bvars$new(C = 2, N = 3, p = 1) prior$M ## ------------------------------------------------ ## Method `specify_prior_bvars$new` ## ------------------------------------------------ # a prior for 2-country, 3-variable example with one lag and stationary data prior = specify_prior_bvars$new(C = 2, N = 3, p = 1) prior$M ## ------------------------------------------------ ## Method `specify_prior_bvars$get_prior` ## ------------------------------------------------ # a prior for 2-country, 3-variable example with four lags prior = specify_prior_bvars$new(C = 2, N = 3, p = 4) prior$get_prior() # show the prior as listprior = specify_prior_bvars$new(C = 2, N = 3, p = 1) prior$M ## ------------------------------------------------ ## Method `specify_prior_bvars$new` ## ------------------------------------------------ # a prior for 2-country, 3-variable example with one lag and stationary data prior = specify_prior_bvars$new(C = 2, N = 3, p = 1) prior$M ## ------------------------------------------------ ## Method `specify_prior_bvars$get_prior` ## ------------------------------------------------ # a prior for 2-country, 3-variable example with four lags prior = specify_prior_bvars$new(C = 2, N = 3, p = 4) prior$get_prior() # show the prior as list
The class StartingValuesBVARGROUPPANEL presents starting values for the Bayesian hierarchical panel VAR model with country grouping
bpvars::StartingValuesBVARPANEL -> StartingValuesBVARGROUPPANEL
group_allocationa numeric vector with integer numbers denoting group allocations
A_can KxNxC array of starting values for the local parameter
.
Sigma_can NxNxC array of starting values for the local
parameter .
A_gan KxNxG array of starting values for the group parameter
.
Sigma_gan NxNxG array of starting values for the group
parameter .
Aan KxN matrix of starting values for the global parameter
.
Van KxK matrix of starting values for the global parameter
.
Sigmaan NxN matrix of starting values for the global parameter
.
nua positive scalar with starting values for the global parameter
.
ma positive scalar with starting values for the global hyper-parameter
.
wa positive scalar with starting values for the global hyper-parameter
.
sa positive scalar with starting values for the global hyper-parameter
.
specify_starting_values_bvarGroupPANEL$get_starting_values()
specify_starting_values_bvarGroupPANEL$set_starting_values()
new()
Create new starting values StartingValuesBVARGROUPPANEL
specify_starting_values_bvarGroupPANEL$new( group_allocation = 1:C, C, G = C, N, p, d = 0 )
group_allocationa numeric vector with integer numbers denoting group allocations
Ca positive integer - the number of countries in the data.
Ga positive integer specifying the number of country groups.
Na positive integer - the number of dependent variables in the model.
pa positive integer - the autoregressive lag order of the SVAR model.
da positive integer - the number of exogenous variables in the model.
Starting values StartingValuesBVARGROUPPANEL
# starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvarGroupPANEL$new(C = 2, N = 3, p = 1)
get_starting_values()
Returns the elements of the starting values StartingValuesBVARGROUPPANEL as
a list.
specify_starting_values_bvarGroupPANEL$get_starting_values()
# starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bvarGroupPANEL$new(rep(1,2), C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list
set_starting_values()
Returns the elements of the starting values StartingValuesBVARGROUPPANEL as a list.
specify_starting_values_bvarGroupPANEL$set_starting_values(last_draw)
last_drawa list containing the same elements as object StartingValuesBVARGROUPPANEL
An object of class StartingValuesBVARGROUPPANEL including the last draw of the current MCMC as the starting value to be passed to the continuation of the MCMC estimation.
sv = specify_starting_values_bvarGroupPANEL$new(rep(1,2), C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object
clone()
The objects of this class are cloneable with this method.
specify_starting_values_bvarGroupPANEL$clone(deep = FALSE)
deepWhether to make a deep clone.
# starting values for a Bayesian Panel VAR sv = specify_starting_values_bvarGroupPANEL$new(rep(1,2), C = 2, G = 1, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPANEL$new` ## ------------------------------------------------ # starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvarGroupPANEL$new(C = 2, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPANEL$get_starting_values` ## ------------------------------------------------ # starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bvarGroupPANEL$new(rep(1,2), C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPANEL$set_starting_values` ## ------------------------------------------------ sv = specify_starting_values_bvarGroupPANEL$new(rep(1,2), C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object# starting values for a Bayesian Panel VAR sv = specify_starting_values_bvarGroupPANEL$new(rep(1,2), C = 2, G = 1, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPANEL$new` ## ------------------------------------------------ # starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvarGroupPANEL$new(C = 2, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPANEL$get_starting_values` ## ------------------------------------------------ # starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bvarGroupPANEL$new(rep(1,2), C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPANEL$set_starting_values` ## ------------------------------------------------ sv = specify_starting_values_bvarGroupPANEL$new(rep(1,2), C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object
The class StartingValuesBVARGROUPPRIORPANEL presents starting values for the Bayesian hierarchical panel VAR model with country grouping
group_allocationa numeric vector with integer numbers denoting group allocations
A_can KxNxC array of starting values for the local parameter
.
Sigma_can NxNxC array of starting values for the local
parameter .
A_gan KxNxG array of starting values for the group parameter
.
Sigma_gan NxNxG array of starting values for the group
parameter .
Van KxK matrix of starting values for the global parameter
.
nua positive scalar with starting values for the global parameter
.
ma positive scalar with starting values for the global hyper-parameter
.
wa positive scalar with starting values for the global hyper-parameter
.
sa positive scalar with starting values for the global hyper-parameter
.
specify_starting_values_bvarGroupPriorPANEL$get_starting_values()
specify_starting_values_bvarGroupPriorPANEL$set_starting_values()
new()
Create new starting values StartingValuesBVARGROUPPRIORPANEL
specify_starting_values_bvarGroupPriorPANEL$new( group_allocation = 1:C, C, G = C, N, p, d = 0 )
group_allocationa numeric vector with integer numbers denoting group allocations
Ca positive integer - the number of countries in the data.
Ga positive integer specifying the number of country groups.
Na positive integer - the number of dependent variables in the model.
pa positive integer - the autoregressive lag order of the SVAR model.
da positive integer - the number of exogenous variables in the model.
Starting values StartingValuesBVARGROUPPRIORPANEL
# starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvarGroupPriorPANEL$new(C = 2, N = 3, p = 1)
get_starting_values()
Returns the elements of the starting values StartingValuesBVARGROUPPRIORPANEL as
a list.
specify_starting_values_bvarGroupPriorPANEL$get_starting_values()
# starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bvarGroupPriorPANEL$new(rep(1,2), C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list
set_starting_values()
Returns the elements of the starting values StartingValuesBVARGROUPPRIORPANEL as a list.
specify_starting_values_bvarGroupPriorPANEL$set_starting_values(last_draw)
last_drawa list containing the same elements as object StartingValuesBVARGROUPPRIORPANEL
An object of class StartingValuesBVARGROUPPRIORPANEL including the last draw of the current MCMC as the starting value to be passed to the continuation of the MCMC estimation.
sv = specify_starting_values_bvarGroupPriorPANEL$new(rep(1,2), C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object
clone()
The objects of this class are cloneable with this method.
specify_starting_values_bvarGroupPriorPANEL$clone(deep = FALSE)
deepWhether to make a deep clone.
# starting values for a Bayesian Panel VAR sv = specify_starting_values_bvarGroupPriorPANEL$new(rep(1,2), C = 2, G = 1, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPriorPANEL$new` ## ------------------------------------------------ # starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvarGroupPriorPANEL$new(C = 2, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPriorPANEL$get_starting_values` ## ------------------------------------------------ # starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bvarGroupPriorPANEL$new(rep(1,2), C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPriorPANEL$set_starting_values` ## ------------------------------------------------ sv = specify_starting_values_bvarGroupPriorPANEL$new(rep(1,2), C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object# starting values for a Bayesian Panel VAR sv = specify_starting_values_bvarGroupPriorPANEL$new(rep(1,2), C = 2, G = 1, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPriorPANEL$new` ## ------------------------------------------------ # starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvarGroupPriorPANEL$new(C = 2, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPriorPANEL$get_starting_values` ## ------------------------------------------------ # starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bvarGroupPriorPANEL$new(rep(1,2), C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list ## ------------------------------------------------ ## Method `specify_starting_values_bvarGroupPriorPANEL$set_starting_values` ## ------------------------------------------------ sv = specify_starting_values_bvarGroupPriorPANEL$new(rep(1,2), C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object
The class StartingValuesBVARPANEL presents starting values for the Bayesian hierarchical panel VAR model.
A_can KxNxC array of starting values for the local parameter
.
Sigma_can NxNxC array of starting values for the local
parameter .
Aan KxN matrix of starting values for the global parameter
.
Van KxK matrix of starting values for the global parameter
.
Sigmaan NxN matrix of starting values for the global parameter
.
nua positive scalar with starting values for the global parameter
.
ma positive scalar with starting values for the global hyper-parameter
.
wa positive scalar with starting values for the global hyper-parameter
.
sa positive scalar with starting values for the global hyper-parameter
.
new()
Create new starting values StartingValuesBVARPANEL
specify_starting_values_bvarPANEL$new(C, N, p, d = 0)
Ca positive integer - the number of countries in the data.
Na positive integer - the number of dependent variables in the model.
pa positive integer - the autoregressive lag order of the SVAR model.
da positive integer - the number of exogenous variables in the model.
Starting values StartingValuesBVARPANEL
# starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 4)
get_starting_values()
Returns the elements of the starting values StartingValuesBVARPANEL as
a list.
specify_starting_values_bvarPANEL$get_starting_values()
# starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list
set_starting_values()
Returns the elements of the starting values StartingValuesBVARPANEL as a list.
specify_starting_values_bvarPANEL$set_starting_values(last_draw)
last_drawa list containing the same elements as object StartingValuesBVARPANEL.
An object of class StartingValuesBVARPANEL including the last draw of the current MCMC as the starting value to be passed to the continuation of the MCMC estimation.
sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object
clone()
The objects of this class are cloneable with this method.
specify_starting_values_bvarPANEL$clone(deep = FALSE)
deepWhether to make a deep clone.
# starting values for a Bayesian Panel VAR sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvarPANEL$new` ## ------------------------------------------------ # starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 4) ## ------------------------------------------------ ## Method `specify_starting_values_bvarPANEL$get_starting_values` ## ------------------------------------------------ # starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list ## ------------------------------------------------ ## Method `specify_starting_values_bvarPANEL$set_starting_values` ## ------------------------------------------------ sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object# starting values for a Bayesian Panel VAR sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvarPANEL$new` ## ------------------------------------------------ # starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 4) ## ------------------------------------------------ ## Method `specify_starting_values_bvarPANEL$get_starting_values` ## ------------------------------------------------ # starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list ## ------------------------------------------------ ## Method `specify_starting_values_bvarPANEL$set_starting_values` ## ------------------------------------------------ sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object
The class StartingValuesBVARs presents starting values for the Bayesian hierarchical panel VAR model.
A_can KxNxC array of starting values for the local parameter
.
Sigma_can NxNxC array of starting values for the local
parameter .
nua C-vector of positive starting values for the parameter
.
ma C-vector of starting values for the parameter
.
wa C-vector of positive starting values for the parameter
.
sa C-vector of positive starting values for the parameter
.
new()
Create new starting values StartingValuesBVARs
specify_starting_values_bvars$new(C, N, p, d = 0)
Ca positive integer - the number of countries in the data.
Na positive integer - the number of dependent variables in the model.
pa positive integer - the autoregressive lag order of the SVAR model.
da positive integer - the number of exogenous variables in the model.
Starting values StartingValuesBVARs
# starting values for Bayesian VARs 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 4)
get_starting_values()
Returns the elements of the starting values StartingValuesBVARs as
a list.
specify_starting_values_bvars$get_starting_values()
# starting values for bvars with 1 lag for a 3-variable system sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list
set_starting_values()
Returns the elements of the starting values StartingValuesBVARs as a list.
specify_starting_values_bvars$set_starting_values(last_draw)
last_drawa list containing the same elements as object StartingValuesBVARs.
An object of class StartingValuesBVARs including the last draw of the current MCMC as the starting value to be passed to the continuation of the MCMC estimation.
sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object
clone()
The objects of this class are cloneable with this method.
specify_starting_values_bvars$clone(deep = FALSE)
deepWhether to make a deep clone.
# starting values for a Bayesian Panel VAR sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvars$new` ## ------------------------------------------------ # starting values for Bayesian VARs 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 4) ## ------------------------------------------------ ## Method `specify_starting_values_bvars$get_starting_values` ## ------------------------------------------------ # starting values for bvars with 1 lag for a 3-variable system sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list ## ------------------------------------------------ ## Method `specify_starting_values_bvars$set_starting_values` ## ------------------------------------------------ sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object# starting values for a Bayesian Panel VAR sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 1) ## ------------------------------------------------ ## Method `specify_starting_values_bvars$new` ## ------------------------------------------------ # starting values for Bayesian VARs 2-country model with 4 lags for a 3-variable system. sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 4) ## ------------------------------------------------ ## Method `specify_starting_values_bvars$get_starting_values` ## ------------------------------------------------ # starting values for bvars with 1 lag for a 3-variable system sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 1) sv$get_starting_values() # show starting values as list ## ------------------------------------------------ ## Method `specify_starting_values_bvars$set_starting_values` ## ------------------------------------------------ sv = specify_starting_values_bvars$new(C = 2, N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object
Provides posterior summary of the forecasts including their mean, standard deviations, as well as 5 and 95 percentiles.
## S3 method for class 'ForecastsPANEL' summary(object, which_c, ...)## S3 method for class 'ForecastsPANEL' summary(object, which_c, ...)
object |
an object of class |
which_c |
a positive integer or a character string specifying the country for which the forecast should be plotted. |
... |
additional arguments affecting the summary produced. |
A list reporting the posterior mean, standard deviations, as well as 5 and 95 percentiles of the forecasts for each of the variables and forecast horizons.
Tomasz Woźniak [email protected]
forecast.PosteriorBVARPANEL, plot
# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5]) burn_in = estimate(specification, 5) # run the burn-in posterior = estimate(burn_in, 5) # estimate the model # forecast 3 years ahead predictive = forecast( posterior, 3, exogenous_forecast = ilo_exogenous_forecasts[1:5]) summary(predictive, which_c = "ARG")# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5]) burn_in = estimate(specification, 5) # run the burn-in posterior = estimate(burn_in, 5) # estimate the model # forecast 3 years ahead predictive = forecast( posterior, 3, exogenous_forecast = ilo_exogenous_forecasts[1:5]) summary(predictive, which_c = "ARG")
Provides posterior mean, standard deviations, as well as 5 and 95
percentiles of the parameters for all C countries.
## S3 method for class 'PosteriorBVARGROUPPANEL' summary(object, ...)## S3 method for class 'PosteriorBVARGROUPPANEL' summary(object, ...)
object |
an object of class |
... |
additional arguments affecting the summary produced. |
A list reporting the posterior mean, standard deviations, as well as 5 and 95 percentiles of the country-specific parameters.
Tomasz Woźniak [email protected]
estimate.BVARGROUPPANEL, specify_bvarGroupPANEL
# specify the model specification = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 5) # run the burn-in posterior = estimate(burn_in, 5) # estimate the model summary(posterior)# specify the model specification = specify_bvarGroupPANEL$new( data = ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 5) # run the burn-in posterior = estimate(burn_in, 5) # estimate the model summary(posterior)
Provides posterior mean, standard deviations, as well as 5 and 95
percentiles of the parameters for all C countries.
## S3 method for class 'PosteriorBVARGROUPPRIORPANEL' summary(object, ...)## S3 method for class 'PosteriorBVARGROUPPRIORPANEL' summary(object, ...)
object |
an object of class |
... |
additional arguments affecting the summary produced. |
A list reporting the posterior mean, standard deviations, as well as 5 and 95 percentiles of the country-specific parameters.
Tomasz Woźniak [email protected]
estimate.BVARGROUPPRIORPANEL, specify_bvarGroupPriorPANEL
# specify the model specification = specify_bvarGroupPriorPANEL$new( data = ilo_dynamic_panel[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 5) # run the burn-in posterior = estimate(burn_in, 5) # estimate the model summary(posterior)# specify the model specification = specify_bvarGroupPriorPANEL$new( data = ilo_dynamic_panel[1:5], group_allocation = country_grouping_region[1:5] ) burn_in = estimate(specification, 5) # run the burn-in posterior = estimate(burn_in, 5) # estimate the model summary(posterior)
Provides posterior mean, standard deviations, as well as 5 and 95
percentiles of the parameters for all C countries.
## S3 method for class 'PosteriorBVARPANEL' summary(object, ...)## S3 method for class 'PosteriorBVARPANEL' summary(object, ...)
object |
an object of class |
... |
additional arguments affecting the summary produced. |
A list reporting the posterior mean, standard deviations, as well as 5 and 95 percentiles of the country-specific parameters.
Tomasz Woźniak [email protected]
estimate.BVARPANEL, specify_bvarPANEL
# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5]) burn_in = estimate(specification, 5) # run the burn-in posterior = estimate(burn_in, 5) # estimate the model summary(posterior)# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5]) burn_in = estimate(specification, 5) # run the burn-in posterior = estimate(burn_in, 5) # estimate the model summary(posterior)
Provides posterior mean, standard deviations, as well as 5 and 95
percentiles of the parameters for all C countries.
## S3 method for class 'PosteriorBVARs' summary(object, ...)## S3 method for class 'PosteriorBVARs' summary(object, ...)
object |
an object of class |
... |
additional arguments affecting the summary produced. |
A list reporting the posterior mean, standard deviations, as well as 5 and 95 percentiles of the country-specific parameters.
Tomasz Woźniak [email protected]
# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5]) burn_in = estimate(specification, 5) # run the burn-in posterior = estimate(burn_in, 5) # estimate the model summary(posterior)# specify the model specification = specify_bvarPANEL$new( ilo_dynamic_panel[1:5], exogenous = ilo_exogenous_variables[1:5]) burn_in = estimate(specification, 5) # run the burn-in posterior = estimate(burn_in, 5) # estimate the model summary(posterior)
Provides posterior means of the forecast error variance decompositions of each variable at all horizons.
## S3 method for class 'PosteriorFEVDPANEL' summary(object, which_c, ...)## S3 method for class 'PosteriorFEVDPANEL' summary(object, which_c, ...)
object |
an object of class |
which_c |
a positive integer or a character string specifying the country for which the forecast should be plotted. |
... |
additional arguments affecting the summary produced. |
A list reporting the posterior mean of the forecast error variance decompositions of each variable at all horizons.
Tomasz Woźniak [email protected]
compute_variance_decompositions.PosteriorBVARPANEL, plot
# specify the model and set seed specification = specify_bvarPANEL$new(ilo_dynamic_panel[1:5], p = 1) # run the burn-in burn_in = estimate(specification, 5) # estimate the model posterior = estimate(burn_in, 5) # compute forecast error variance decomposition 4 years ahead fevd = compute_variance_decompositions(posterior, horizon = 4) summary(fevd, which_c = "ARG")# specify the model and set seed specification = specify_bvarPANEL$new(ilo_dynamic_panel[1:5], p = 1) # run the burn-in burn_in = estimate(specification, 5) # estimate the model posterior = estimate(burn_in, 5) # compute forecast error variance decomposition 4 years ahead fevd = compute_variance_decompositions(posterior, horizon = 4) summary(fevd, which_c = "ARG")