sot_avg_exact: Calculation of the Exact Values for Average, Minimal, and...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/SOT_avg_exact.r

Description

Calculates the exact values of the average, the minimum, and the maximum entries of a spillover tables based on different permutations.

Usage

1
sot_avg_exact(Sigma, A, ncores = 1)

Arguments

Sigma

Either a covariance matrix or a list thereof.

A

Either a 3-dimensional array with A[,,h] being MA coefficient matrices of the same dimension as Sigma or a list thereof.

ncores

Number of cores, only relevant for 'list' version. In this case, missing ncores or ncores=1 means no parallelization (just one core is used), ncores=0 means automatic detection of the number of available cores, any other integer determines the maximal number of cores to be used.

Details

The spillover tables introduced by Diebold and Yilmaz (2009) (see References) depend on the ordering of the model variables. While sot_avg_est provides an algorithm to estimate average, minimal, and maximal values of the spillover table over all permutations, sot_avg_est calculates these quantities exactly. Notice, however, that for large dimensions N, this might be quite time- as well as memory-consuming.

The typical application of the 'list' version of sot_avg_exact is a rolling windows approach when Sigma and A are lists representing the corresponding quantities at different points in time (rolling windows).

Value

The 'single' version returns a list containing the exact average, minimal, and maximal values for the spillover table. The 'list' version returns a list with three elements (Average, Minimum, Maximum) which themselves are lists of the corresponding tables.

Author(s)

Stefan Kloessner (S.Kloessner@mx.uni-saarland.de),
with contributions by Sven Wagner (sven.wagner@mx.uni-saarland.de)

References

[1] Diebold, F. X. and Yilmaz, K. (2009): Measuring financial asset return and volatitliy spillovers, with application to global equity markets, Economic Journal 199(534): 158-171.

[2] Kloessner, S. and Wagner, S. (2012): Exploring All VAR Orderings for Calculating Spillovers? Yes, We Can! - A Note on Diebold and Yilmaz (2009), Journal of Applied Econometrics 29(1): 172-179

See Also

fastSOM-package, sot_avg_est

Examples

1
2
3
4
5
6
7
8
9
# generate randomly positive definite matrix Sigma of dimension N 
N <- 10
Sigma <- crossprod(matrix(rnorm(N*N),nrow=N)) 
# generate randomly coefficient matrices
H <- 10 
A <- array(rnorm(N*N*H),dim=c(N,N,H)) 
# calculate the exact average, minimal, 
# and maximal entries within a spillover table
sot_avg_exact(Sigma, A) 

Example output

$Average
           [,1]      [,2]      [,3]     [,4]      [,5]      [,6]      [,7]
 [1,] 14.825364  7.867626  8.506537 5.496627  8.795434 14.844105  7.051553
 [2,] 10.252705  8.317974  5.757847 4.201129  9.791842 14.880491 11.023404
 [3,] 18.511416  7.711029  8.191951 3.500014  4.355770  9.306053  5.008147
 [4,] 11.038359 13.276920  5.693677 4.095960  5.474803 10.688028 17.229365
 [5,]  8.873401 11.465916 10.209360 5.279179  7.172354 14.229914 10.430407
 [6,]  8.728716 11.518819  6.436628 4.918960  4.785127 16.454067 10.071042
 [7,] 15.005952  6.758312  8.801740 6.798204  8.595557 13.167604  5.565243
 [8,] 17.915228 13.434036  4.208751 4.055034  6.492516  9.309822  7.741718
 [9,] 23.204723  6.042415  6.002176 5.157739  8.896855  5.534564  4.531013
[10,] 15.100626 11.322085  6.177290 5.578415 12.419195  4.686658  8.489457
           [,8]      [,9]     [,10]
 [1,]  5.065729  6.822080 20.724945
 [2,]  8.018874 12.483791 15.271944
 [3,] 14.662245 14.977014 13.776361
 [4,] 12.305974  9.120816 11.076098
 [5,]  4.745754 11.690679 15.903037
 [6,]  8.344373 10.514000 18.228270
 [7,]  3.784470 10.603212 20.919704
 [8,]  9.599946 13.335855 13.907095
 [9,] 15.532331 16.674549  8.423634
[10,]  7.928878 16.764054 11.533342

