[R-sig-ME] update to previous message about false positives
John Kingston
jkingston at linguist.umass.edu
Mon May 26 06:29:13 CEST 2014
This message follows my earlier one regarding possible false positives.
The test:
relgrad <- with(sfHSxRtCxRtR at optinfo$derivs, solve(Hessian, gradient))
max(abs(relgrad))
yielded a small value, too: 0.0003628809
And a further test:
xx <- update(sfHSxRtCxRtR,devFunOnly=TRUE)
params <- unlist(getME(sfHSxRtCxRtR, c("theta", "beta")))
grad(xx,params)
yielded:
[1] -0.0033705847 0.0114374278 -0.0088389651 -0.0013375443
-0.0112697898 0.0011420500 0.0024532777 0.0023931444 0.0109466237
-0.0007213523 -0.0006562741 -0.0004396474 0.0039678684
[14] -0.0001146848 0.0044656719 0.0150139408 -0.0049835953
0.0106851591 0.0022508263 -0.0031896368 0.0085055924 -0.0020030117
0.0117194911
which differs relatively little from gg, calculated earlier:
[1] -3.368978e-03 1.132823e-02 -8.620318e-03 -1.396875e-03
-1.111574e-02 -5.324182e-05 2.831584e-03 3.310606e-03 1.246932e-02
-1.287135e-03 -7.301514e-04 -2.738943e-04 3.954865e-03
[14] -2.018623e-04 4.035155e-04 1.503184e-02 -4.957783e-03
1.072177e-02 2.304259e-03 -3.187470e-03 2.128822e-01 -9.298437e-03
1.459412e-02
grad(xx, params) - gg =
[1] -1.607096e-06 1.091984e-04 -2.186470e-04 5.933041e-05
-1.540546e-04 1.195292e-03 -3.783067e-04 -9.174618e-04 -1.522694e-03
5.657828e-04 7.387734e-05 -1.657531e-04 1.300342e-05
[14] 8.717753e-05 4.062156e-03 -1.789655e-05 -2.581237e-05
-3.661019e-05 -5.343309e-05 -2.167105e-06 -2.043766e-01 7.295426e-03
-2.874625e-03
Doing the same comparison for the Hessian yields:
> hessian(xx, params)
[,1] [,2] [,3] [,4]
[,5] [,6] [,7] [,8] [,9] [,10]
[,11] [,12] [,13] [,14]
[1,] 120.1740592 105.442861 -107.5745280 52.670499
822.582502 -7.504852 -1.506024 1.358660 -6.3002315
-8.502787e+00 1.0206522 5.367529 -2.984625 4.145573
[2,] 105.4428611 8002.527882 -2457.2221203 -102.419212
-2312.601923 369.489001 35.510026 17.399144 118.7589983
-1.505657e+01 5.7026516 32.342155 -18.621484 5.162396
[3,] -107.5745280 -2457.222120 4577.1322564 -276.573290
346.906019 16.382111 -38.982669 -2.432062 -0.7133908
-7.764190e+01 -5.3027926 5.844216 3.691355 21.479957
[4,] 52.6704989 -102.419212 -276.5732902 737.922041
1300.431563 10.459564 -1.764205 10.622713 16.2841119
-2.731945e+01 1.0064528 -4.795930 -1.518830 39.934229
[5,] 822.5825016 -2312.601923 346.9060192 1300.431563
19098.452236 33.916906 7.832260 19.364769 35.5692713
-1.012937e+02 3.5862966 58.764282 -41.774123 28.094613
[6,] -7.5048522 369.489001 16.3821110 10.459564
33.916906 13986.671883 -2236.417643 -106.713739 -2273.5207699
-1.669204e+01 41.5750859 5.155602 -2.023642 11.201909
[7,] -1.5060244 35.510026 -38.9826685 -1.764205
7.832260 -2236.417643 4413.504625 -266.587541 332.9324243
-8.312557e+01 -39.2883785 -37.440896 -41.408529 -31.265860
[8,] 1.3586601 17.399144 -2.4320616 10.622713
19.364769 -106.713739 -266.587541 749.607763 1364.0263240
-4.925123e+01 -8.7128203 21.746147 25.574510 44.477344
[9,] -6.3002315 118.758998 -0.7133908 16.284112
35.569271 -2273.520770 332.932424 1364.026324 19104.3149051
-1.046625e+02 16.1393701 308.306118 32.406834 117.265865
[10,] -8.5027867 -15.056572 -77.6419036 -27.319448
-101.293680 -16.692040 -83.125575 -49.251226 -104.6624698
8.228576e+03 -339.0694670 282.233599 -43.532856 9.178118
[11,] 1.0206522 5.702652 -5.3027926 1.006453
3.586297 41.575086 -39.288379 -8.712820 16.1393701
-3.390695e+02 710.6842938 1240.305931 -5.786735 -60.986719
[12,] 5.3675294 32.342155 5.8442155 -4.795930
58.764282 5.155602 -37.440896 21.746147 308.3061177
2.822336e+02 1240.3059308 18444.354308 -93.130339 -87.987859
[13,] -2.9846245 -18.621484 3.6913547 -1.518830
-41.774123 -2.023642 -41.408529 25.574510 32.4068336
-4.353286e+01 -5.7867350 -93.130339 1090.460202 778.296730
[14,] 4.1455734 5.162396 21.4799567 39.934229
28.094613 11.201909 -31.265860 44.477344 117.2658650
9.178118e+00 -60.9867194 -87.987859 778.296730 15541.250246
[15,] -3.3266306 -202.993511 19.9748010 96.184231
482.812590 -206.702930 54.502400 67.653255 451.8587709
-6.693112e+01 -38.1608720 -29.873503 -292.912538 -3764.642188
[16,] 0.2912339 -9.349129 -2.4009252 3.349133
12.877780 -4.025141 4.372661 -3.911761 -32.6386647
-2.411221e+00 -0.4705178 -3.584774 -2.357494 -4.436009
[17,] -14.0198211 89.356392 -13.3961674 -4.616096
-67.199087 -454.832736 61.714665 7.017614 48.7781235
-1.033230e+02 13.6842720 72.066398 -31.391468 44.439705
[18,] 10.9251160 -84.749391 -25.1606425 89.013582
434.877479 64.788609 27.690336 -97.933405 -750.7025742
9.253063e-02 -30.1165345 -176.577184 -47.932266 -132.656737
[19,] -2.5757481 -5.377063 12.6585955 -16.815331
-41.860866 86.888308 -112.384214 20.561753 23.2548131
-6.523163e+01 -11.3970316 -48.690053 -2.417331 29.048922
[20,] 2.9369754 -7.413088 -12.5884897 38.095891
88.441659 4.104393 20.001128 -47.375002 -102.5932378
-8.267404e+00 -12.1042232 -27.950744 -7.499306 -66.464994
[21,] -1140.1100054 8677.326772 -2094.5772787 -3292.407408
-47965.509870 -1906.108077 1508.941003 -164.753978 -6475.7960985
-2.840359e+03 15.8131613 4192.604414 -694.771182 -469.902347
[22,] -302.8082321 990.009194 -1388.5931994 -272.781461
-5756.551118 -1110.695682 -1293.057165 161.812331 748.1841020
1.588311e+03 -382.3264838 -3456.696864 252.860935 1383.021534
[23,] -17.0974103 31.132358 6.7955401 -156.860690
-285.905857 -36.209011 -2.910781 -170.972637 -66.8478459
-1.881380e+02 127.4555154 468.018755 -31.070752 493.226459
[,15] [,16] [,17] [,18]
[,19] [,20] [,21] [,22] [,23]
[1,] -3.326631 0.2912339 -14.019821 1.092512e+01
-2.575748 2.936975 -1140.11001 -302.8082 -17.097410
[2,] -202.993511 -9.3491287 89.356392 -8.474939e+01
-5.377063 -7.413088 8677.32677 990.0092 31.132358
[3,] 19.974801 -2.4009252 -13.396167 -2.516064e+01
12.658596 -12.588490 -2094.57728 -1388.5932 6.795540
[4,] 96.184231 3.3491332 -4.616096 8.901358e+01
-16.815331 38.095891 -3292.40741 -272.7815 -156.860690
[5,] 482.812590 12.8777796 -67.199087 4.348775e+02
-41.860866 88.441659 -47965.50987 -5756.5511 -285.905857
[6,] -206.702930 -4.0251414 -454.832736 6.478861e+01
86.888308 4.104393 -1906.10808 -1110.6957 -36.209011
[7,] 54.502400 4.3726609 61.714665 2.769034e+01
-112.384214 20.001128 1508.94100 -1293.0572 -2.910781
[8,] 67.653255 -3.9117609 7.017614 -9.793341e+01
20.561753 -47.375002 -164.75398 161.8123 -170.972637
[9,] 451.858771 -32.6386647 48.778124 -7.507026e+02
23.254813 -102.593238 -6475.79610 748.1841 -66.847846
[10,] -66.931125 -2.4112213 -103.323010 9.253063e-02
-65.231628 -8.267404 -2840.35931 1588.3113 -188.138017
[11,] -38.160872 -0.4705178 13.684272 -3.011653e+01
-11.397032 -12.104223 15.81316 -382.3265 127.455515
[12,] -29.873503 -3.5847738 72.066398 -1.765772e+02
-48.690053 -27.950744 4192.60441 -3456.6969 468.018755
[13,] -292.912538 -2.3574936 -31.391468 -4.793227e+01
-2.417331 -7.499306 -694.77118 252.8609 -31.070752
[14,] -3764.642188 -4.4360095 44.439705 -1.326567e+02
29.048922 -66.464994 -469.90235 1383.0215 493.226459
[15,] 32619.378440 -19.1405337 -191.118547 -3.797848e+02
12.457206 -67.412229 -3534.26399 -4364.0650 -213.676684
[16,] -19.140534 83.3564695 99.644738 8.638272e+02
-113.919302 57.787450 568.33498 -256.6745 95.290072
[17,] -191.118547 99.6447377 8321.518528 -2.336166e+03
-2504.879964 -116.069782 23410.78444 -7737.2818 -413.061830
[18,] -379.784795 863.8272298 -2336.166492 2.031025e+04
327.923878 1449.493218 5210.53272 -331.5682 2365.347580
[19,] 12.457206 -113.9193021 -2504.879964 3.279239e+02
4729.120058 -302.478304 -8249.67578 9321.4641 -513.296202
[20,] -67.412229 57.7874499 -116.069782 1.449493e+03
-302.478304 798.715340 -120.24179 -1027.9713 1229.253152
[21,] -3534.263989 568.3349771 23410.784438 5.210533e+03
-8249.675776 -120.241792 5103138.59345 -532580.1167 -21433.406503
[22,] -4364.064956 -256.6744716 -7737.281789 -3.315682e+02
9321.464107 -1027.971291 -532580.11673 2448665.3906 -4467.482967
[23,] -213.676684 95.2900719 -413.061830 2.365348e+03
-513.296202 1229.253152 -21433.40650 -4467.4830 95608.545859
> hessian(xx, params) - hh
[,1] [,2] [,3] [,4]
[,5] [,6] [,7] [,8] [,9]
[,10] [,11] [,12] [,13]
[1,] -2.174154e-02 2.675581e-03 0.0045735202 -5.465446e-03
-1.116520e-03 0.0031433803 0.0044736188 0.0012992506 -1.952712e-03
-0.0028477402 5.027177e-03 0.0037599058 0.0052436214
[2,] 2.675581e-03 5.381220e-04 -0.0030651423 -6.248245e-03
4.339480e-03 -0.0073984082 0.0005657110 -0.0017347483 -4.856674e-03
0.0053176302 5.080799e-03 -0.0034874581 -0.0074703357
[3,] 4.573520e-03 -3.065142e-03 0.0126275109 -2.306296e-03
3.553370e-03 0.0002750179 -0.0003687140 0.0017763164 1.201199e-02
0.0031159288 1.528691e-03 -0.0187605446 0.0019015601
[4,] -5.465446e-03 -6.248245e-03 -0.0023062958 1.725601e-02
-7.753215e-05 0.0003357576 -0.0040729665 -0.0152260468 -8.856897e-03
-0.0067041255 4.409771e-05 -0.0242620770 -0.0010689367
[5,] -1.116520e-03 4.339480e-03 0.0035533701 -7.753215e-05
-1.529336e-02 -0.0064341321 0.0030975296 0.0094225420 -2.017720e-03
0.0008753729 -6.537866e-03 -0.0041504293 0.0076763089
[6,] 3.143380e-03 -7.398408e-03 0.0002750179 3.357576e-04
-6.434132e-03 -0.0412513715 0.0050258520 0.0099552340 8.588000e-03
-0.0046618529 5.627845e-03 0.0007554417 0.0008332370
[7,] 4.473619e-03 5.657110e-04 -0.0003687140 -4.072967e-03
3.097530e-03 0.0050258520 -0.0310195782 0.0072467573 3.347200e-03
-0.0022839282 -5.785742e-03 -0.0013209058 -0.0014243946
[8,] 1.299251e-03 -1.734748e-03 0.0017763164 -1.522605e-02
9.422542e-03 0.0099552340 0.0072467573 -0.0213878149 1.971016e-03
-0.0025075191 -2.432119e-03 -0.0101399815 -0.0033095579
[9,] -1.952712e-03 -4.856674e-03 0.0120119931 -8.856897e-03
-2.017720e-03 0.0085880000 0.0033472002 0.0019710163 -4.430788e-03
-0.0054263026 -8.276628e-04 -0.0089457676 -0.0060692192
[10,] -2.847740e-03 5.317630e-03 0.0031159288 -6.704125e-03
8.753729e-04 -0.0046618529 -0.0022839282 -0.0025075191 -5.426303e-03
-0.0300369404 -4.362219e-04 -0.0041943211 0.0041312709
[11,] 5.027177e-03 5.080799e-03 0.0015286913 4.409771e-05
-6.537866e-03 0.0056278445 -0.0057857419 -0.0024321188 -8.276628e-04
-0.0004362219 -2.078431e-02 -0.0077289030 -0.0001138733
[12,] 3.759906e-03 -3.487458e-03 -0.0187605446 -2.426208e-02
-4.150429e-03 0.0007554417 -0.0013209058 -0.0101399815 -8.945768e-03
-0.0041943211 -7.728903e-03 0.0667107794 -0.0011886298
[13,] 5.243621e-03 -7.470336e-03 0.0019015601 -1.068937e-03
7.676309e-03 0.0008332370 -0.0014243946 -0.0033095579 -6.069219e-03
0.0041312709 -1.138733e-04 -0.0011886298 -0.0102566466
[14,] -4.512078e-03 6.329052e-03 0.0043097096 -6.262132e-03
7.271405e-03 0.0032390754 -0.0017607563 0.0091437088 1.208078e-02
0.0055714542 7.360190e-03 -0.0105033416 -0.0000836716
[15,] 3.813757e-03 -2.971857e-03 0.0139855283 5.886356e-03
-1.626739e-02 0.0019036593 0.0049630113 -0.0010414008 -1.031374e-03
-0.0023530046 1.014852e-02 0.0016194862 0.0033557662
[16,] -5.519030e-03 5.346496e-05 -0.0009618441 -4.931706e-03
-3.079761e-03 0.0026905827 -0.0031935818 -0.0015436450 8.369026e-03
0.0008270508 1.242832e-04 -0.0002401364 0.0061538743
[17,] 4.776049e-03 -1.151523e-03 0.0066035479 -1.135960e-02
6.968132e-03 0.0021026348 -0.0006667256 0.0016224097 1.695299e-03
-0.0024531098 -2.556583e-03 0.0004799392 -0.0061534164
[18,] 6.129375e-06 1.891128e-03 -0.0112895132 -9.184442e-03
1.181774e-02 0.0067484503 -0.0035722955 0.0026908638 6.118690e-04
-0.0021959342 -3.924641e-03 -0.0034539168 0.0029756813
[19,] -6.748987e-04 -2.306801e-03 -0.0031476283 5.164174e-03
-4.481530e-03 -0.0026219509 -0.0023168610 0.0014504421 -9.241644e-04
0.0012215803 5.373212e-03 -0.0041398000 -0.0054653719
[20,] 1.855820e-03 2.683495e-03 -0.0062143107 1.239519e-02
-3.653245e-03 0.0107655543 -0.0091255232 0.0009132156 -9.818685e-05
-0.0029384774 7.410119e-03 -0.0029292879 -0.0066907956
[21,] 6.937942e-03 6.023135e-02 -0.0059286185 -5.185891e-03
8.235450e-02 -0.5279987913 0.1448606613 0.0017593525 -4.176498e-02
-0.0161059468 6.337541e-03 -0.0459771204 0.0046360941
[22,] 7.807939e-03 -1.137521e-02 0.0180066118 -4.385140e-02
1.412810e-02 0.0402804010 -0.0241446273 -0.0131691950 -6.235801e-02
-0.0082738265 1.342096e-02 -0.1189830478 0.0044892077
[23,] -1.585136e-03 -3.327251e-04 0.0068438419 -2.395877e-02
-5.226395e-04 -0.0033223756 0.0043186677 -0.0182913958 -2.185717e-02
0.0018760011 4.373088e-04 -0.0308054882 -0.0041019134
[,14] [,15] [,16] [,17]
[,18] [,19] [,20] [,21] [,22]
[,23]
[1,] -0.0045120783 0.0038137571 -5.519030e-03 0.0047760491
6.129375e-06 -0.0006748987 1.855820e-03 0.0069379417 0.007807939
-0.0015851357
[2,] 0.0063290515 -0.0029718566 5.346496e-05 -0.0011515230
1.891128e-03 -0.0023068005 2.683495e-03 0.0602313476 -0.011375205
-0.0003327251
[3,] 0.0043097096 0.0139855283 -9.618441e-04 0.0066035479
-1.128951e-02 -0.0031476283 -6.214311e-03 -0.0059286185 0.018006612
0.0068438419
[4,] -0.0062621325 0.0058863563 -4.931706e-03 -0.0113595996
-9.184442e-03 0.0051641741 1.239519e-02 -0.0051858913 -0.043851395
-0.0239587711
[5,] 0.0072714047 -0.0162673916 -3.079761e-03 0.0069681318
1.181774e-02 -0.0044815295 -3.653245e-03 0.0823544982 0.014128099
-0.0005226395
[6,] 0.0032390754 0.0019036593 2.690583e-03 0.0021026348
6.748450e-03 -0.0026219509 1.076555e-02 -0.5279987913 0.040280401
-0.0033223756
[7,] -0.0017607563 0.0049630113 -3.193582e-03 -0.0006667256
-3.572295e-03 -0.0023168610 -9.125523e-03 0.1448606613 -0.024144627
0.0043186677
[8,] 0.0091437088 -0.0010414008 -1.543645e-03 0.0016224097
2.690864e-03 0.0014504421 9.132156e-04 0.0017593525 -0.013169195
-0.0182913958
[9,] 0.0120807757 -0.0010313741 8.369026e-03 0.0016952993
6.118690e-04 -0.0009241644 -9.818685e-05 -0.0417649796 -0.062358010
-0.0218571699
[10,] 0.0055714542 -0.0023530046 8.270508e-04 -0.0024531098
-2.195934e-03 0.0012215803 -2.938477e-03 -0.0161059468 -0.008273826
0.0018760011
[11,] 0.0073601903 0.0101485229 1.242832e-04 -0.0025565827
-3.924641e-03 0.0053732115 7.410119e-03 0.0063375408 0.013420956
0.0004373088
[12,] -0.0105033416 0.0016194862 -2.401364e-04 0.0004799392
-3.453917e-03 -0.0041398000 -2.929288e-03 -0.0459771204 -0.118983048
-0.0308054882
[13,] -0.0000836716 0.0033557662 6.153874e-03 -0.0061534164
2.975681e-03 -0.0054653719 -6.690796e-03 0.0046360941 0.004489208
-0.0041019134
[14,] 0.0175798113 0.0902339108 -2.659874e-03 0.0020223468
6.166098e-03 0.0079064466 1.558615e-03 -0.0389437950 -0.001049385
0.0140569129
[15,] 0.0902339108 -0.1323017313 -5.801023e-04 -0.0026411842
1.452162e-02 0.0078649448 -5.490748e-03 0.1736938980 0.022812160
-0.0005974097
[16,] -0.0026598737 -0.0005801023 -1.340357e-02 -0.0022349675
4.598005e-03 0.0028781256 7.908915e-03 0.0009316806 -0.006869086
-0.0039344365
[17,] 0.0020223468 -0.0026411842 -2.234967e-03 0.0136455855
2.514638e-03 0.0013840837 2.861133e-04 0.0897969890 -0.010487408
0.0070791040
[18,] 0.0061660984 0.0145216196 4.598005e-03 0.0025146382
-5.823754e-03 -0.0022082184 -2.570122e-03 -0.0021295272 0.009604257
-0.0039216392
[19,] 0.0079064466 0.0078649448 2.878126e-03 0.0013840837
-2.208218e-03 -0.0027442362 -3.267145e-03 -0.0297189825 -0.008732238
0.0011612826
[20,] 0.0015586155 -0.0054907482 7.908915e-03 0.0002861133
-2.570122e-03 -0.0032671450 -3.148659e-02 -0.0018014206 -0.002723892
-0.0032563813
[21,] -0.0389437950 0.1736938980 9.316806e-04 0.0897969890
-2.129527e-03 -0.0297189825 -1.801421e-03 3.0560996104 -0.281465531
-0.0451748433
[22,] -0.0010493852 0.0228121604 -6.869086e-03 -0.0104874083
9.604257e-03 -0.0087322380 -2.723892e-03 -0.2814655309 1.216295037
-0.1057700633
[23,] 0.0140569129 -0.0005974097 -3.934436e-03 0.0070791040
-3.921639e-03 0.0011612826 -3.256381e-03 -0.0451748433 -0.105770063
0.0580663878
The maximum absolute value of this difference is 3.0561, which appears
in [21,21]; no other difference is within an order of magnitude of
that size. A histogram of the log transforms of the absolute values of
these differences is attached.
John Kingston
--------------------------------
Professor and Head
Linguistics Department
University of Massachusetts
150 Hicks Way, 226 South College
Amherst, MA 01003-9274
1-413-545-6837, fax -2792
jkingston at linguist.umass.edu
https://blogs.umass.edu/jkingstn/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: histHessianDifs_26May14.pdf
Type: application/pdf
Size: 108217 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20140526/9baf5826/attachment-0001.pdf>
More information about the R-sig-mixed-models
mailing list