
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.7424524 0.0000000 0.0000000
#> [2,] 0.0000000 0.1182828 0.0000000
#> [3,] 0.0000000 0.0000000 0.1655069
#>
#> $A
#> [,1] [,2] [,3] [,4]
#> [1,] 0.8092106 0.0000000 0.0000000 0
#> [2,] 0.0000000 0.7653974 0.0000000 0
#> [3,] 0.0000000 0.0000000 0.9025619 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.004091069 0.003423916 0.009701273 0.001003765 -0.009625332
#> [2,] 0.019290814 -0.006689113 -0.012098527 -0.009985212 0.004565653
#> [3,] 0.008905861 0.015557458 0.006806607 0.004683360 0.003908667
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] 0.001276711 0.001400654 0.000176626 0.0124524628 -0.008246079
#> [2,] 0.005979914 -0.010965013 -0.002754935 -0.0002098818 0.003538000
#> [3,] 0.004735051 -0.009352632 0.001087633 -0.0082551251 0.004856955
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] 0.004843274 -0.009860696 0.008910815 -0.0006642422 0.005571862
#> [2,] -0.011996783 0.003816953 -0.007648796 -0.0164227448 0.010696844
#> [3,] -0.008210180 -0.003812924 0.013281537 0.0132034770 -0.001356095
#> [,16] [,17] [,18] [,19] [,20]
#> [1,] 0.004910207 0.003577448 0.001112525 -0.008099521 -0.0223027221
#> [2,] -0.023929446 0.010294851 -0.014842674 0.002946115 -0.0072224787
#> [3,] 0.011417361 -0.001692373 -0.013380777 0.004020161 0.0001926589
#> [,21] [,22] [,23] [,24] [,25]
#> [1,] -0.006024632 -4.605751e-05 -0.001082821 -0.02030099 0.010058527
#> [2,] -0.003285815 -1.055430e-02 -0.011608536 -0.01025549 0.004972037
#> [3,] -0.009531976 1.546575e-02 -0.001731496 0.01369646 0.003871160
#> [,26] [,27] [,28] [,29] [,30]
#> [1,] 0.001977763 0.017412513 -0.007595765 0.003588457 0.0076687908
#> [2,] 0.002935466 0.003863564 -0.009190425 0.003866253 0.0057394101
#> [3,] -0.022332537 -0.012046309 -0.009865530 0.003988654 -0.0004945287
#> [,31] [,32] [,33] [,34] [,35]
#> [1,] -0.005618925 -0.0043568057 -0.0003806899 0.011928968 -0.0002177701
#> [2,] 0.007440256 -0.0172785738 -0.0084354703 0.005541414 -0.0087152297
#> [3,] 0.007643031 0.0009564995 0.0090885140 0.004715230 -0.0086605052
#> [,36] [,37] [,38] [,39] [,40]
#> [1,] 0.004590057 -0.014118931 0.023525193 -0.0109280243 -0.00537267
#> [2,] 0.012306364 -0.003515438 0.008800434 0.0056836169 0.00218107
#> [3,] -0.013391846 0.004478974 -0.006572268 -0.0003108208 0.01882337
#> [,41] [,42] [,43] [,44] [,45]
#> [1,] -0.0088749001 0.00928123 8.834931e-03 0.001739818 0.001885176
#> [2,] -0.0189316921 0.00944807 4.209273e-05 0.006917449 0.012325515
#> [3,] -0.0002905484 -0.01540659 2.001188e-03 -0.015964847 0.017545406
#> [,46] [,47] [,48] [,49] [,50]
#> [1,] -0.003205100 -0.002660926 0.013332261 -0.004026464 -0.005357827
#> [2,] -0.002778383 -0.001524790 0.018386736 0.003124563 0.021913685
#> [3,] -0.005242286 -0.011558332 0.005622716 0.005320381 -0.008510788
#> [,51] [,52] [,53] [,54] [,55]
#> [1,] -0.012831615 -0.001845503 -0.01661639 -0.018971457 0.003364819
#> [2,] -0.007017589 0.011873613 0.01121065 0.001945925 -0.007435415
#> [3,] -0.010792475 0.023508584 -0.00996439 -0.002525417 0.009365315
#> [,56] [,57] [,58] [,59] [,60]
#> [1,] 0.0002003118 0.002244325 -0.001607089 -0.0004322814 0.0048056020
#> [2,] -0.0080111922 0.021192285 0.014267875 -0.0045455308 -0.0075554124
#> [3,] -0.0005981327 0.002102720 0.005152520 -0.0101588735 0.0009499493
#> [,61] [,62] [,63] [,64] [,65]
#> [1,] -0.004725476 -0.017101291 0.004251416 -0.011972039 0.0013025163
#> [2,] -0.006425953 -0.008065755 -0.017430154 -0.003574001 -0.0013149134
#> [3,] -0.005947017 -0.012891771 0.010513863 -0.009651296 0.0005403131
#> [,66] [,67] [,68] [,69] [,70]
#> [1,] -0.0006721806 -0.009860870 0.006884529 0.023622132 -0.0001477221
#> [2,] 0.0153163323 -0.005145388 0.001783650 -0.005762755 0.0023355031
#> [3,] -0.0229653325 0.004701425 -0.010669371 0.017210438 -0.0127777598
#> [,71] [,72] [,73] [,74] [,75]
#> [1,] -0.001515977 -0.002431533 -0.0003948757 0.019199963 0.002186849
#> [2,] -0.016350916 0.002235997 -0.0186148787 -0.005880273 -0.002399690
#> [3,] 0.002120347 0.006316088 0.0106339574 0.003888120 -0.022496447
#> [,76] [,77] [,78] [,79] [,80]
#> [1,] -0.0036787210 -0.0001515137 -0.010677182 0.001842258 -6.897704e-05
#> [2,] -0.0042633234 0.0062547142 -0.001268914 0.002720596 4.044921e-05
#> [3,] 0.0006877749 -0.0044852653 0.016844550 0.002307963 -6.784610e-03
#> [,81] [,82] [,83] [,84] [,85]
#> [1,] 0.008535026 -0.007968161 0.012137771 0.005670553 0.009942170
#> [2,] 0.003607988 -0.007430530 -0.005840344 0.003218527 -0.012132398
#> [3,] -0.007348662 0.003119482 0.006014289 -0.008482299 -0.009353683
#> [,86] [,87] [,88] [,89] [,90]
#> [1,] 0.002924309 -0.017662577 -0.003074248 0.016152139 0.0065042497
#> [2,] 0.012556069 0.005631744 -0.006220321 -0.001285639 -0.0017110897
#> [3,] -0.018450496 0.002910809 0.003070266 0.012308648 0.0007902557
#> [,91] [,92] [,93] [,94] [,95]
#> [1,] 0.002310349 -0.001589211 -0.0001518845 0.012217144 -0.014884968
#> [2,] 0.002429864 -0.010524746 0.0015314348 0.003504325 0.014189715
#> [3,] 0.016627611 -0.001904356 -0.0096737551 0.003515033 -0.005744438
#> [,96] [,97] [,98] [,99] [,100]
#> [1,] -0.01563993 0.005668586 -0.004380099 -0.009139582 -0.006727500
#> [2,] 0.02010730 -0.003793235 0.013164333 -0.002834277 -0.006857386
#> [3,] 0.01113052 0.010523575 0.005816090 -0.001135066 0.021575635
#>
#> $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