
R6 Class Representing StartingValuesBSVARSV
Source:R/specify_bsvar_sv.R
specify_starting_values_bsvar_sv.Rd
The class StartingValuesBSVARSV presents starting values for the bsvar model with Stochastic Volatility heteroskedasticity.
Public fields
A
an
NxK
matrix of starting values for the parameter \(A\).B
an
NxN
matrix of starting values for the parameter \(B\).hyper
a
(2*N+1)x2
matrix of starting values for the shrinkage hyper-parameters of the hierarchical prior distribution.h
an
NxT
matrix with the starting values of the log-volatility processes.rho
an
N
-vector with values of SV autoregressive parameters.omega
an
N
-vector with values of SV process conditional standard deviations.sigma2v
an
N
-vector with values of SV process conditional variances.S
an
NxT
integer matrix with the auxiliary mixture component indicators.sigma2_omega
an
N
-vector with variances of the zero-mean normal prior for \(\omega_n\).s_
a positive scalar with the scale of the gamma prior of the hierarchical prior for \(\sigma^2_{\omega}\).
Methods
Method new()
Create new starting values StartingValuesBSVARSV.
Usage
specify_starting_values_bsvar_sv$new(A, B, N, p, T, d = 0)
Arguments
A
a logical
NxK
matrix containing valueTRUE
for the elements of the autoregressive matrix \(A\) to be estimated and valueFALSE
for exclusion restrictions to be set to zero.B
a logical
NxN
matrix containing valueTRUE
for the elements of the staructural matrix \(B\) to be estimated and valueFALSE
for exclusion restrictions to be set to zero.N
a positive integer - the number of dependent variables in the model.
p
a positive integer - the autoregressive lag order of the SVAR model.
T
a positive integer - the the time series dimension of the dependent variable matrix \(Y\).
d
a positive integer - the number of
exogenous
variables in the model.
Method get_starting_values()
Returns the elements of the starting values StartingValuesBSVARSV as a list
.
Examples
# starting values for a bsvar model with 1 lag for a 3-variable system
A = matrix(TRUE, 3, 4)
B = matrix(TRUE, 3, 3)
sv = specify_starting_values_bsvar_sv$new(A = A, B = B, N = 3, p = 1, T = 100)
sv$get_starting_values() # show starting values as list
Method set_starting_values()
Returns the elements of the starting values StartingValuesBSVAR_SV as a list
.
Returns
An object of class StartingValuesBSVAR including the last draw of the current MCMC as the starting value to be passed to the continuation of the MCMC estimation using estimate()
.
Examples
# starting values for a bsvar model with 1 lag for a 3-variable system
A = matrix(TRUE, 3, 4)
B = matrix(TRUE, 3, 3)
sv = specify_starting_values_bsvar_sv$new(A = A, B = B, N = 3, p = 1, T = 100)
# 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 bsvar model for a 3-variable system
A = matrix(TRUE, 3, 4)
B = matrix(TRUE, 3, 3)
sv = specify_starting_values_bsvar_sv$new(A = A, B = B, N = 3, p = 1, T = 100)
## ------------------------------------------------
## Method `specify_starting_values_bsvar_sv$get_starting_values`
## ------------------------------------------------
# starting values for a bsvar model with 1 lag for a 3-variable system
A = matrix(TRUE, 3, 4)
B = matrix(TRUE, 3, 3)
sv = specify_starting_values_bsvar_sv$new(A = A, B = B, N = 3, p = 1, T = 100)
sv$get_starting_values() # show starting values as list
#> $B
#> [,1] [,2] [,3]
#> [1,] 0.2242117 0.0000000 0.00000000
#> [2,] 0.0000000 0.1141729 0.00000000
#> [3,] 0.0000000 0.0000000 0.01784731
#>
#> $A
#> [,1] [,2] [,3] [,4]
#> [1,] 0.2237539 0.0000000 0.0000000 0
#> [2,] 0.0000000 0.5058421 0.0000000 0
#> [3,] 0.0000000 0.0000000 0.1790367 0
#>
#> $hyper
#> [,1] [,2]
#> [1,] 10 10
#> [2,] 10 10
#> [3,] 10 10
#> [4,] 10 10
#> [5,] 10 10
#> [6,] 10 10
#> [7,] 10 10
#>
#> $h
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] -0.013390090 -0.010438266 0.014547613 -0.006834259 0.0002623308
#> [2,] 0.002207463 0.005643683 0.013143884 -0.004920259 0.0064064304
#> [3,] 0.012957100 0.016066215 0.002492362 -0.009521897 -0.0009757059
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.0045008180 0.0108203413 0.0112841861 0.015249006 0.0003515349
#> [2,] -0.0009461899 0.0026148831 -0.0007551702 -0.003954474 -0.0091878812
#> [3,] -0.0072193336 -0.0001177592 -0.0119583170 -0.019746527 0.0072224219
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] -0.0004477032 0.003942061 -0.006803883 -0.001385678 0.0075151728
#> [2,] -0.0027813924 -0.005783064 -0.009889167 -0.022184692 -0.0167804389
#> [3,] -0.0045575160 0.007835626 -0.005307092 -0.010129136 0.0009444189
#> [,16] [,17] [,18] [,19] [,20]
#> [1,] -3.365499e-03 0.018068604 -0.009784660 9.833365e-04 0.001661308
#> [2,] 1.460187e-02 -0.004127064 0.009145015 2.107666e-03 -0.001377826
#> [3,] -7.411895e-05 0.010177888 -0.007228003 7.088089e-05 0.004411687
#> [,21] [,22] [,23] [,24] [,25]
#> [1,] -0.008741380 -0.009677743 -0.008366076 -0.0140632542 -0.009311521
#> [2,] 0.020996636 -0.015779881 -0.023925400 -0.0007795195 -0.003341507
#> [3,] -0.005337946 0.014823097 0.004922077 -0.0053703670 -0.002113345
#> [,26] [,27] [,28] [,29] [,30]
#> [1,] -0.007611175 0.005021242 -0.004835457 0.004227505 -0.004498554
#> [2,] -0.025296832 -0.003940378 -0.013957465 0.005864420 -0.002252556
#> [3,] 0.011976476 0.012436873 -0.001183805 0.006896318 0.008422449
#> [,31] [,32] [,33] [,34] [,35]
#> [1,] -0.009117186 0.007581388 -0.0034330152 0.0108861719 0.006819918
#> [2,] 0.012088435 0.003280514 0.0009091654 -0.0168462086 0.003065204
#> [3,] 0.001972102 -0.012531479 0.0121752921 0.0007443028 0.008086338
#> [,36] [,37] [,38] [,39] [,40]
#> [1,] -0.01601643 0.010556519 -0.026993191 -0.001993828 -0.001571714
#> [2,] 0.01388499 0.008881706 -0.001031313 0.011510949 0.005220363
#> [3,] 0.00571859 -0.001788534 -0.016084115 0.001266631 -0.001052864
#> [,41] [,42] [,43] [,44] [,45]
#> [1,] -0.0039830933 -0.0130840934 -0.01534560 0.0007881846 -0.004032399
#> [2,] -0.0150754794 -0.0004953085 -0.01623722 0.0097102609 -0.003684851
#> [3,] 0.0004440283 0.0133610829 0.01018035 -0.0093354837 -0.006371286
#> [,46] [,47] [,48] [,49] [,50]
#> [1,] 0.021284338 0.023914652 -0.001321578 0.009563338 -0.005126399
#> [2,] -0.004693705 -0.004195588 -0.005722528 -0.006525359 0.010738920
#> [3,] -0.007807008 -0.016325969 -0.011215981 -0.013318833 0.005384177
#> [,51] [,52] [,53] [,54] [,55]
#> [1,] -0.004955408 -0.012143751 -0.00801264 -0.007513096 0.010536321
#> [2,] 0.005305238 0.009399910 -0.01916799 0.014379244 0.007579226
#> [3,] 0.001949423 0.000540552 -0.01173398 -0.003739363 -0.008245830
#> [,56] [,57] [,58] [,59] [,60]
#> [1,] 0.001387715 -0.002448290 0.002689861 -0.0042547557 -0.004669049
#> [2,] 0.001961658 0.004212342 -0.006581546 0.0225162266 0.007461309
#> [3,] 0.001820224 -0.008033795 0.003789394 0.0001119062 0.001027818
#> [,61] [,62] [,63] [,64] [,65]
#> [1,] 0.02181849 0.010431674 0.019940320 -0.014009542 -0.006553827
#> [2,] -0.01836207 -0.003048809 0.013230383 0.004150555 0.002664233
#> [3,] -0.01023675 0.017384102 -0.002808507 -0.011713871 0.010127652
#> [,66] [,67] [,68] [,69] [,70]
#> [1,] 0.002265404 0.018571726 0.0106242371 0.0037651214 0.002311472
#> [2,] 0.007518464 0.002176886 0.0003241845 -0.0004202804 0.006929182
#> [3,] 0.010030919 -0.002207152 -0.0087455918 -0.0049563702 0.036721789
#> [,71] [,72] [,73] [,74] [,75]
#> [1,] -0.007936513 -0.009250843 -0.004004606 0.019372365 0.008983389
#> [2,] -0.001742550 -0.007997152 0.001936837 -0.011654071 -0.002581676
#> [3,] -0.016841219 -0.002622781 -0.008066623 0.004348885 0.020692426
#> [,76] [,77] [,78] [,79] [,80]
#> [1,] 0.0001063405 -0.012772601 -0.010799627 0.003994665 0.005364859
#> [2,] -0.0056642027 -0.007225120 0.004104296 0.006030104 0.005344525
#> [3,] -0.0095871990 0.008570276 0.010230161 0.010003787 0.002697141
#> [,81] [,82] [,83] [,84] [,85]
#> [1,] 0.008643446 0.0088891209 -0.005033187 0.018368368 -0.002336407
#> [2,] -0.001428450 0.0053517566 0.001268694 -0.020058458 0.010695276
#> [3,] -0.015232745 -0.0006151524 0.006729932 -0.005142306 -0.011532351
#> [,86] [,87] [,88] [,89] [,90]
#> [1,] -0.008879189 0.002649467 -0.004097133 0.008875348 -0.01883017
#> [2,] -0.003777212 0.009366205 0.008660193 -0.008791298 -0.01534633
#> [3,] 0.003700481 -0.022404218 0.015132239 -0.008569668 -0.01873260
#> [,91] [,92] [,93] [,94] [,95]
#> [1,] -0.006476411 -0.004221538 -0.002057624 0.0032701693 -1.655984e-02
#> [2,] -0.002798496 -0.005959817 -0.007269829 -0.0107738225 4.039667e-06
#> [3,] 0.017625541 0.006476895 -0.004348900 -0.0003173991 8.961293e-03
#> [,96] [,97] [,98] [,99] [,100]
#> [1,] 0.008592295 0.006417313 0.020135328 -0.005977290 -0.0166818314
#> [2,] 0.003505889 0.026218064 -0.007435306 -0.005421879 0.0003883123
#> [3,] -0.010404650 -0.014575005 0.006377771 0.005941158 -0.0038766590
#>
#> $rho
#> [1] 0.5 0.5 0.5
#>
#> $omega
#> [1] 0.1 0.1 0.1
#>
#> $sigma2v
#> [1] 0.01 0.01 0.01
#>
#> $S
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
#> [1,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> [2,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> [3,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26]
#> [1,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [2,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [3,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38]
#> [1,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [2,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [3,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50]
#> [1,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [2,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [3,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [,62]
#> [1,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [2,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [3,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [,63] [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [,74]
#> [1,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [2,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [3,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [,75] [,76] [,77] [,78] [,79] [,80] [,81] [,82] [,83] [,84] [,85] [,86]
#> [1,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [2,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [3,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [,87] [,88] [,89] [,90] [,91] [,92] [,93] [,94] [,95] [,96] [,97] [,98]
#> [1,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [2,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [3,] 1 1 1 1 1 1 1 1 1 1 1 1
#> [,99] [,100]
#> [1,] 1 1
#> [2,] 1 1
#> [3,] 1 1
#>
#> $sigma2_omega
#> [1] 1 1 1
#>
#> $s_
#> [1] 0.05 0.05 0.05
#>
## ------------------------------------------------
## Method `specify_starting_values_bsvar_sv$set_starting_values`
## ------------------------------------------------
# starting values for a bsvar model with 1 lag for a 3-variable system
A = matrix(TRUE, 3, 4)
B = matrix(TRUE, 3, 3)
sv = specify_starting_values_bsvar_sv$new(A = A, B = B, N = 3, p = 1, T = 100)
# 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