多维Copula仿真给出了奇怪的(自相关?)模式

时间:2018-02-28 19:54:54

标签: r simulation

我使用df 8从8维t-copula进行模拟,所有维度之间的相关性为0.1。

有3种不同的边缘类型,以下边缘在copula中出现两次:

  1. 具有平均值15和sd 5(第1列和第2列)的正态分布
  2. 具有平均值0和df 5(第7列和第8列)的T分布
  3. 以下分布在8维copula中出现了四次:

    1. 正态分布,均值为5和sd 5(第3-6列)
    2. 我指定了所有的参数,定义了mvdc并用不同的种子数画了50次随机变量,我总能找到这种奇怪的模式,其中col 1& 2在奇数行中总是很高而在偶数行中总是很低。相关的copula函数如下:

       myCop.t <- ellipCopula(family = "t", dim = dim, dispstr = "toep", param = copcor, df = df)
      
              multi.distr <- mvdc(myCop.t, distrvec, paravec, marginsIdentical = FALSE,
                                  check = FALSE, fixupNames = TRUE)
      
              randoms <- rMvdc(50, multi.distr)
      

      copula函数中的各个参数提供了正确的参数,因此在这里不感兴趣,我强烈怀疑实际的代码根本不感兴趣。

      数据输出如下所示:

              V1      V2       V3       V4       V5       V6          V7           V8
      1  16.010861 14.996232 5.701437 6.787819 5.475126 6.990366  1.69338912  2.666378900
      2   7.014132  5.563823 6.515101 4.660104 5.957121 6.781011  0.86962636  2.034051794
      3  15.672679 15.749123 6.239703 5.087319 5.661866 5.419313 -0.03725051  0.115770530
      4   4.323271  7.001562 5.941222 6.291748 4.793068 5.752201  2.03728897  1.857472281
      5  14.368017 16.878522 4.601959 4.832871 4.713307 5.335259 -0.65059333 -0.006805472
      6   6.407364  4.536828 5.434258 5.716145 5.054762 5.886708  0.76146941  0.662944596
      7  15.323959 13.996845 4.740232 6.051559 3.994886 3.556641 -1.00196874  1.034595276
      8   3.739731  5.284797 5.137518 5.345029 4.224926 5.133985  0.60952885  0.232399508
      9  16.092425 15.895005 6.255278 6.480924 5.283971 4.965157  0.97320818  0.516121522
      10  4.333453  5.208740 5.074339 5.606373 4.489304 5.094264  1.04653615 -0.055464950
      11 15.211897 16.096414 6.372798 5.259175 6.041479 4.722053 -0.30172391 -0.199618446
      12  5.851663  4.997275 6.050953 4.413398 5.323346 5.326618  1.07938868  1.115312951
      13 15.815942 15.572386 5.463940 6.088293 5.670306 5.300775  1.56742392  0.686777736
      14  4.446224  4.163309 4.181659 4.777350 4.568136 4.213055 -0.72199878 -0.824398248
      15 14.785817 16.274832 5.669137 5.589509 4.655658 5.689984  0.19452841  1.349848277
      16  4.109499  4.473835 3.919780 3.214149 4.263928 5.531912 -1.11236543 -1.303189568
      17 14.239574 13.276767 4.200647 4.781725 4.326090 4.338101  0.70853038 -0.156449752
      18  6.898483  6.994064 7.815153 6.462504 5.877854 5.384026  1.29072261  0.293196041
      19 15.412930 15.349961 5.018926 5.922361 5.125757 6.700596 -1.12301994 -0.399204202
      20  5.079742  4.748265 5.457855 4.654723 4.731529 4.188034 -0.34238254 -0.690145740
      21 14.141139 13.888448 3.855420 4.827962 4.275877 3.921048 -0.70280816 -1.123617466
      22  5.379309  6.428976 6.218161 4.924798 6.039379 5.474278 -0.05402753  0.808884618
      23 15.810009 16.474434 4.722685 6.654449 5.799382 5.148503  0.21074129 -2.691441462
      24  4.504196  4.134488 6.133392 5.341009 4.146695 5.485827 -0.17429215  0.377224880
      25 15.090372 18.562274 6.940438 8.702905 7.421064 7.234131  0.95681780 13.957746201
      26  5.169069  4.689696 3.945228 3.831344 4.257807 4.485700 -1.25036470 -1.015452283
      27 14.231269 14.573801 3.979783 3.975574 4.059549 3.429011 -0.84782089 -0.708102232
      28  3.466399  4.809140 4.642554 4.000181 5.514467 3.702483 -0.28220028 -2.230534184
      29 14.535945 15.068252 5.389390 3.925671 4.820220 5.385509  0.44983724  0.369502404
      30  5.721859  6.277543 4.951993 6.146136 5.522600 5.546753  2.97382789 -0.285541576
      31 14.032321 14.633016 6.217122 3.954871 5.537166 6.034675  1.20169471 -0.023094229
      32  4.866420  4.272465 3.896341 5.120164 3.583863 4.909106 -0.06676720 -0.296015677
      33 14.833177 15.180053 4.989203 4.202957 4.889351 5.098410 -3.42600028  0.538323743
      34  4.611121  4.268716 4.238652 3.660678 3.547858 4.580510 -1.77435703 -1.665450739
      35 14.528331 13.893190 5.167363 4.361532 4.512446 4.611733 -1.85922632 -0.082607647
      36  4.388169  4.139480 5.073937 5.257833 4.617510 4.309536 -0.97743122 -0.813389458
      37 16.048187 17.595425 6.047185 5.723189 5.221158 5.160128  0.83381764  0.479124155
      38  6.132494  4.633051 5.682781 5.747092 5.825939 5.104212 -0.07316043  1.717729460
      39 15.559974 14.191118 6.874427 6.107418 6.731673 5.141445  0.10187992  0.351784075
      40  5.126939  4.776856 5.626305 5.688585 6.054434 4.635697  0.68777501  0.653913128
      41 14.687924 13.981411 5.854028 3.827776 3.636622 4.875557 -3.74749849 -1.843810747
      42  4.632315  4.789424 5.133586 4.137874 5.002943 4.692032  0.67748217 -0.410707115
      43 15.128650 16.278525 4.222412 3.912493 4.496541 3.582153  2.61045652  0.319884730
      44  3.808546  5.055248 4.049429 4.836402 4.626999 4.031213 -1.70918390 -0.074491627
      45 13.928535 13.631071 3.207690 3.501214 3.869997 3.519227 -2.32473887 -0.374699516
      46  5.291424  5.473507 5.206400 4.055007 5.063000 4.069546  0.88998427 -0.055496756
      47 15.596255 15.095043 4.619923 5.180290 5.550825 5.968506  2.15353841  0.063891460
      48  6.471105  5.759449 5.731538 5.544783 5.612262 5.214522  1.15215748  0.607186739
      49 15.159832 15.716472 4.666025 5.146686 5.394190 5.999513  1.27856163 -0.191519256
      50  3.826062  4.010362 4.285219 3.725003 4.648102 3.732760 -0.54854635 -0.721668612
      

      真正奇怪的是,当我更改第1列和第2列中正态分布的参数时,正态分布的平均值仍为15,但sd也是15(之前为5)数据似乎是&#34;对&#34;再次,行之间没有模式。样本输出的模拟如下:

               V1       V2       V3       V4       V5       V6           V7          V8
      1  14.83778 15.50690 5.404255 6.529869 3.723583 5.804804 -0.023806934  1.31729448
      2  14.89108 15.52742 4.546552 4.133864 3.798082 3.944486 -0.958503275 -0.25154357
      3  15.18946 14.42179 3.942194 5.375967 5.513438 5.338239 -0.941209336  1.02601868
      4  13.89376 15.06167 5.741713 4.913896 4.800117 6.500235 -0.221074057 -0.32954484
      5  15.25007 14.58085 4.518882 5.137600 4.328629 5.634427 -0.934152880 -1.50506026
      6  17.57606 16.87651 6.309456 4.743752 4.066471 5.642209  0.777167206 -0.22662543
      7  17.08080 12.29113 6.133664 5.059785 5.264676 4.733923 -0.219459993 -1.12209908
      8  15.93970 14.43690 4.057061 5.064182 5.326703 5.564106 -1.250717314  0.94948212
      9  16.24507 14.48802 4.975028 5.761803 6.711075 4.221429 -1.024120847 -0.33025094
      10 15.47580 14.91176 4.118495 4.555365 5.210769 5.204387  0.829185436 -0.04127958
      11 13.50148 16.05232 5.492861 4.048113 5.125046 6.086061  0.167497301 -1.17138922
      12 14.30186 15.19833 5.076858 3.775417 5.300832 5.992216  0.164344390  0.68483847
      13 15.91798 14.47786 3.007620 6.224872 3.830338 3.028243 -0.071242353  0.81984925
      14 17.41911 14.49935 5.013210 5.169754 5.544124 5.201758  0.338119344 -0.35646076
      15 15.76726 13.03769 3.462312 5.094576 6.251835 5.644511  0.071842820 -2.48345545
      16 14.99288 14.54641 5.733469 6.241158 6.111138 4.372109 -1.002280884  0.76748645
      17 15.17871 14.88004 6.631951 4.846311 6.077040 4.385127 -0.699274238 -1.84938212
      18 12.90336 15.18397 4.481494 6.204927 3.310052 2.046945 -1.842346138 -0.46791915
      19 14.31310 14.32862 6.963597 5.853332 4.124151 4.093026 -1.662460882 -0.27031668
      20 17.25331 16.73606 4.674062 5.949045 5.169811 4.856738  0.048013929  1.07306298
      21 15.38818 13.76637 4.897191 5.626547 5.076134 5.823196  0.137200385  1.40611275
      22 15.35279 16.89325 5.150686 4.490542 3.409013 5.184520  0.004938741 -1.45164671
      23 15.88499 15.31334 5.260789 4.401654 4.452729 6.435039  0.789386209 -0.50842299
      24 16.06672 14.82119 5.024210 4.587017 5.758393 5.662651  0.231251570 -0.12430524
      25 14.93408 15.62573 3.730154 3.625504 4.775070 3.788278  0.830299184  0.97256207
      26 16.20754 14.23117 4.843946 4.206059 3.778496 3.346761  1.614550837 -1.75024630
      27 16.71283 11.65426 3.559865 4.701199 4.198006 6.891123 -0.454631494 -0.42152501
      28 15.15844 13.94274 4.657491 6.611439 6.503309 5.580698  1.133942406  0.44039104
      29 14.26423 15.83374 5.961393 5.223553 5.173916 4.709981  1.424424855 -0.43280752
      30 15.67209 15.29075 5.740236 4.233706 5.582893 4.706259  1.572087272  0.38300052
      31 14.21829 14.83687 4.442544 5.778498 4.822692 6.121222 -0.318373779 -0.27456086
      32 14.98008 14.26653 5.844600 4.832860 4.213410 5.809996 -1.779622235  0.07399854
      33 15.63392 15.19140 5.263267 5.305941 5.929871 5.175858  0.086394088 -0.34753023
      34 13.75393 14.16023 3.510472 5.739289 3.397409 5.158956 -0.378902314 -0.45783589
      35 15.87641 13.69308 4.151437 5.504838 4.602269 4.988841 -0.618535468 -1.13646497
      36 14.95559 15.79736 4.811952 5.113602 5.195094 4.568496  0.010490101 -1.01004477
      37 13.83409 13.25046 6.686703 3.514009 5.308698 7.868867  9.791588382  2.05239012
      38 15.60604 14.11555 6.362565 5.440548 5.503359 5.640982 -0.111587857 -0.39176421
      39 15.96660 14.28885 5.726868 5.199140 5.990608 4.585727  1.768536285 -0.08786540
      40 15.65997 16.64071 5.274348 5.406443 3.618235 7.037277 -2.381014003  0.38575367
      41 14.18519 16.27092 4.780902 4.313851 5.706422 5.786148  0.024784912 -1.41593055
      42 14.97552 12.97847 4.106621 5.258110 5.112121 5.313409  0.553056422  2.90330487
      43 16.29216 16.30951 6.591961 5.021240 6.155636 3.628142 -1.787351964 -0.08872408
      44 13.83075 14.44732 4.561066 5.177443 4.070881 5.955008 -1.050899776  0.89126680
      45 14.44366 15.77155 6.323065 5.218095 3.199359 5.855317 -0.452537507  0.20151892
      46 13.96975 15.67864 4.051353 5.602012 4.278524 4.870577  0.304695524  0.06143125
      47 13.64975 13.30919 3.409978 7.107219 2.358819 5.178817 -0.486368335 -2.70001802
      48 17.67098 15.15840 4.435062 6.742152 4.131794 5.817331 -1.161750029  0.31463652
      49 15.62723 14.95017 5.157411 6.137096 4.993191 5.129493 -0.058337660  1.18703728
      50 14.39389 13.07334 5.234347 3.257008 3.612170 4.721898  1.070309092 -0.59448545
      

      那么这里发生了什么?在原始示例中,与其他两个边缘类型相比,前两列具有低标准偏差,而在第二个列中,所有正态分布具有与其平均值相同的标准。这是多维copula的固有特征,相对而言,边缘具有完全不同的波动率,或者可能是copula包的基本算法不准确?

0 个答案:

没有答案