$Minimum
           [,1]     [,2]      [,3]       [,4]      [,5]      [,6]      [,7]
 [1,] 1.3832640 1.752439 0.7638845 0.14548621 0.4288127 0.6179213 1.0310027
 [2,] 0.5051805 1.386896 0.3905789 0.06852862 0.4843531 0.8832763 2.1490451
 [3,] 2.4992070 1.774800 0.5961668 0.09822310 0.2542988 0.6825992 0.5553754
 [4,] 0.8141716 2.079408 0.5269309 0.10925737 0.3126513 0.7503779 4.7887562
 [5,] 1.0458660 3.196852 0.7554046 0.08823491 0.4418585 1.1866210 1.5178725
 [6,] 0.8130034 2.149076 0.6012360 0.15235716 0.1413642 1.3043141 1.8850852
 [7,] 1.1120987 1.950884 0.7867752 0.13910343 0.5940523 0.7771537 1.6898287
 [8,] 2.0782105 2.606355 0.1200207 0.01943590 0.4440821 1.0301609 1.2728559
 [9,] 2.2657255 1.799415 0.4194323 0.04866972 0.7296359 0.4833795 0.8553796
[10,] 1.3660604 2.830868 0.2480203 0.03196136 0.5383637 0.2758587 1.3292769
          [,8]      [,9]     [,10]
 [1,] 1.467688 0.6747014 2.3025523
 [2,] 1.473614 2.8498445 1.1144064
 [3,] 5.722879 3.5541503 1.2701110
 [4,] 4.222923 1.5652493 0.5286116
 [5,] 1.478762 3.0295387 0.6735909
 [6,] 2.033208 2.2567823 1.3108098
 [7,] 1.082462 1.9075987 1.9570582
 [8,] 2.866388 3.9952087 0.9856814
 [9,] 3.830232 2.4786829 0.2623241
[10,] 1.932011 4.8415358 0.7170907

$Maximum
          [,1]     [,2]     [,3]     [,4]     [,5]     [,6]     [,7]      [,8]
 [1,] 26.94833 15.90021 19.32062 13.64599 19.72601 34.92008 20.01436 12.413514
 [2,] 27.03984 18.55760 13.80730 14.69616 24.55488 29.48349 24.63670 20.055334
 [3,] 40.14332 14.70910 26.33158 20.29138 16.74133 19.36675 15.23218 29.746039
 [4,] 23.81347 32.37727 14.91286 13.93277 19.17334 19.69181 35.14968 25.773646
 [5,] 17.03462 21.21085 21.43457 15.24655 18.24748 28.37173 24.20324 10.324961
 [6,] 24.37414 23.64715 13.58222 18.68180 15.31756 36.43361 21.89946 18.649163
 [7,] 33.32940 15.71694 23.93008 23.07494 22.32932 29.96544 14.59449  9.344535
 [8,] 34.00241 22.03938 11.44272 10.20226 14.54621 20.56627 17.49354 18.140716
 [9,] 47.60151 14.71509 22.58622 16.55474 27.92030 16.96014 20.15699 38.165197
[10,] 30.61271 22.59309 15.03728 14.85619 24.23513 13.12054 23.55046 18.428536
          [,9]    [,10]
 [1,] 16.31772 39.26994
 [2,] 28.83195 30.67938
 [3,] 31.27941 29.37634
 [4,] 23.67388 21.19086
 [5,] 21.36771 31.84873
 [6,] 24.33401 40.92046
 [7,] 20.77421 45.59178
 [8,] 22.76611 29.80152
 [9,] 41.45571 21.96433
[10,] 29.15940 26.26112

$Average_p
           [,1]     [,2]     [,3]     [,4]     [,5]     [,6]     [,7]      [,8]
 [1,] 8.7922883 4.245092 4.311358 3.082816 5.391202 8.404842 4.686997 1.5191761
 [2,] 4.0871519 4.489136 3.778046 2.263271 2.032197 8.261705 7.464712 2.5926703
 [3,] 0.1045237 2.846297 2.513861 3.047891 2.030563 7.048063 2.824293 1.4241466
 [4,] 8.3633624 3.046526 2.573445 2.157266 3.417913 7.301176 1.715980 8.9140157
 [5,] 6.4070426 3.003690 4.652230 1.819492 3.872013 2.712221 4.893384 1.3487457
 [6,] 6.1408930 7.082711 4.432031 2.841314 2.092216 9.935038 3.338673 5.8316282
 [7,] 8.2102816 6.133782 8.270157 2.947338 1.513925 3.616154 5.263166 2.5430052
 [8,] 7.1043603 9.938383 2.346330 2.322889 2.361956 4.525325 5.833334 2.9463797
 [9,] 2.7567468 2.111375 0.691758 3.070014 5.466721 3.524945 2.139830 1.0492752
[10,] 5.6989268 7.775842 3.023033 1.451098 3.087900 2.476695 5.407140 0.8004471
           [,9]     [,10]
 [1,]  3.347118  9.880353
 [2,]  8.473732  8.773767
 [3,] 12.883956  1.239925
 [4,]  2.604188  3.923922
 [5,]  4.793351 13.525707
 [6,]  2.301680 10.141931
 [7,]  1.222949 11.700386
 [8,]  7.753030  7.707790
 [9,] 13.627709  1.168438
