
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.0004414435 0.0001074246 0.0007769211
#> [2,] -0.0019287443 0.0004876714 -0.0008689339
#> [3,] 0.0001751391 -0.0001742916 -0.0017757222
#> [4,] 0.0015128405 0.0008815465 0.0001971153
#>
#> , , 2
#>
#> [,1] [,2] [,3]
#> [1,] -0.0002394657 2.485383e-04 -0.0010582890
#> [2,] -0.0005326891 7.491305e-06 -0.0012150944
#> [3,] -0.0001129883 6.611267e-04 0.0001406312
#> [4,] 0.0002518540 8.925527e-04 0.0005932337
#>
#>
#> $Sigma_c
#> , , 1
#>
#> [,1] [,2] [,3]
#> [1,] 3.1442735 2.229081 0.3968497
#> [2,] 2.2290814 5.279383 1.2348790
#> [3,] 0.3968497 1.234879 0.4634517
#>
#> , , 2
#>
#> [,1] [,2] [,3]
#> [1,] 1.0119030 0.1251169 0.5971143
#> [2,] 0.1251169 3.5813562 0.7245034
#> [3,] 0.5971143 0.7245034 4.8029280
#>
#>
#> $A
#> [,1] [,2] [,3]
#> [1,] 1.000393e+00 -0.0007931300 9.521393e-05
#> [2,] 1.348896e-05 0.9989567144 -7.109833e-05
#> [3,] 2.498204e-04 -0.0004317340 9.995242e-01
#> [4,] 1.766655e-03 0.0008872134 -6.254425e-04
#>
#> $V
#> [,1] [,2] [,3] [,4]
#> [1,] 10.557947 3.275599 -9.0044538 1.2731153
#> [2,] 3.275599 6.221238 -6.4096817 4.0888846
#> [3,] -9.004454 -6.409682 13.3301855 0.4907272
#> [4,] 1.273115 4.088885 0.4907272 10.1129953
#>
#> $Sigma
#> [,1] [,2] [,3]
#> [1,] 5.125944 -2.16841669 1.20434711
#> [2,] -2.168417 3.30240993 -0.01423946
#> [3,] 1.204347 -0.01423946 2.78474099
#>
#> $nu
#> [1] 4.1
#>
#> $m
#> [1] 0.001665234
#>
#> $w
#> [1] 0.161806
#>
#> $s
#> [1] 1.130843
#>
## ------------------------------------------------
## 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