R6 Class Representing IdentificationBSVARs
Source:R/specify_bsvar.R
specify_identification_bsvars.Rd
The class IdentificationBSVARs presents the identifying restrictions for the bsvar models.
Methods
Method new()
Create new identifying restrictions IdentificationBSVARs.
Usage
specify_identification_bsvars$new(N, B)
Method get_identification()
Returns the elements of the identification pattern IdentificationBSVARs as a list
.
Examples
B = matrix(c(TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE), 3, 3); B
spec = specify_identification_bsvars$new(N = 3, B = B)
spec$get_identification()
Method set_identification()
Set new starting values StartingValuesBSVAR.
Arguments
N
a positive integer - the number of dependent variables in the model.
B
a logical
NxN
matrix containing valueTRUE
for the elements of the structural matrix \(B\) to be estimated and valueFALSE
for exclusion restrictions to be set to zero.
Examples
spec = specify_identification_bsvars$new(N = 3) # specify a model with the default option
B = matrix(c(TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE), 3, 3); B
spec$set_identification(N = 3, B = B) # modify an existing specification
spec$get_identification() # check the outcome
Examples
specify_identification_bsvars$new(N = 3) # recursive specification for a 3-variable system
#> <IdentificationBSVARs>
#> Public:
#> VB: list
#> clone: function (deep = FALSE)
#> get_identification: function ()
#> initialize: function (N, B)
#> set_identification: function (N, B)
B = matrix(c(TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE), 3, 3); B
#> [,1] [,2] [,3]
#> [1,] TRUE FALSE FALSE
#> [2,] TRUE FALSE TRUE
#> [3,] TRUE TRUE TRUE
specify_identification_bsvars$new(N = 3, B = B) # an alternative identification pattern
#> <IdentificationBSVARs>
#> Public:
#> VB: list
#> clone: function (deep = FALSE)
#> get_identification: function ()
#> initialize: function (N, B)
#> set_identification: function (N, B)
## ------------------------------------------------
## Method `specify_identification_bsvars$get_identification`
## ------------------------------------------------
B = matrix(c(TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE), 3, 3); B
#> [,1] [,2] [,3]
#> [1,] TRUE FALSE FALSE
#> [2,] TRUE FALSE TRUE
#> [3,] TRUE TRUE TRUE
spec = specify_identification_bsvars$new(N = 3, B = B)
spec$get_identification()
#> [[1]]
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#>
#> [[2]]
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 0 1
#>
#> [[3]]
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
#>
## ------------------------------------------------
## Method `specify_identification_bsvars$set_identification`
## ------------------------------------------------
spec = specify_identification_bsvars$new(N = 3) # specify a model with the default option
B = matrix(c(TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE), 3, 3); B
#> [,1] [,2] [,3]
#> [1,] TRUE FALSE FALSE
#> [2,] TRUE FALSE TRUE
#> [3,] TRUE TRUE TRUE
spec$set_identification(N = 3, B = B) # modify an existing specification
spec$get_identification() # check the outcome
#> [[1]]
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#>
#> [[2]]
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 0 1
#>
#> [[3]]
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
#>