
R6 Class Representing StartingValuesBSVART
Source:R/specify_bsvar_t.R
specify_starting_values_bsvar_t.RdThe class StartingValuesBSVART presents starting values for the bsvar model with t-distributed structural shocks.
Public fields
Aan
NxKmatrix of starting values for the parameter \(A\).Ban
NxNmatrix of starting values for the parameter \(B\).hypera
(2*N+1)x2matrix of starting values for the shrinkage hyper-parameters of the hierarchical prior distribution.lambdaa
NxTmatrix of starting values for latent variables.dfan
Nx1vector of positive numbers with starting values for the equation-specific degrees of freedom parameters of the Student-t conditional distribution of structural shocks.
Methods
Method new()
Create new starting values StartingValuesBSVART
Usage
specify_starting_values_bsvar_t$new(A, B, N, p, T, d = 0)Arguments
Aa logical
NxKmatrix containing valueTRUEfor the elements of the autoregressive matrix \(A\) to be estimated and valueFALSEfor exclusion restrictions to be set to zero.Ba logical
NxNmatrix containing valueTRUEfor the elements of the staructural matrix \(B\) to be estimated and valueFALSEfor exclusion restrictions to be set to zero.Na positive integer - the number of dependent variables in the model.
pa positive integer - the autoregressive lag order of the SVAR model.
Ta positive integer - the the time series dimension of the dependent variable matrix \(Y\).
da positive integer - the number of
exogenousvariables in the model.
Method get_starting_values()
Returns the elements of the starting values StartingValuesBSVAR as a list.
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$new(A = A, B = B, N = 3, p = 1)
sv$get_starting_values() # show starting values as list
Method set_starting_values()
Returns the elements of the starting values StartingValuesBSVAR as a list.
Arguments
last_drawa list containing the last draw of elements
B- anNxNmatrix,A- anNxKmatrix, andhyper- a vector of 5 positive real numbers.
Returns
An object of class StartingValuesBSVAR 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 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$new(A = A, B = B, N = 3, p = 1)
# 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
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_t$new(A = A, B = B, N = 3, p = 1, T = 100)
## ------------------------------------------------
## Method `specify_starting_values_bsvar_t$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$new(A = A, B = B, N = 3, p = 1)
sv$get_starting_values() # show starting values as list
#> $B
#> [,1] [,2] [,3]
#> [1,] 0.05101492 0.0000000 0.00000
#> [2,] 0.00000000 0.5314115 0.00000
#> [3,] 0.00000000 0.0000000 0.58396
#>
#> $A
#> [,1] [,2] [,3] [,4]
#> [1,] 0.8342324 0.0000000 0.0000000 0
#> [2,] 0.0000000 0.4039433 0.0000000 0
#> [3,] 0.0000000 0.0000000 0.1752685 0
#>
#> $hyper
#> [,1] [,2]
#> [1,] 10 10
#> [2,] 10 10
#> [3,] 10 10
#> [4,] 10 10
#> [5,] 10 10
#> [6,] 10 10
#> [7,] 10 10
#>
## ------------------------------------------------
## Method `specify_starting_values_bsvar_t$set_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$new(A = A, B = B, N = 3, p = 1)
# 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