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(N, p, T, d = 0)
Arguments
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
sv = specify_starting_values_bsvar_sv$new(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
sv = specify_starting_values_bsvar_sv$new(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
sv = specify_starting_values_bsvar_sv$new(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
sv = specify_starting_values_bsvar_sv$new(N = 3, p = 1, T = 100)
sv$get_starting_values() # show starting values as list
#> $B
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
#>
#> $A
#> [,1] [,2] [,3] [,4]
#> [1,] 0.1724397 0.0000000 0.0000000 0
#> [2,] 0.0000000 0.7429208 0.0000000 0
#> [3,] 0.0000000 0.0000000 0.9997217 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.021612288 0.008126146 0.003490994 -0.0016776218 0.015749886
#> [2,] -0.008030475 -0.001507548 0.008238069 -0.0026396894 -0.008348880
#> [3,] 0.002720406 -0.003846430 -0.011856301 0.0005098174 -0.001334643
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] -0.015393885 -0.004132802 -0.0006254742 0.006970197 -0.0009702798
#> [2,] -0.006347785 -0.005951713 -0.0069882075 -0.011170922 0.0040754608
#> [3,] -0.001566627 0.003534932 -0.0113653809 0.008401731 -0.0157359894
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] -0.0003126084 0.01018536 -0.013145388 0.0105681581 -0.004409704
#> [2,] 0.0019467685 -0.00412112 0.003993779 0.0051861901 -0.013277797
#> [3,] 0.0180590442 0.02158589 0.003343193 -0.0006594678 0.011827320
#> [,16] [,17] [,18] [,19] [,20]
#> [1,] -0.0002147056 0.008043510 0.004775182 -0.005861768 0.004481916
#> [2,] -0.0060870934 0.002793207 0.025806527 0.011381931 0.003323727
#> [3,] 0.0092413987 -0.016627234 -0.014856331 0.001645958 -0.003682558
#> [,21] [,22] [,23] [,24] [,25]
#> [1,] 0.005895774 -0.017293615 -0.0053981658 -0.025541862 -0.019615008
#> [2,] 0.002412775 -0.000295593 -0.0009673187 0.009869839 -0.012549487
#> [3,] -0.010614344 -0.022025861 0.0248794521 -0.007126587 0.005804946
#> [,26] [,27] [,28] [,29] [,30]
#> [1,] -0.0020346306 -0.001335620 0.011958440 -0.003204292 -0.022456892
#> [2,] 0.0005079232 -0.014897860 0.006905974 0.005963783 -0.015141157
#> [3,] -0.0040014858 0.008833194 -0.012423229 0.005158945 -0.007564063
#> [,31] [,32] [,33] [,34] [,35]
#> [1,] -0.018633807 0.009450098 -0.027837200 0.003090449 -0.0038045583
#> [2,] 0.008459447 -0.001638288 -0.007337952 -0.002614046 0.0261804426
#> [3,] -0.003900851 0.013124931 0.009111634 0.014963546 -0.0002968015
#> [,36] [,37] [,38] [,39] [,40]
#> [1,] -0.008252080 0.012842477 -0.019360789 0.017295332 -0.0022933009
#> [2,] -0.001592488 0.009742263 0.005604401 0.003503472 -0.0003665326
#> [3,] 0.007052362 -0.008883104 0.001156568 0.014150943 -0.0018688598
#> [,41] [,42] [,43] [,44] [,45]
#> [1,] 0.015436758 0.000991085 -0.006963615 0.008459345 0.003124491
#> [2,] 0.007379712 -0.008546249 -0.004553565 -0.015401289 0.001242641
#> [3,] -0.006587394 -0.026307898 -0.005669467 -0.003191430 -0.006142207
#> [,46] [,47] [,48] [,49] [,50]
#> [1,] 0.012149766 0.001456363 0.005506607 -0.012994966 0.008962899
#> [2,] 0.026721692 0.013597397 -0.012472330 -0.009698069 -0.015783147
#> [3,] 0.000281145 0.007478900 -0.004219798 -0.010415064 0.002677904
#> [,51] [,52] [,53] [,54] [,55]
#> [1,] -0.003993609 0.007535749 -0.007751351 -0.005973208 -0.002174144
#> [2,] 0.002768838 0.002892610 -0.010098992 -0.008253076 0.004924628
#> [3,] -0.012336734 0.006751361 -0.016365588 0.001064745 0.006057191
#> [,56] [,57] [,58] [,59] [,60]
#> [1,] 7.452784e-05 0.006166264 0.0033949389 0.004699604 0.005968186
#> [2,] 7.314330e-03 0.009944430 -0.0004420799 0.001270096 -0.008289777
#> [3,] 1.317021e-02 0.014752989 0.0052761755 -0.006044346 -0.005951585
#> [,61] [,62] [,63] [,64] [,65]
#> [1,] -0.002692328 0.023663542 0.026045320 0.01258888 -0.008501468
#> [2,] -0.007290295 0.009525284 -0.006116513 0.01164565 -0.013467661
#> [3,] -0.002540654 -0.007621432 0.002204874 0.01042197 0.014110075
#> [,66] [,67] [,68] [,69] [,70]
#> [1,] -0.0005591457 -0.017494876 0.005350613 -0.0007609591 -0.004645199
#> [2,] 0.0025467005 -0.001231833 0.012529453 0.0003885036 -0.009601149
#> [3,] 0.0045757485 0.008942703 -0.004388822 -0.0025769560 -0.002521798
#> [,71] [,72] [,73] [,74] [,75]
#> [1,] -0.013256878 -0.013165680 0.009037817 -0.004780391 -0.008306659
#> [2,] -0.014740299 0.022901524 -0.005152231 0.011795862 -0.019643248
#> [3,] -0.005382143 0.003471308 -0.015019407 0.010762719 -0.003537733
#> [,76] [,77] [,78] [,79] [,80]
#> [1,] -0.002960882 -0.015649476 0.003169280 0.003075332 -0.002942787
#> [2,] 0.008327142 0.006793592 -0.001871441 0.004988269 0.010810942
#> [3,] -0.006229487 -0.007494661 -0.004445135 -0.009333087 -0.002681281
#> [,81] [,82] [,83] [,84] [,85]
#> [1,] -0.014995863 -0.004547214 0.011589379 0.003132056 0.010403710
#> [2,] -0.011797146 0.001901129 0.001243548 -0.006011026 -0.006229990
#> [3,] 0.007522322 0.015001833 -0.002882015 0.001730761 0.009543483
#> [,86] [,87] [,88] [,89] [,90]
#> [1,] 0.008827531 -0.004596537 -0.025143830 0.0032238547 -0.005437009
#> [2,] 0.007185596 0.009228225 0.003297132 -0.0006871083 0.013102871
#> [3,] 0.006522424 0.005104159 0.005358643 0.0060866800 0.004436278
#> [,91] [,92] [,93] [,94] [,95]
#> [1,] -0.004631615 -0.007834870 -0.019030672 0.012089017 -0.010011102
#> [2,] 0.008599724 -0.009014487 -0.002331658 0.004311866 0.006779871
#> [3,] 0.013281036 -0.007885190 -0.016455942 -0.003474949 0.004986291
#> [,96] [,97] [,98] [,99] [,100]
#> [1,] -0.002657534 -0.0001746616 -0.010468327 0.007713402 -0.0126683538
#> [2,] 0.015641733 0.0020546477 0.009335053 -0.004827960 0.0116656607
#> [3,] -0.017705081 0.0060621106 -0.004448197 -0.010974065 0.0003223347
#>
#> $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
sv = specify_starting_values_bsvar_sv$new(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