Learn R Programming

bsvarSIGNs (version 3.0)

specify_prior_bsvarSIGN: R6 Class Representing PriorBSVAR

Description

The class PriorBSVARSIGN presents a prior specification for the homoskedastic bsvar model.

Arguments

Public fields

p

a positive integer - the number of lags.

hyper

a (N+3)xS matrix of hyper-parameters \(\mu, \delta, \lambda, \psi\).

A

a NxK normal prior mean matrix for the autoregressive parameters.

V

a KxK matrix determining the normal prior column-specific covariance for the autoregressive parameters.

S

an NxN matrix determining the inverted-Wishart prior scale of error terms covariance matrix.

nu

a positive scalar greater than N+1 - the shape of the inverted-Wishart prior for error terms covariance matrix.

data

an TxN matrix of observations.

Y

an NxT matrix of dependent variables.

X

an KxT matrix of independent variables.

Ysoc

an NxN matrix with the sum-of-coefficients dummy observations.

Xsoc

an KxN matrix with the sum-of-coefficients dummy observations.

Ysur

an NxN matrix with the single-unit-root dummy observations.

Xsur

an KxN matrix with the single-unit-root dummy observations.

mu.scale

a positive scalar - the shape of the gamma prior for \(\mu\).

mu.shape

a positive scalar - the shape of the gamma prior for \(\mu\).

delta.scale

a positive scalar - the shape of the gamma prior for \(\delta\).

delta.shape

a positive scalar - the shape of the gamma prior for \(\delta\).

lambda.scale

a positive scalar - the shape of the gamma prior for \(\lambda\).

lambda.shape

a positive scalar - the shape of the gamma prior for \(\lambda\).

psi.scale

a positive scalar - the shape of the inverted gamma prior for \(\psi\).

psi.shape

a positive scalar - the shape of the inverted gamma prior for \(\psi\).

covid

NULL or a positive integer indicating the start of the COVID-19 pandemic.

Methods


Method new()

Create a new prior specification PriorBSVAR.

Usage

specify_prior_bsvarSIGN$new(
  data,
  p,
  exogenous = NULL,
  stationary = rep(FALSE, ncol(data))
)

Arguments

data

the TxN data matrix of observations.

p

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

exogenous

a Txd matrix of exogenous variables.

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

Examples

# a prior for 5-variable example with one lag and stationary data
data(optimism)
prior = specify_prior_bsvarSIGN$new(optimism, p = 1)
prior$B # show autoregressive prior mean


Method get_prior()

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

Usage

specify_prior_bsvarSIGN$get_prior()

Examples

# a prior for 5-variable example with four lags
prior = specify_prior_bsvar$new(N = 5, 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_bsvarSIGN$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
# a prior for 5-variable example with one lag
data(optimism)
prior = specify_prior_bsvarSIGN$new(optimism, p = 1)
prior$A  # show autoregressive prior mean


## ------------------------------------------------
## Method `specify_prior_bsvarSIGN$new`
## ------------------------------------------------

# a prior for 5-variable example with one lag and stationary data
data(optimism)
prior = specify_prior_bsvarSIGN$new(optimism, p = 1)
prior$B # show autoregressive prior mean


## ------------------------------------------------
## Method `specify_prior_bsvarSIGN$get_prior`
## ------------------------------------------------

# a prior for 5-variable example with four lags
prior = specify_prior_bsvar$new(N = 5, p = 4)
prior$get_prior() # show the prior as list

Run the code above in your browser using DataLab