
R6 Class Representing StartingValuesBVARPANEL
Source:R/specify_bvarpanel.R
specify_starting_values_bvarPANEL.Rd
The class StartingValuesBVARPANEL presents starting values for the Bayesian hierarchical panel VAR model.
Public fields
A_c
an
KxNxC
array of starting values for the local parameter \(\mathbf{A}_c\).Sigma_c
an
NxNxC
array of starting values for the local parameter \(\mathbf{\Sigma}_c\).A
an
KxN
matrix of starting values for the global parameter \(\mathbf{A}\).V
an
KxK
matrix of starting values for the global parameter \(\mathbf{V}\).Sigma
an
NxN
matrix of starting values for the global parameter \(\mathbf{\Sigma}\).nu
a positive scalar with starting values for the global parameter \(\nu\).
m
a positive scalar with starting values for the global hyper-parameter \(m\).
w
a positive scalar with starting values for the global hyper-parameter \(w\).
s
a positive scalar with starting values for the global hyper-parameter \(s\).
Methods
Method new()
Create new starting values StartingValuesBVARPANEL
Usage
specify_starting_values_bvarPANEL$new(C, N, p, d = 0)
Arguments
C
a positive integer - the number of countries in the data.
N
a positive integer - the number of dependent variables in the model.
p
a positive integer - the autoregressive lag order of the SVAR model.
d
a positive integer - the number of
exogenous
variables in the model.
Examples
# starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system.
sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 4)
Method get_starting_values()
Returns the elements of the starting values StartingValuesBVARPANEL as
a list
.
Examples
# starting values for a homoskedastic bsvar with 1 lag for a 3-variable system
sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1)
sv$get_starting_values() # show starting values as list
Method set_starting_values()
Returns the elements of the starting values StartingValuesBVARPANEL as a list
.
Returns
An object of class StartingValuesBVARPANEL including the last draw of the current MCMC as the starting value to be passed to the continuation of the MCMC estimation.
Examples
sv = specify_starting_values_bvarPANEL$new(C = 2, 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 Bayesian Panel VAR
sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1)
## ------------------------------------------------
## Method `specify_starting_values_bvarPANEL$new`
## ------------------------------------------------
# starting values for Bayesian Panel VAR 2-country model with 4 lags for a 3-variable system.
sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 4)
## ------------------------------------------------
## Method `specify_starting_values_bvarPANEL$get_starting_values`
## ------------------------------------------------
# starting values for a homoskedastic bsvar with 1 lag for a 3-variable system
sv = specify_starting_values_bvarPANEL$new(C = 2, N = 3, p = 1)
sv$get_starting_values() # show starting values as list
#> $A_c
#> , , 1
#>
#> [,1] [,2] [,3]
#> [1,] -0.0002601837 0.0005918285 3.011006e-04
#> [2,] 0.0009163384 -0.0004452150 7.279358e-05
#> [3,] -0.0003563721 0.0013880183 6.864619e-04
#> [4,] -0.0010862524 -0.0006630137 1.492703e-03
#>
#> , , 2
#>
#> [,1] [,2] [,3]
#> [1,] 0.0015637199 6.827847e-04 0.0002698022
#> [2,] 0.0010204583 -9.488596e-05 0.0008623817
#> [3,] -0.0017015454 -2.872404e-04 0.0011342409
#> [4,] 0.0008793839 -1.378115e-03 0.0013423024
#>
#>
#> $Sigma_c
#> , , 1
#>
#> [,1] [,2] [,3]
#> [1,] 12.1770715 -0.2257241 -3.541815
#> [2,] -0.2257241 3.1955562 -1.701268
#> [3,] -3.5418146 -1.7012682 4.428778
#>
#> , , 2
#>
#> [,1] [,2] [,3]
#> [1,] 4.843578 1.09566687 -1.83614768
#> [2,] 1.095667 0.87897178 -0.06038439
#> [3,] -1.836148 -0.06038439 0.99502031
#>
#>
#> $A
#> [,1] [,2] [,3]
#> [1,] 0.9998931977 0.0005512246 0.0001707188
#> [2,] 0.0017567215 0.9999790413 0.0014265294
#> [3,] 0.0005638946 -0.0004617559 0.9996702793
#> [4,] -0.0012907804 -0.0002604559 -0.0007881228
#>
#> $V
#> [,1] [,2] [,3] [,4]
#> [1,] 2.64372470 0.01980734 -0.7399448 -2.7482184
#> [2,] 0.01980734 2.90053986 -0.6491112 -0.8051071
#> [3,] -0.73994482 -0.64911120 2.5759965 1.1070949
#> [4,] -2.74821836 -0.80510714 1.1070949 4.5696790
#>
#> $Sigma
#> [,1] [,2] [,3]
#> [1,] 5.40841146 -2.58195327 0.08460652
#> [2,] -2.58195327 1.38977780 0.07658076
#> [3,] 0.08460652 0.07658076 0.48395696
#>
#> $nu
#> [1] 4.1
#>
#> $m
#> [1] -0.001733973
#>
#> $w
#> [1] 1.129384
#>
#> $s
#> [1] 0.9675639
#>
## ------------------------------------------------
## Method `specify_starting_values_bvarPANEL$set_starting_values`
## ------------------------------------------------
sv = specify_starting_values_bvarPANEL$new(C = 2, 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