Learn R Programming

bpvars (version 1.0)

specify_prior_bvarPANEL: R6 Class Representing PriorBVARPANEL

Description

The class PriorBVARPANEL presents a prior specification for the Bayesian hierarchical panel VAR model.

Arguments

Public fields

M

an KxN matrix, the mean of the second-level MNIW prior distribution for the global parameter matrices \(\mathbf{A}\) and \(\mathbf{V}\)

W

a KxK column-specific covariance matrix of the second-level MNIW prior distribution for the global parameter matrices \(\mathbf{A}\) and \(\mathbf{V}\)

S_inv

an NxN row-specific precision matrix of the second-level MNIW prior distribution for the global parameter matrices \(\mathbf{A}\) and \(\mathbf{V}\)

S_Sigma_inv

an NxN precision matrix of the second-level Wishart prior distribution for the global parameter matrix \(\mathbf{\Sigma}\).

eta

a positive shape parameter of the second-level MNIW prior distribution for the global parameter matrices \(\mathbf{A}\) and \(\mathbf{V}\)

mu_Sigma

a positive shape parameter of the second-level Wishart prior distribution for the global parameter matrix \(\mathbf{\Sigma}\).

lambda

a positive shape of the second-level exp prior distribution for the shape parameter \(\nu\).

mu_m

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

sigma2_m

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

s_w

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

a_w

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

s_s

a positive scalar scale parameter of the third-level inverted-gamma 2 prior distribution for parameter \(s\).

nu_s

a positive scalar shape parameter of the third-level inverted-gamma 2 prior distribution for parameter \(s\).

Methods


Method new()

Create a new prior specification PriorBVARPANEL.

Usage

specify_prior_bvarPANEL$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 PriorBVARPANEL.

Examples

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

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

Usage

specify_prior_bvarPANEL$get_prior()

Examples

# 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


Method clone()

The objects of this class are cloneable with this method.

Usage

specify_prior_bvarPANEL$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

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

Run the code above in your browser using DataLab