Skip to contents

The class StartingValuesBSVARSV presents starting values for the bsvar model with Stochastic Volatility heteroskedasticity.

Super class

bsvars::StartingValuesBSVAR -> StartingValuesBSVARSV

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

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.

Returns

Starting values StartingValuesBSVARSV.


Method get_starting_values()

Returns the elements of the starting values StartingValuesBSVARSV as a list.

Usage

specify_starting_values_bsvar_sv$get_starting_values()

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.

Usage

specify_starting_values_bsvar_sv$set_starting_values(last_draw)

Arguments

last_draw

a list containing the last draw of the current MCMC run.

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


Method clone()

The objects of this class are cloneable with this method.

Usage

specify_starting_values_bsvar_sv$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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.8457883 0.0000000 0.0000000    0
#> [2,] 0.0000000 0.9116633 0.0000000    0
#> [3,] 0.0000000 0.0000000 0.3401287    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.0061547568 -0.0009748829  0.017424056 0.0032085934  0.01181298
#> [2,] -0.0005394542  0.0065970443 -0.003433439 0.0079229965 -0.01231080
#> [3,]  0.0110525190 -0.0003763769 -0.006247019 0.0008192614  0.00277681
#>              [,6]         [,7]        [,8]         [,9]        [,10]
#> [1,] -0.006307800 -0.002018158 0.008100630  0.002350413 -0.007707794
#> [2,] -0.005751098 -0.003643292 0.019201436  0.012681672  0.011832309
#> [3,] -0.017366401  0.006180302 0.002858078 -0.003393401  0.002967266
#>             [,11]        [,12]       [,13]        [,14]         [,15]
#> [1,] -0.016275942 -0.010116591 -0.01784367  0.004660247 -0.0004990214
#> [2,]  0.006408984  0.003850714 -0.01476810 -0.010933120  0.0215456694
#> [3,]  0.001669453 -0.011521808  0.02138358 -0.011119131  0.0079041599
#>             [,16]         [,17]        [,18]        [,19]        [,20]
#> [1,]  0.005173063 -0.0007430059 -0.016204562 -0.006694691  0.003062961
#> [2,] -0.003062585  0.0150457482 -0.005860599 -0.015263245 -0.005846445
#> [3,] -0.008213032  0.0033581476  0.001010383  0.008542779  0.016462215
#>             [,21]         [,22]        [,23]         [,24]       [,25]
#> [1,] -0.003116145 -2.757551e-03 -0.004446302  0.0005933797  0.00926511
#> [2,] -0.006049964 -9.437122e-05  0.014505029  0.0194931165  0.01442811
#> [3,] -0.020828183 -1.475961e-02  0.016491117 -0.0002074989 -0.01768180
#>             [,26]        [,27]       [,28]       [,29]        [,30]
#> [1,] -0.013388304  0.004689481 0.005872094 0.007190472  0.005347300
#> [2,] -0.003739956  0.009004352 0.016240277 0.010494901 -0.007398217
#> [3,] -0.007209744 -0.015962603 0.017192160 0.012258145 -0.005115748
#>             [,31]        [,32]        [,33]        [,34]         [,35]
#> [1,]  0.001680346 -0.015557479  0.004850973 -0.006549366  0.0119917048
#> [2,] -0.002978681 -0.003564303 -0.016898429 -0.003903867 -0.0167470183
#> [3,] -0.002143282  0.004772220 -0.007992287  0.007761385 -0.0008899787
#>             [,36]        [,37]        [,38]        [,39]       [,40]
#> [1,] -0.007967197 -0.017080980 -0.015354178  0.011532571 0.002338068
#> [2,]  0.016100603  0.013897734  0.012196004 -0.011182482 0.010049418
#> [3,]  0.008703733  0.006037629  0.005946498  0.001705108 0.009287470
#>             [,41]       [,42]         [,43]        [,44]        [,45]
#> [1,]  0.003619921 0.012816078  0.0041235091 -0.017452001 -0.021318896
#> [2,]  0.003594549 0.005200726 -0.0009146522  0.008511630 -0.003873733
#> [3,] -0.003124052 0.026958420  0.0042679397  0.001480645  0.003726960
#>             [,46]        [,47]        [,48]        [,49]       [,50]
#> [1,]  0.007285623 -0.002937737  0.006509775  0.006528708 0.004940669
#> [2,]  0.007897704  0.011566697 -0.004274386  0.003918609 0.012851522
#> [3,] -0.014537727 -0.010196348 -0.003355772 -0.006197163 0.002492892
#>            [,51]        [,52]        [,53]        [,54]        [,55]
#> [1,] 0.026580770 -0.016055620 -0.001780814 -0.011833885 -0.009685781
#> [2,] 0.010019329 -0.006651025  0.002169854  0.011881919  0.001172852
#> [3,] 0.003530196  0.005956413 -0.002246625  0.004604253 -0.016650664
#>            [,56]        [,57]        [,58]        [,59]        [,60]
#> [1,] 0.001703412 -0.006065237 -0.004808695  0.012989299 -0.002610542
#> [2,] 0.005949471 -0.014835492  0.013290200  0.010988166 -0.009727378
#> [3,] 0.005094825  0.017735418  0.005446883 -0.007888098 -0.012349384
#>             [,61]       [,62]        [,63]        [,64]        [,65]
#> [1,] -0.005037586 0.005252110  0.001110508 -0.006130888 -0.007096768
#> [2,] -0.009227789 0.008939577 -0.005512513  0.002729460 -0.008162279
#> [3,]  0.009606334 0.007616883 -0.012705558 -0.007592521 -0.004714258
#>             [,66]         [,67]        [,68]        [,69]        [,70]
#> [1,]  0.007873072  0.0001214382  0.006036887  0.002059482 -0.005786867
#> [2,] -0.008778095  0.0092165594  0.014692212  0.004902009 -0.009381668
#> [3,] -0.009283837 -0.0051378762 -0.007882756 -0.001608686  0.010550668
#>            [,71]        [,72]        [,73]        [,74]        [,75]
#> [1,] 0.008407538  0.012616940 -0.002110728 -0.013172964 -0.018944721
#> [2,] 0.013135427 -0.007421876 -0.001602807 -0.007382738 -0.004354343
#> [3,] 0.007334300  0.013384093  0.003964295  0.009235466  0.004797217
#>             [,76]        [,77]       [,78]        [,79]        [,80]
#> [1,] -0.012184337 -0.018591822 0.008835975 -0.002413198  0.014039783
#> [2,] -0.003690786 -0.003006536 0.007622825  0.010643070  0.019003567
#> [3,]  0.013082040  0.002489201 0.001269533 -0.001745509 -0.004721778
#>              [,81]        [,82]        [,83]       [,84]        [,85]
#> [1,] -4.594234e-03  0.001048896  0.006069099 0.011596623  0.018572074
#> [2,] -3.457165e-05 -0.007201395  0.006166948 0.009990046 -0.001161742
#> [3,] -2.628949e-02 -0.001280286 -0.006370288 0.007998553  0.005623501
#>             [,86]         [,87]        [,88]        [,89]        [,90]
#> [1,]  0.006541349 -0.0002899706 -0.005502633 -0.005874961 -0.007747788
#> [2,] -0.003306369  0.0048719811  0.015351312 -0.010558351 -0.002842088
#> [3,]  0.005322619 -0.0036330664 -0.011171726 -0.008901852 -0.007980138
#>              [,91]        [,92]        [,93]       [,94]        [,95]
#> [1,] -0.0020929983  0.007573401 -0.009508486 0.006842019 -0.015543417
#> [2,]  0.0085544566 -0.002514830 -0.009671339 0.005666502  0.015785421
#> [3,] -0.0005568736 -0.022899619 -0.020798410 0.031483696  0.009932466
#>             [,96]        [,97]        [,98]       [,99]       [,100]
#> [1,]  0.005233490 -0.004549276 -0.009723044 -0.01110131  0.013877281
#> [2,] -0.008854159 -0.019660091 -0.007802829  0.01312024  0.007845001
#> [3,] -0.005767871  0.006528192  0.012551583  0.01274071 -0.001563459
#> 
#> $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