
R6 Class Representing StartingValuesBSVARSV
Source:R/specify_bsvar_sv.R
      specify_starting_values_bsvar_sv.RdThe class StartingValuesBSVARSV presents starting values for the bsvar model with Stochastic Volatility heteroskedasticity.
Public fields
- A
- an - NxKmatrix of starting values for the parameter \(A\).
- B
- an - NxNmatrix of starting values for the parameter \(B\).
- hyper
- a - (2*N+1)x2matrix of starting values for the shrinkage hyper-parameters of the hierarchical prior distribution.
- h
- an - NxTmatrix 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 - NxTinteger 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}\). 
- lambda
- a - NxTmatrix of starting values for latent variables.
- df
- an - Nx1vector of positive numbers with starting values for the equation-specific degrees of freedom parameters of the Student-t conditional distribution of structural shocks.
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 - NxKmatrix containing value- TRUEfor the elements of the autoregressive matrix \(A\) to be estimated and value- FALSEfor exclusion restrictions to be set to zero.
- B
- a logical - NxNmatrix containing value- TRUEfor the elements of the staructural matrix \(B\) to be estimated and value- FALSEfor 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 - exogenousvariables 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.1616358 0.0000000 0.0000000
#> [2,] 0.0000000 0.2917113 0.0000000
#> [3,] 0.0000000 0.0000000 0.7235585
#> 
#> $A
#>           [,1]      [,2]      [,3] [,4]
#> [1,] 0.2323624 0.0000000 0.0000000    0
#> [2,] 0.0000000 0.1800242 0.0000000    0
#> [3,] 0.0000000 0.0000000 0.6098561    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
#> 
#> $lambda
#>      [,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
#> 
#> $df
#> [1] 3 3 3
#> 
#> $h
#>              [,1]         [,2]         [,3]         [,4]         [,5]
#> [1,] -0.003192840 -0.004029448  0.007629105  0.014250769 -0.012110649
#> [2,] -0.004313479 -0.012951333  0.016704980 -0.010240912  0.015285587
#> [3,]  0.001552012  0.002800991 -0.014528052 -0.001868055  0.001396425
#>               [,6]          [,7]        [,8]          [,9]        [,10]
#> [1,] -0.0004271323 -0.0065647403 0.001709821 -0.0007878937  0.018750151
#> [2,]  0.0043683994  0.0044783309 0.011150343  0.0031562345  0.018597520
#> [3,]  0.0285613089  0.0009707993 0.002028543 -0.0071374656 -0.007965252
#>            [,11]        [,12]        [,13]         [,14]        [,15]
#> [1,] -0.01888279 -0.014065694  0.001314308  0.0186164250  0.011176691
#> [2,]  0.01951696 -0.008108645 -0.002753414  0.0090958132 -0.007476125
#> [3,]  0.00492345 -0.010295373  0.013747950 -0.0002122446 -0.006496985
#>             [,16]        [,17]         [,18]       [,19]       [,20]
#> [1,]  0.000244211  0.003712137 -0.0035129947 0.013619218  0.01025079
#> [2,] -0.001855075 -0.006249434 -0.0036093005 0.006110749 -0.01084265
#> [3,] -0.007753197  0.011342384 -0.0006390322 0.003642131  0.01146732
#>              [,21]        [,22]        [,23]        [,24]        [,25]
#> [1,]  0.0000875398 -0.003656503 -0.003469134 0.0001818889  0.007126701
#> [2,] -0.0144350388  0.015196378 -0.009648888 0.0105559186  0.017956447
#> [3,] -0.0058815788 -0.019974391  0.002695924 0.0099104948 -0.010816867
#>             [,26]        [,27]        [,28]        [,29]        [,30]
#> [1,] -0.004925338 -0.012492405 -0.005166661 -0.012554751  0.009944220
#> [2,]  0.009645974  0.003500025 -0.026922644 -0.006372108 -0.014230197
#> [3,] -0.005830639  0.008144417 -0.010969546 -0.003909162 -0.006110093
#>             [,31]         [,32]        [,33]        [,34]        [,35]
#> [1,] -0.007388167 -0.0154572841 -0.005824925  0.002712292 -0.004760957
#> [2,]  0.014290716  0.0103955625 -0.007213677 -0.001419930  0.010090495
#> [3,] -0.014915847  0.0003414736 -0.025848955  0.011039173  0.002524558
#>             [,36]        [,37]        [,38]        [,39]        [,40]
#> [1,]  0.007410500  0.007829877 -0.010848367  0.008815685  0.015785981
#> [2,] -0.017959741  0.013135519 -0.001419747  0.013296579 -0.007884133
#> [3,]  0.009917127 -0.000557616  0.007547433 -0.000663639 -0.026794370
#>              [,41]        [,42]        [,43]        [,44]        [,45]
#> [1,]  0.0022881353  0.001378863  0.013992648 -0.004568556 -0.004827002
#> [2,] -0.0003547721 -0.012360968 -0.030581227 -0.006221569 -0.005339347
#> [3,] -0.0130403252 -0.008354310  0.003198381  0.001306136 -0.013873720
#>             [,46]        [,47]        [,48]        [,49]         [,50]
#> [1,]  0.015992239 -0.003136211 0.0004486727 -0.007849919 -0.0027648461
#> [2,]  0.009053797  0.006593895 0.0011708094  0.007669743 -0.0004979153
#> [3,] -0.012685813 -0.005633859 0.0163056370 -0.005934213  0.0031216286
#>              [,51]        [,52]        [,53]         [,54]        [,55]
#> [1,]  0.0010699068  0.002531345 -0.002208731  0.0005200123 -0.013192285
#> [2,] -0.0048142218  0.004180498  0.018015934  0.0099572629  0.011701875
#> [3,] -0.0001270987 -0.013416174 -0.005682184 -0.0121992061  0.006283033
#>            [,56]       [,57]         [,58]        [,59]         [,60]
#> [1,] -0.01104889  0.01749528  0.0009816162  0.007387407  0.0001268182
#> [2,]  0.01477725 -0.01209617 -0.0191261665  0.007671694 -0.0186405224
#> [3,]  0.01007955  0.01041710 -0.0084539360 -0.014745555  0.0088529813
#>             [,61]        [,62]       [,63]       [,64]        [,65]       [,66]
#> [1,]  0.004924303  0.004997546 0.009807005 0.004566625  0.001893418 -0.01318152
#> [2,]  0.017470740 -0.006888988 0.009233165 0.003169418 -0.013194094  0.01246549
#> [3,] -0.002619993 -0.009825800 0.003306873 0.004091469 -0.020012100 -0.01119783
#>            [,67]       [,68]         [,69]       [,70]        [,71]
#> [1,] 0.006001131 0.003238030 -1.953124e-05 0.009381559 -0.013512000
#> [2,] 0.007982218 0.006504944 -3.088218e-03 0.001026791 -0.004557810
#> [3,] 0.001838808 0.015829795 -6.231227e-03 0.010879801 -0.002508356
#>             [,72]        [,73]         [,74]        [,75]        [,76]
#> [1,]  0.005053471  0.002267423 -0.0025862055 -0.009931054 -0.003188478
#> [2,]  0.006540223 -0.011573391 -0.0009818012  0.008689231  0.001248408
#> [3,] -0.002153623  0.020328003 -0.0035316125 -0.018163843 -0.014689920
#>             [,77]         [,78]        [,79]         [,80]       [,81]
#> [1,]  0.010685086 -0.0181763579 -0.013506908 -0.0009461619 0.006702862
#> [2,] -0.004821798 -0.0027858312  0.009194744  0.0017830377 0.001821383
#> [3,]  0.006596155  0.0006773525  0.002725277 -0.0005391045 0.015386113
#>             [,82]        [,83]        [,84]         [,85]       [,86]
#> [1,] -0.004165526 0.0216178727 -0.003526023 -0.0013603668 0.006156816
#> [2,]  0.008743172 0.0002761923 -0.020868780  0.0009219266 0.013618260
#> [3,]  0.001409836 0.0012834286 -0.019738655 -0.0069026356 0.017131362
#>             [,87]        [,88]        [,89]        [,90]         [,91]
#> [1,] -0.021795508  0.006929014 -0.002879527  0.008928262 -0.0069941525
#> [2,]  0.008098478  0.011278569  0.010193279 -0.008016859  0.0088278759
#> [3,]  0.009466466 -0.001473972 -0.006766171 -0.005871781 -0.0005988829
#>             [,92]        [,93]       [,94]        [,95]        [,96]
#> [1,]  0.005381417 0.0132718965 -0.01181221 -0.007646915  0.004402012
#> [2,]  0.023760439 0.0062375965  0.02845465  0.011259196 -0.015665725
#> [3,] -0.009941079 0.0001541559 -0.01658575 -0.015538693  0.004531512
#>            [,97]        [,98]        [,99]       [,100]
#> [1,] 0.021767122  0.007265324 -0.005312849 -0.000757480
#> [2,] 0.001983127 -0.007958980  0.003566891  0.007995912
#> [3,] 0.004812077 -0.009604183 -0.010722186 -0.005480709
#> 
#> $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