
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.0001495347 0.0002878438 -0.0012587803
#> [2,] -0.0027732608 0.0006629272 -0.0002732911
#> [3,] -0.0004209771 0.0002101724 -0.0014176854
#> [4,] 0.0001887710 0.0002994169 0.0008952273
#>
#> , , 2
#>
#> [,1] [,2] [,3]
#> [1,] -0.0007040053 0.0003039409 -8.810289e-04
#> [2,] -0.0001532845 0.0001007243 1.111207e-03
#> [3,] 0.0007861016 0.0004696339 7.867916e-05
#> [4,] -0.0004210982 0.0007191212 1.511902e-03
#>
#>
#> $Sigma_c
#> , , 1
#>
#> [,1] [,2] [,3]
#> [1,] 8.412292 -1.05394244 5.13180204
#> [2,] -1.053942 1.66910581 -0.01560142
#> [3,] 5.131802 -0.01560142 7.14445410
#>
#> , , 2
#>
#> [,1] [,2] [,3]
#> [1,] 5.861363 3.760276 -5.530991
#> [2,] 3.760276 5.532697 -4.739268
#> [3,] -5.530991 -4.739268 5.679124
#>
#>
#> $A
#> [,1] [,2] [,3]
#> [1,] 0.9979102272 0.0006404647 -6.241326e-05
#> [2,] 0.0009736282 0.9987390709 -1.981237e-03
#> [3,] 0.0004278584 0.0002551386 9.999267e-01
#> [4,] 0.0003179191 -0.0016409832 4.500664e-05
#>
#> $V
#> [,1] [,2] [,3] [,4]
#> [1,] 5.1736067 -3.86422997 0.12714069 0.8371735
#> [2,] -3.8642300 3.91693045 -0.08751254 -0.0737175
#> [3,] 0.1271407 -0.08751254 1.45699476 -0.7057053
#> [4,] 0.8371735 -0.07371750 -0.70570528 3.8437280
#>
#> $Sigma
#> [,1] [,2] [,3]
#> [1,] 8.273302 -1.1645818 -0.9299710
#> [2,] -1.164582 0.5854204 0.3304565
#> [3,] -0.929971 0.3304565 7.4039631
#>
#> $nu
#> [1] 4.1
#>
#> $m
#> [1] -0.002126309
#>
#> $w
#> [1] 0.6115554
#>
#> $s
#> [1] 2.490568
#>
## ------------------------------------------------
## 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