Learn R Programming

bpvars (version 1.0)

specify_prior_bvars: R6 Class Representing PriorBVARs

Description

The class PriorBVARs presents a prior specification for the Bayesian VAR model for each country.

Arguments

Public fields

M

an KxN matrix, the mean of the MNIW prior distribution for the autoregressive matrices \(\mathbf{A}_c\)

W

a KxK column-specific covariance matrix of the MNIW prior distribution for the autoregressive matrices \(\mathbf{A}_c\)

S_inv

an NxN row-specific precision matrix of the MNIW prior distribution for the covariance matrices \(\mathbf{\Sigma}_c\)

lambda

a positive shape of the exponential prior distribution for the shape parameter \(\nu\).

mu_m

a scalar mean of the normal prior distribution for the average persistence parameter \(m\).

sigma2_m

a positive scalar variance of the normal prior distribution for the average persistence parameter \(m\).

s_w

a positive scalar scale of the inverse-gamma 2 prior distribution for parameter \(w\).

nu_w

a positive scalar shape of the inverse-gamma 2 prior distribution for parameter \(w\).

s_s

a positive scalar scale parameter of the gamma prior distribution for parameter \(s\).

a_s

a positive scalar shape parameter of the gamma prior distribution for parameter \(s\).

Methods


Method new()

Create a new prior specification PriorBVARs.

Usage

specify_prior_bvars$new(C, N, p, d = 0, stationary = rep(FALSE, N))

Arguments

C

a positive integer - the number of countries in the data.

N

a positive integer - the number of dependent variables in the model.

p

a positive integer - the autoregressive lag order of the SVAR model.

d

a positive integer - the number of exogenous variables in the model.

stationary

an 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.

Returns

A new prior specification PriorBVARs.

Examples

# 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 get_prior()

Returns the elements of the prior specification PriorBVARs as a list.

Usage

specify_prior_bvars$get_prior()

Examples

# 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


Method clone()

The objects of this class are cloneable with this method.

Usage

specify_prior_bvars$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
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 list

Run the code above in your browser using DataLab