[10,] 10.959474  7.781634

$Minimum_p
           [,1]      [,2]       [,3]        [,4]       [,5]       [,6]
 [1,] 0.7098328 0.9522517 0.40018847 0.041829897 0.31169606 0.38021033
 [2,] 0.2605833 0.5433848 0.28397814 0.024744191 0.13921307 0.65199238
 [3,] 0.0000000 0.2192629 0.02564810 0.068148234 0.00000000 0.34248913
 [4,] 0.6306196 0.3977004 0.07005170 0.038498636 0.11960490 0.54124079
 [5,] 0.6373477 0.4094019 0.38356898 0.014561273 0.07750277 0.19455787
 [6,] 0.5957935 0.9688491 0.07757327 0.137967226 0.02366347 0.56412371
 [7,] 0.3729528 0.8039676 0.76024443 0.003511172 0.10913004 0.01594846
 [8,] 0.6664304 2.0657027 0.05069405 0.014652589 0.17722389 0.63263376
 [9,] 0.2345567 0.1652160 0.06007597 0.010051670 0.43146788 0.25547720
[10,] 0.4549219 2.1328581 0.08141863 0.017098062 0.07066559 0.06783587
            [,7]       [,8]      [,9]      [,10]
 [1,] 0.59890432 0.13380886 0.2121991 1.14005676
 [2,] 1.59208185 0.88087224 1.8546787 0.71530184
 [3,] 0.06772678 0.10513841 1.3245258 0.00000000
 [4,] 0.09378978 2.34600987 0.3530244 0.12495305
 [5,] 0.30813813 0.04947843 0.4714376 0.51845163
 [6,] 0.24121354 0.83380515 0.3281914 0.91598793
 [7,] 1.33474587 0.31457582 0.3850706 0.42149418
 [8,] 1.06870256 0.52162466 1.7887108 0.76764465
 [9,] 0.06281694 0.07326361 1.6593466 0.06088944
[10,] 0.13648384 0.04059785 2.8878158 0.40924038

$Maximum_p
           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
 [1,] 18.724741 10.532164 10.013656  7.858014 11.700335 21.020824 11.052182
 [2,]  8.876022 12.009091 11.237169  9.227964  8.008279 16.383966 19.708536
 [3,]  1.863197  8.267499  6.605494 19.929003  7.671046 17.094897 14.094127
 [4,] 21.382380  7.182245  9.580654  7.174316 12.141066 13.685163  4.425069
 [5,] 15.378128 11.225335 14.428813  4.992795 12.792449  5.922839 14.003433
 [6,] 20.384345 14.296769 10.719407 11.583574  8.592869 20.902581  8.984571
 [7,] 21.309815 15.695405 21.750760 10.676021 13.514881 11.377355 14.552327
 [8,] 13.924609 17.284664  6.215452  8.081780  5.763715 10.299151 12.512263
 [9,]  6.584970  5.996059  2.288429 13.729618 11.670969  9.000503 16.660719
[10,] 14.167979 17.553033  9.393068  7.028120  6.785565  9.218819 18.116415
           [,8]      [,9]     [,10]
 [1,]  4.239933  9.481666 18.604269
 [2,]  5.105580 23.514035 17.786939
 [3,]  4.704754 29.929735  7.088065
 [4,] 20.492541  6.853501 10.214085
 [5,]  3.953239 12.055552 28.078627
 [6,] 14.578135  6.698264 19.754360
 [7,]  8.265094  3.656005 27.837586
 [8,]  7.156997 16.541506 15.454635
 [9,]  3.033824 36.197090  7.304693
[10,]  3.313782 24.664398 21.256670

$Average_n
           [,1]       [,2]      [,3]      [,4]     [,5]      [,6]       [,7]
 [1,]  6.033075  3.6225332 4.1951786 2.4138109 3.404233  6.439263  2.3645559
 [2,]  6.165553  3.8288372 1.9798007 1.9378579 7.759645  6.618787  3.5586921
 [3,] 18.406892  4.8647319 5.6780902 0.4521226 2.325206  2.257991  2.1838544
 [4,]  2.674997 10.2303932 3.1202319 1.9386948 2.056889  3.386851 15.5133851
 [5,]  2.466358  8.4622258 5.5571301 3.4596866 3.300340 11.517693  5.5370231
 [6,]  2.587823  4.4361078 2.0045974 2.0776461 2.692910  6.519028  6.7323685
 [7,]  6.795670  0.6245303 0.5315834 3.8508656 7.081633  9.551450  0.3020772
 [8,] 10.810867  3.4956528 1.8624206 1.7321443 4.130560  4.784497  1.9083831
 [9,] 20.447976  3.9310407 5.3104180 2.0877248 3.430134  2.009619  2.3911824
