specify_starting_values_bsvar_msh: R6 Class Representing StartingValuesBSVARMSH

specify_starting_values_bsvar_mshR Documentation

R6 Class Representing StartingValuesBSVARMSH

Description

The class StartingValuesBSVARMSH presents starting values for the bsvar model with Markov Switching Heteroskedasticity.

Super class

StartingValuesBSVAR -> StartingValuesBSVARMSH

Public fields

A

an NxK matrix of starting values for the parameter A.

B

an NxN matrix of starting values for the parameter B.

hyper

a (2*N+1)x2 matrix of starting values for the shrinkage hyper-parameters of the hierarchical prior distribution.

sigma2

an NxM matrix of starting values for the MS state-specific variances of the structural shocks. Its elements sum to value M over the rows.

PR_TR

an MxM matrix of starting values for the transition probability matrix of the Markov process. Its elements sum to 1 over the rows.

xi

an MxT matrix of starting values for the Markov process indicator. Its columns are a chosen column of an identity matrix of order M.

pi_0

an M-vector of starting values for state probability at time t=0. Its elements sum to 1.

lambda

a NxT matrix of starting values for latent variables.

df

an Nx1 vector of positive numbers with starting values for the equation-specific degrees of freedom parameters of the Student-t conditional distribution of structural shocks.

Methods

Public methods


StartingValuesBSVARMSH$new()

Create new starting values StartingValuesBSVAR-MS.

Usage
StartingValuesBSVARMSH$new(A, B, N, p, M, T, d = 0, finiteM = TRUE)
Arguments
A

a logical NxK matrix containing value TRUE for the elements of the autoregressive matrix A to be estimated and value FALSE for exclusion restrictions to be set to zero.

B

a logical NxN matrix containing value TRUE for the elements of the staructural matrix B to be estimated and value FALSE for exclusion restrictions to be set to zero.

N

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

p

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

M

an integer greater than 1 - the number of Markov process' heteroskedastic regimes.

T

a positive integer - the the time series dimension of the dependent variable matrix Y.

d

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

finiteM

a logical value - if true a stationary Markov switching model is estimated. Otherwise, a sparse Markov switching model is estimated in which M=20 and the number of visited states is estimated.

Returns

Starting values StartingValuesBSVAR-MS.


StartingValuesBSVARMSH$get_starting_values()

Returns the elements of the starting values StartingValuesBSVAR-MS as a list.

Usage
StartingValuesBSVARMSH$get_starting_values()
Examples
# starting values for a homoskedastic bsvar with 1 lag for a 3-variable system
A = matrix(TRUE, 3, 4)
B = matrix(TRUE, 3, 3)
sv = specify_starting_values_bsvar_msh$new(A = A, B = B, N = 3, p = 1, M = 2, T = 100)
sv$get_starting_values()   # show starting values as list

StartingValuesBSVARMSH$set_starting_values()

Returns the elements of the starting values StartingValuesBSVARMSH as a list.

Usage
StartingValuesBSVARMSH$set_starting_values(last_draw)
Arguments
last_draw

a list containing the last draw.

Returns

An object of class StartingValuesBSVAR-MS including the last draw of the current MCMC as the starting value to be passed to the continuation of the MCMC estimation using estimate().

Examples
# starting values for a bsvar model with 1 lag for a 3-variable system
A = matrix(TRUE, 3, 4)
B = matrix(TRUE, 3, 3)
sv = specify_starting_values_bsvar_msh$new(A = A, B = B, N = 3, p = 1, M = 2, T = 100)

# Modify the starting values by:
sv_list = sv$get_starting_values()   # getting them as list
sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry
sv$set_starting_values(sv_list)      # providing to the class object

StartingValuesBSVARMSH$clone()

The objects of this class are cloneable with this method.

Usage
StartingValuesBSVARMSH$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

# starting values for a bsvar model for a 3-variable system
A = matrix(TRUE, 3, 4)
B = matrix(TRUE, 3, 3)
sv = specify_starting_values_bsvar_msh$new(A = A, B = B, N = 3, p = 1, M = 2, T = 100)


## ------------------------------------------------
## Method `StartingValuesBSVARMSH$get_starting_values()`
## ------------------------------------------------

# starting values for a homoskedastic bsvar with 1 lag for a 3-variable system
A = matrix(TRUE, 3, 4)
B = matrix(TRUE, 3, 3)
sv = specify_starting_values_bsvar_msh$new(A = A, B = B, N = 3, p = 1, M = 2, T = 100)
sv$get_starting_values()   # show starting values as list


## ------------------------------------------------
## Method `StartingValuesBSVARMSH$set_starting_values()`
## ------------------------------------------------

# starting values for a bsvar model with 1 lag for a 3-variable system
A = matrix(TRUE, 3, 4)
B = matrix(TRUE, 3, 3)
sv = specify_starting_values_bsvar_msh$new(A = A, B = B, N = 3, p = 1, M = 2, T = 100)

# Modify the starting values by:
sv_list = sv$get_starting_values()   # getting them as list
sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry
sv$set_starting_values(sv_list)      # providing to the class object


bsvars documentation built on Aug. 22, 2026, 5:09 p.m.