The class PriorBSVARSIGN presents a prior specification for the homoskedastic bsvar model.
Public fields
pa positive integer - the number of lags.
hypera
(N+3)xSmatrix of hyper-parameters \(\mu, \delta, \lambda, \psi\).Aa
NxKnormal prior mean matrix for the autoregressive parameters.Va
KxKmatrix determining the normal prior column-specific covariance for the autoregressive parameters.San
NxNmatrix determining the inverted-Wishart prior scale of error terms covariance matrix.nua positive scalar greater than
N+1- the shape of the inverted-Wishart prior for error terms covariance matrix.dataan
TxNmatrix of observations.Yan
NxTmatrix of dependent variables.Xan
KxTmatrix of independent variables.Ysocan
NxNmatrix with the sum-of-coefficients dummy observations.Xsocan
KxNmatrix with the sum-of-coefficients dummy observations.Ysuran
NxNmatrix with the single-unit-root dummy observations.Xsuran
KxNmatrix with the single-unit-root dummy observations.mu.scalea positive scalar - the shape of the gamma prior for \(\mu\).
mu.shapea positive scalar - the shape of the gamma prior for \(\mu\).
delta.scalea positive scalar - the shape of the gamma prior for \(\delta\).
delta.shapea positive scalar - the shape of the gamma prior for \(\delta\).
lambda.scalea positive scalar - the shape of the gamma prior for \(\lambda\).
lambda.shapea positive scalar - the shape of the gamma prior for \(\lambda\).
psi.scalea positive scalar - the shape of the inverted gamma prior for \(\psi\).
psi.shapea positive scalar - the shape of the inverted gamma prior for \(\psi\).
covidNULL 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
datathe
TxNdata matrix of observations.pa positive integer - the autoregressive lag order of the SVAR model.
exogenousa
Txdmatrix of exogenous variables.stationaryan
Nlogical vector - its element set toFALSEsets the prior mean for the autoregressive parameters of theNth equation to the white noise process, otherwise to random walk.
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
Examples
# 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
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 1 0 0 0 0 0
#> [2,] 0 1 0 0 0 0
#> [3,] 0 0 1 0 0 0
#> [4,] 0 0 0 1 0 0
#> [5,] 0 0 0 0 1 0
## ------------------------------------------------
## 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
#> NULL
## ------------------------------------------------
## 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
#> $A
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
#> [1,] 1 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [2,] 0 1 0 0 0 0 0 0 0 0 0 0 0 0
#> [3,] 0 0 1 0 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 1 0 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 1 0 0 0 0 0 0 0 0 0
#> [,15] [,16] [,17] [,18] [,19] [,20] [,21]
#> [1,] 0 0 0 0 0 0 0
#> [2,] 0 0 0 0 0 0 0
#> [3,] 0 0 0 0 0 0 0
#> [4,] 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 0 0 0
#>
#> $A_V_inv
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
#> [1,] 1 0 0 0 0 0 0 0 0 0 0 0 0
#> [2,] 0 1 0 0 0 0 0 0 0 0 0 0 0
#> [3,] 0 0 1 0 0 0 0 0 0 0 0 0 0
#> [4,] 0 0 0 1 0 0 0 0 0 0 0 0 0
#> [5,] 0 0 0 0 1 0 0 0 0 0 0 0 0
#> [6,] 0 0 0 0 0 4 0 0 0 0 0 0 0
#>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#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 1 0 0 0 0
#> [2,] 0 1 0 0 0
#> [3,] 0 0 1 0 0
#> [4,] 0 0 0 1 0
#> [5,] 0 0 0 0 1
#>
#> $B_nu
#> [1] 5
#>
#> $hyper_nu_B
#> [1] 10
#>
#> $hyper_a_B
#> [1] 10
#>
#> $hyper_s_BB
#> [1] 100
#>
#> $hyper_nu_BB
#> [1] 1
#>
#> $hyper_nu_A
#> [1] 10
#>
#> $hyper_a_A
#> [1] 10
#>
#> $hyper_s_AA
#> [1] 10
#>
#> $hyper_nu_AA
#> [1] 10
#>
