
R6 Class representing the specification of the BSVAR model with Markov Switching Heteroskedasticity.
Source:R/specify_bsvar_msh.R
specify_bsvar_msh.RdThe class BSVARMSH presents complete specification for the BSVAR model with Markov Switching Heteroskedasticity.
Public fields
pa non-negative integer specifying the autoregressive lag order of the model.
identificationan object IdentificationBSVARs with the identifying restrictions.
prioran object PriorBSVARMSH with the prior specification.
data_matricesan object DataMatricesBSVAR with the data matrices.
starting_valuesan object StartingValuesBSVARMSH with the starting values.
finiteMa logical value - if true a stationary Markov switching model is estimated. Otherwise, a sparse Markov switching model is estimated in which
M=20and the number of visited states is estimated.
Methods
Method new()
Create a new specification of the BSVAR model with Markov Switching Heteroskedasticity, BSVARMSH.
Usage
specify_bsvar_msh$new(
data,
p = 1L,
M = 2L,
B,
A,
exogenous = NULL,
stationary = rep(FALSE, ncol(data)),
finiteM = TRUE
)Arguments
dataa
(T+p)xNmatrix with time series data.pa positive integer providing model's autoregressive lag order.
Man integer greater than 1 - the number of Markov process' heteroskedastic regimes.
Ba logical
NxNmatrix containing valueTRUEfor the elements of the structural matrix \(B\) to be estimated and valueFALSEfor exclusion restrictions to be set to zero.Aa logical
NxKmatrix containing valueTRUEfor the elements of the autoregressive matrix \(A\) to be estimated and valueFALSEfor exclusion restrictions to be set to zero.exogenousa
(T+p)xdmatrix 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.finiteMa logical value - if true a stationary Markov switching model is estimated. Otherwise, a sparse Markov switching model is estimated in which
M=20and the number of visited states is estimated.
Method get_data_matrices()
Returns the data matrices as the DataMatricesBSVAR object.
Examples
data(us_fiscal_lsuw)
spec = specify_bsvar_msh$new(
data = us_fiscal_lsuw,
p = 4,
M = 2
)
spec$get_data_matrices()
Method get_identification()
Returns the identifying restrictions as the IdentificationBSVARs object.
Examples
data(us_fiscal_lsuw)
spec = specify_bsvar_msh$new(
data = us_fiscal_lsuw,
p = 4,
M = 2
)
spec$get_identification()
Method get_prior()
Returns the prior specification as the PriorBSVARMSH object.
Examples
data(us_fiscal_lsuw)
spec = specify_bsvar_msh$new(
data = us_fiscal_lsuw,
p = 4,
M = 2
)
spec$get_prior()
Method get_starting_values()
Returns the starting values as the StartingValuesBSVARMSH object.
Examples
data(us_fiscal_lsuw)
spec = specify_bsvar_msh$new(
data = us_fiscal_lsuw,
p = 4,
M = 2
)
spec$get_starting_values()
Examples
data(us_fiscal_lsuw)
spec = specify_bsvar_msh$new(
data = us_fiscal_lsuw,
p = 4,
M = 2
)
#> The identification is set to the default option of lower-triangular structural matrix.
## ------------------------------------------------
## Method `specify_bsvar_msh$get_data_matrices`
## ------------------------------------------------
data(us_fiscal_lsuw)
spec = specify_bsvar_msh$new(
data = us_fiscal_lsuw,
p = 4,
M = 2
)
#> The identification is set to the default option of lower-triangular structural matrix.
spec$get_data_matrices()
#> <DataMatricesBSVAR>
#> Public:
#> X: -10.6660327703266 -10.6935259109068 -8.41420587851191 -1 ...
#> Y: -10.6725356416822 -10.6388624265757 -8.42993325328991 -1 ...
#> clone: function (deep = FALSE)
#> get_data_matrices: function ()
#> initialize: function (data, p = 1L, exogenous = NULL)
## ------------------------------------------------
## Method `specify_bsvar_msh$get_identification`
## ------------------------------------------------
data(us_fiscal_lsuw)
spec = specify_bsvar_msh$new(
data = us_fiscal_lsuw,
p = 4,
M = 2
)
#> The identification is set to the default option of lower-triangular structural matrix.
spec$get_identification()
#> <IdentificationBSVARs>
#> Public:
#> VA: list
#> VB: list
#> clone: function (deep = FALSE)
#> get_identification: function ()
#> initialize: function (B, A, N, K)
#> set_identification: function (B, A, N, K)
## ------------------------------------------------
## Method `specify_bsvar_msh$get_prior`
## ------------------------------------------------
data(us_fiscal_lsuw)
spec = specify_bsvar_msh$new(
data = us_fiscal_lsuw,
p = 4,
M = 2
)
#> The identification is set to the default option of lower-triangular structural matrix.
spec$get_prior()
#> <PriorBSVARMSH>
#> Inherits from: <PriorBSVAR>
#> Public:
#> A: 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
#> A_V_inv: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
#> B_V_inv: 1 0 0 0 1 0 0 0 1
#> B_nu: 3
#> PR_TR: 1 1 1 1
#> clone: function (deep = FALSE)
#> get_prior: function ()
#> hyper_a_A: 10
#> hyper_a_B: 10
#> hyper_nu_A: 10
#> hyper_nu_AA: 10
#> hyper_nu_B: 10
#> hyper_nu_BB: 1
#> hyper_s_AA: 10
#> hyper_s_BB: 100
#> initialize: function (N, p, d = 0, M, stationary = rep(FALSE, N))
#> sigma_nu: 3
#> sigma_s: 1
## ------------------------------------------------
## Method `specify_bsvar_msh$get_starting_values`
## ------------------------------------------------
data(us_fiscal_lsuw)
spec = specify_bsvar_msh$new(
data = us_fiscal_lsuw,
p = 4,
M = 2
)
#> The identification is set to the default option of lower-triangular structural matrix.
spec$get_starting_values()
#> <StartingValuesBSVARMSH>
#> Inherits from: <StartingValuesBSVAR>
#> Public:
#> A: 0.607121946290135 0 0 0 0.107453117612749 0 0 0 0.978260 ...
#> B: 0.379549054428935 0 0 0 0.555391244823113 0 0 0 0.772014 ...
#> PR_TR: 1 0 0 1
#> clone: function (deep = FALSE)
#> get_starting_values: function ()
#> hyper: 10 10 10 10 10 10 10 10 10 10 10 10 10 10
#> initialize: function (A, B, N, p, M, T, d = 0, finiteM = TRUE)
#> pi_0: 0.5 0.5
#> set_starting_values: function (last_draw)
#> sigma2: 1 1 1 1 1 1
#> xi: 0 1 0 1 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 0 1 1 0 1 0 ...