[10,]  9.401700  3.5462424 3.1542567 4.1273164 9.331295  2.209963  3.0823171
           [,8]     [,9]     [,10]
 [1,]  3.546553 3.474963 10.844592
 [2,]  5.426204 4.010059  6.498177
 [3,] 13.238099 2.093059 12.536436
 [4,]  3.391958 6.516628  7.152177
 [5,]  3.397009 6.897328  2.377330
 [6,]  2.512745 8.212320  8.086339
 [7,]  1.241465 9.380264  9.219319
 [8,]  6.653567 5.582825  6.199306
 [9,] 14.483056 3.046840  7.255196
[10,]  7.128431 5.804580  3.751708

$Minimum_n
            [,1]         [,2]        [,3]        [,4]       [,5]       [,6]
 [1,] 0.60528496 7.168007e-01 0.363696018 0.088953005 0.03523944 0.21109897
 [2,] 0.14961448 6.986486e-01 0.095703206 0.043784432 0.30276737 0.22393701
 [3,] 2.45576104 7.770768e-01 0.330835369 0.005342222 0.06297877 0.02034394
 [4,] 0.02099932 1.486352e+00 0.137969729 0.010963306 0.16890693 0.05793159
 [5,] 0.19400323 1.910818e+00 0.073999281 0.014549699 0.08538094 0.90016493
 [6,] 0.21720985 6.068807e-01 0.349825634 0.013775652 0.11770071 0.34649305
 [7,] 0.39117570 8.581811e-05 0.004075093 0.113570814 0.45024375 0.67102238
 [8,] 1.41178005 5.406528e-01 0.069326634 0.004783311 0.16734050 0.39752711
 [9,] 1.84344070 1.081692e+00 0.210791581 0.014557127 0.07634666 0.15018828
[10,] 0.72955906 6.506966e-01 0.079408734 0.007938412 0.18720884 0.16838477
           [,7]       [,8]      [,9]     [,10]
 [1,] 0.1805289 1.33265570 0.4625024 0.9597927
 [2,] 0.4025595 0.59274147 0.6950773 0.3991046
 [3,] 0.1358969 4.45860788 0.3325959 0.5187230
 [4,] 4.3033334 0.99833890 1.0225736 0.1881861
 [5,] 0.9858504 1.36815370 2.3903503 0.1380466
 [6,] 1.2138807 1.05466797 1.6662168 0.3049281
 [7,] 0.0000000 0.03747624 1.4558050 0.0000000
 [8,] 0.1061536 2.09295613 1.4178510 0.2006851
 [9,] 0.3470208 3.71115545 0.5818651 0.1940688
[10,] 0.8823256 1.47124450 1.7034026 0.1855961

$Maximum_n
           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
 [1,] 14.447403  7.950353 11.964072  6.448267  8.764984 14.205530 11.345555
 [2,] 22.165872  7.403333  8.862350  7.847369 19.579119 14.616821  7.719528
 [3,] 40.143324 13.196407 25.928368  2.260993 16.173936  9.603122  8.396840
 [4,]  7.659577 26.661025  9.252189  7.653696  7.046306  9.006252 30.930102
 [5,] 10.218458 17.573650 13.867620 12.922173  8.496973 23.798952 16.605115
 [6,]  6.692435 14.616401  6.036888  7.529699 11.659866 16.169157 17.359737
 [7,] 16.996655  3.680182  2.314989 19.354482 15.884901 24.164002  3.787263
 [8,] 21.413018  7.855111  7.795027  5.902281 10.644440 11.930092  6.516849
 [9,] 43.418275 11.961335 21.648079  7.514391 23.395106 13.541142  5.943951
[10,] 27.991454  7.034686  8.795488 11.524046 18.635442  6.117979  6.944079
           [,8]      [,9]     [,10]
 [1,]  8.643531  7.340169 22.134447
 [2,] 15.660579  9.269914 14.515158
 [3,] 28.827897  5.449738 28.527170
 [4,]  5.868927 20.030763 16.126866
 [5,]  8.190948 13.078935  6.070533
 [6,]  6.288200 19.529832 24.723645
 [7,]  5.983028 19.512284 20.786528
 [8,] 12.572576 12.379640 16.956830
 [9,] 35.728993  6.345866 20.019686
[10,] 17.394703 12.377402  9.442533

fastSOM documentation built on Nov. 19, 2019, 5:08 p.m.