
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.0004938469 -0.0015372338 0.0007334974
#> [2,] 0.0004547900 0.0012301562 -0.0007353337
#> [3,] 0.0014632086 0.0005701989 0.0014122754
#> [4,] 0.0004796409 -0.0003327847 -0.0009386183
#>
#> , , 2
#>
#> [,1] [,2] [,3]
#> [1,] 1.014699e-03 0.0009797475 -0.0018580369
#> [2,] -2.469808e-03 -0.0014002001 0.0007901463
#> [3,] 8.508482e-04 0.0003807436 -0.0004428356
#> [4,] 9.455169e-05 -0.0011507121 0.0021748359
#>
#>
#> $Sigma_c
#> , , 1
#>
#> [,1] [,2] [,3]
#> [1,] 6.6393563 1.961107 0.3196957
#> [2,] 1.9611066 1.769698 0.9090700
#> [3,] 0.3196957 0.909070 1.6013052
#>
#> , , 2
#>
#> [,1] [,2] [,3]
#> [1,] 1.997355 1.316814 1.063608
#> [2,] 1.316814 3.805323 -2.797677
#> [3,] 1.063608 -2.797677 5.458455
#>
#>
#> $A
#> [,1] [,2] [,3]
#> [1,] 1.000388e+00 0.001155433 -0.0018856120
#> [2,] 1.095711e-03 0.999928285 -0.0001751325
#> [3,] 3.220973e-05 -0.002349186 0.9992730073
#> [4,] 5.571354e-04 0.001599875 0.0004539026
#>
#> $V
#> [,1] [,2] [,3] [,4]
#> [1,] 0.7069639 -0.9336635 -0.1640911 0.2395434
#> [2,] -0.9336635 5.7053972 3.0942149 -1.7204673
#> [3,] -0.1640911 3.0942149 10.3761879 -2.2072563
#> [4,] 0.2395434 -1.7204673 -2.2072563 1.3257008
#>
#> $Sigma
#> [,1] [,2] [,3]
#> [1,] 2.07804577 0.3351448 -0.07095534
#> [2,] 0.33514484 2.0530515 1.85028610
#> [3,] -0.07095534 1.8502861 2.10424678
#>
#> $nu
#> [1] 4.1
#>
#> $m
#> [1] 0.0006332046
#>
#> $w
#> [1] 2.309897
#>
#> $s
#> [1] 0.7855444
#>
## ------------------------------------------------
## 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