TH: Sequential Goodness of Fit Testing for the Generalized Pareto...

Description Usage Arguments Details Value References Examples

View source: R/TH.R

Description

An implementation of the sequential testing procedure proposed in Thompson et al. (2009) for automated threshold selection

Usage

1
TH(data, thresholds)

Arguments

data

vector of sample data

thresholds

a sequence of pre-defined thresholds to check for GPD assumption

Details

The procedure proposed in Thompson et al. (2009) is based on sequential goodness of fit testing. First, one has to choose a equally spaced grid of posssible thresholds. The authors recommend 100 thresholds between the 50 percent and 98 percent quantile of the data, provided there are enough observations left (about 100 observations above the last pre-defined threshold). Then the parameters of a GPD for each threshold are estimated. One can show that the differences of subsequent scale parameters are approximately normal distributed. So a Pearson chi-squared test for normality is applied to all the differences, striking the smallest thresholds out until the test is not rejected anymore.

Value

threshold

the threshold used for the test

num.above

the number of observations above the given threshold

p.values

raw p-values for the thresholds tested

ForwardStop

transformed p-values according to the ForwardStop criterion. See G'Sell et al (2016) for more information

StrongStop

transformed p-values according to the StrongStop criterion. See G'Sell et al (2016) for more information

est.scale

estimated scale parameter for the given threshold

est.shape

estimated shape parameter for the given threshold

References

Thompson, P. and Cai, Y. and Reeve, D. (2009). Automated threshold selection methods for extreme wave analysis. Coastal Engineering, 56(10), 1013–1021.

G'Sell, M.G. and Wager, S. and Chouldechova, A. and Tibshirani, R. (2016). Sequential selection procedures and false discovery rate control. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 78(2), 423–444.

Examples

1
2
3
data=rexp(1000)
u=seq(quantile(data,.1),quantile(data,.9),,100)
A=TH(data,u);A

Example output

Loading required package: eva
      testnum threshold num.above    p.values ForwardStop   StrongStop
 [1,]       1 0.1069378       900 0.020061467  0.02026543 0.0001224283
 [2,]       2 0.1284360       881 0.043764781  0.03250839 0.0030513307
 [3,]       3 0.1499341       861 0.073231143  0.04702262 0.0097237915
 [4,]       4 0.1714323       832 0.032786177  0.04360089 0.0174313744
 [5,]       5 0.1929305       817 0.047948401  0.04470792 0.0327716963
 [6,]       6 0.2144287       798 0.042195689  0.04444190 0.0501375202
 [7,]       7 0.2359269       781 0.068181693  0.04818126 0.0728346516
 [8,]       8 0.2574250       761 0.039442099  0.04718873 0.0935330268
 [9,]       9 0.2789232       747 0.059978784  0.04881808 0.1245424668
[10,]      10 0.3004214       739 0.083696948  0.05267708 0.1532279569
[11,]      11 0.3219196       719 0.037366046  0.05135026 0.1785148559
[12,]      12 0.3434177       702 0.057975184  0.05204804 0.2206279896
[13,]      13 0.3649159       691 0.100853782  0.05622201 0.2582032218
[14,]      14 0.3864141       678 0.064024295  0.05693228 0.2860329308
[15,]      15 0.4079123       666 0.104700023  0.06050989 0.3248732089
[16,]      16 0.4294105       652 0.122325228  0.06488297 0.3540153196
[17,]      17 0.4509086       640 0.143942088  0.07020852 0.3799473022
[18,]      18 0.4724068       626 0.133124057  0.07424468 0.4021778483
[19,]      19 0.4939050       616 0.187505819  0.08126583 0.4261764668
[20,]      20 0.5154032       600 0.191686741  0.08784281 0.4421559274
[21,]      21 0.5369013       589 0.250574371  0.09739545 0.4573582828
[22,]      22 0.5583995       576 0.281018518  0.10796473 0.4663105346
[23,]      23 0.5798977       563 0.293933848  0.11840307 0.4725280288
[24,]      24 0.6013959       555 0.598819809  0.15152563 0.4775993768
[25,]      25 0.6228941       547 0.498313073  0.17305576 0.4683972226
[26,]      26 0.6443922       536 0.628677920  0.20450306 0.4631065043
[27,]      27 0.6658904       524 0.699593947  0.24147036 0.4539868001
[28,]      28 0.6873886       504 0.706148713  0.27658504 0.4436039467
[29,]      29 0.7088868       490 0.681017434  0.30644828 0.4336626308
[30,]      30 0.7303849       484 0.439071869  0.31550542 0.4247974565
[31,]      31 0.7518831       471 0.465218545  0.32551805 0.4225294148
[32,]      32 0.7733813       460 0.530299574  0.33895999 0.4195554869
[33,]      33 0.7948795       452 0.567515095  0.35408872 0.4149866765
[34,]      34 0.8163777       448 0.501132281  0.36412771 0.4097551363
[35,]      35 0.8378758       440 0.473484843  0.37205192 0.4062189778
[36,]      36 0.8593740       433 0.556991203  0.38433286 0.4034620786
[37,]      37 0.8808722       424 0.611718139  0.39951369 0.3989911537
[38,]      38 0.9023704       415 0.750658833  0.42555105 0.3936862769
[39,]      39 0.9238685       400 0.738140064  0.44899706 0.3864978589
[40,]      40 0.9453667       387 0.606231873  0.46107196 0.3797805901
[41,]      41 0.9668649       378 0.681362473  0.47772145 0.3751828088
[42,]      42 0.9883631       369 0.471370725  0.48152494 0.3696931834
[43,]      43 1.0098613       357 0.358836516  0.48066321 0.3676201928
[44,]      44 1.0313594       352 0.595371752  0.49030238 0.3679309982
[45,]      45 1.0528576       345 0.682140151  0.50487665 0.3640197867
[46,]      46 1.0743558       335 0.583597610  0.51294680 0.3591462784
[47,]      47 1.0958540       324 0.490086522  0.51636312 0.3556442842
[48,]      48 1.1173521       316 0.487005024  0.51951158 0.3535594056
[49,]      49 1.1388503       308 0.445393229  0.52093984 0.3515744228
[50,]      50 1.1603485       302 0.298646343  0.51761590 0.3502771809
[51,]      51 1.1818467       295 0.270720238  0.51365672 0.3518102837
[52,]      52 1.2033449       287 0.057437734  0.50491627 0.3539993032
[53,]      53 1.2248430       282 0.037105950  0.49610298 0.3669369710
[54,]      54 1.2463412       280 0.237422850  0.49193536 0.3832350415
[55,]      55 1.2678394       274 0.286158526  0.48912007 0.3864209649
[56,]      56 1.2893376       268 0.138619021  0.48305040 0.3882533587
[57,]      57 1.3108357       264 0.230118071  0.47916387 0.3951418103
[58,]      58 1.3323339       258 0.097618448  0.47267342 0.3984682241
[59,]      59 1.3538321       250 0.054770570  0.46561671 0.4077477188
[60,]      60 1.3753303       242 0.029636164  0.45835784 0.4211849614
[61,]      61 1.3968285       237 0.009004660  0.45099206 0.4393027329
[62,]      62 1.4183266       228 0.028482166  0.44418405 0.4669123631
[63,]      63 1.4398248       222 0.003855771  0.43719483 0.4866455488
[64,]      64 1.4613230       219 0.016704734  0.43062688 0.5232256495
[65,]      65 1.4828212       215 0.012862827  0.42420102 0.5491914595
[66,]      66 1.5043193       207 0.006533026  0.41787305 0.5783361345
[67,]      67 1.5258175       205 0.041614805  0.41227054 0.6148282135
[68,]      68 1.5473157       198 0.075235246  0.40735798 0.6352254935
[69,]      69 1.5688139       195 0.061106972  0.40236806 0.6502958115
[70,]      70 1.5903121       188 0.040699389  0.39721353 0.6675055714
[71,]      71 1.6118102       182 0.017217618  0.39186358 0.6889022710
[72,]      72 1.6333084       180 0.043514521  0.38703895 0.7193312348
[73,]      73 1.6548066       176 0.037415267  0.38225942 0.7410481257
[74,]      74 1.6763048       169 0.020029116  0.37736716 0.7646889766
[75,]      75 1.6978029       165 0.048298336  0.37299565 0.7954370256
[76,]      76 1.7193011       159 0.096484759  0.36942284 0.8173367839
[77,]      77 1.7407993       156 0.033043579  0.36506153 0.8319290641
[78,]      78 1.7622975       155 0.033428908  0.36081715 0.8584500984
[79,]      79 1.7837957       150 0.040427682  0.35677222 0.8853277489
[80,]      80 1.8052938       143 0.120858749  0.35392269 0.9104962419
[81,]      81 1.8267920       142 0.070997690  0.35046246 0.9233251165
[82,]      82 1.8482902       141 0.104580625  0.34753564 0.9423407809
[83,]      83 1.8697884       140 0.305888372  0.34774753 0.9569773478
[84,]      84 1.8912865       139 0.149704268  0.34553829 0.9591764356
[85,]      85 1.9127847       137 0.283886131  0.34540155 0.9695662773
[86,]      86 1.9342829       135 0.515263194  0.34980560 0.9725939735
[87,]      87 1.9557811       134 0.171797144  0.34795148 0.9688560854
[88,]      88 1.9772793       131 0.391625176  0.34964480 0.9774369939
[89,]      89 1.9987774       130 0.451150166  0.35245700 0.9768050766
[90,]      90 2.0202756       127 0.361805027  0.35353094 0.9746292423
[91,]      91 2.0417738       122 0.800737403  0.36737270 0.9748692965
[92,]      92 2.0632720       121 0.056416140  0.36401072 0.9666305254
[93,]      93 2.0847701       117 0.318906557  0.36422626 0.9865908584
[94,]      94 2.1062683       115 0.716531311  0.37376272 0.9881642416
[95,]      95 2.1277665       113 0.438578026  0.37590503 0.9812359105
[96,]      96 2.1492647       109 0.157299207  0.37377210 0.9794758529
[97,]      97 2.1707629       107 0.317310508  0.37385398 0.9882359862
      est.scale     est.shape
 [1,] 0.9869860 -1.695464e-02
 [2,] 0.9857848 -1.642346e-02
 [3,] 0.9876135 -1.763330e-02
 [4,] 1.0119918 -2.997044e-02
 [5,] 1.0050468 -2.684474e-02
 [6,] 1.0087172 -2.890263e-02
 [7,] 1.0083126 -2.893834e-02
 [8,] 1.0169240 -3.365861e-02
 [9,] 1.0112141 -3.110787e-02
[10,] 0.9900949 -2.086969e-02
[11,] 1.0009504 -2.672312e-02
[12,] 1.0049530 -2.893283e-02
[13,] 0.9932281 -2.332162e-02
[14,] 0.9877720 -2.084439e-02
[15,] 0.9794885 -1.688411e-02
[16,] 0.9775245 -1.594976e-02
[17,] 0.9703293 -1.241254e-02
[18,] 0.9703334 -1.249945e-02
[19,] 0.9579214 -6.050034e-03
[20,] 0.9654604 -1.028691e-02
[21,] 0.9575381 -6.103116e-03
[22,] 0.9571083 -5.936581e-03
[23,] 0.9579860 -6.386631e-03
[24,] 0.9418044  1.900245e-03
[25,] 0.9251189  1.175473e-02
[26,] 0.9195434  1.510705e-02
[27,] 0.9183290  1.591383e-02
[28,] 0.9500908 -1.864442e-03
[29,] 0.9611586 -7.928693e-03
[30,] 0.9410114  3.056091e-03
[31,] 0.9497055 -1.733228e-03
[32,] 0.9516691 -2.848007e-03
[33,] 0.9417358  2.654858e-03
[34,] 0.9133463  1.904947e-02
[35,] 0.9024326  2.572427e-02
[36,] 0.8870506  3.542522e-02
[37,] 0.8811850  3.956032e-02
[38,] 0.8759034  4.345374e-02
[39,] 0.9027101  2.728255e-02
[40,] 0.9224946  1.572848e-02
[41,] 0.9234297  1.548168e-02
[42,] 0.9256746  1.435142e-02
[43,] 0.9465817  2.381474e-03
[44,] 0.9288118  1.262145e-02
[45,] 0.9224101  1.659336e-02
[46,] 0.9359666  8.780452e-03
[47,] 0.9578192 -3.678858e-03
[48,] 0.9632569 -6.717401e-03
[49,] 0.9702554 -1.064851e-02
[50,] 0.9648317 -7.773212e-03
[51,] 0.9667854 -8.942150e-03
[52,] 0.9774982 -1.500566e-02
[53,] 0.9678597 -9.671053e-03
[54,] 0.9356337  8.599795e-03
[55,] 0.9334798  9.842143e-03
[56,] 0.9310249  1.144449e-02
[57,] 0.9139722  2.204113e-02
[58,] 0.9135134  2.255564e-02
[59,] 0.9307486  1.258940e-02
[60,] 0.9517893  8.965894e-05
[61,] 0.9481225  2.311846e-03
[62,] 0.9830977 -1.775443e-02
[63,] 0.9927850 -2.328413e-02
[64,] 0.9748126 -1.352337e-02
[65,] 0.9666962 -9.131202e-03
[66,] 0.9998984 -2.775774e-02
[67,] 0.9738493 -1.354926e-02
[68,] 1.0011884 -2.895300e-02
[69,] 0.9869151 -2.143642e-02
[70,] 1.0186432 -3.892228e-02
[71,] 1.0423690 -5.186385e-02
[72,] 1.0211857 -4.146645e-02
[73,] 1.0233957 -4.312365e-02
[74,] 1.0641049 -6.440307e-02
[75,] 1.0708668 -6.833835e-02
[76,] 1.1052042 -8.534999e-02
[77,] 1.1022939 -8.499779e-02
[78,] 1.0732475 -7.194576e-02
[79,] 1.0987840 -8.492584e-02
[80,] 1.1550431 -1.109482e-01
[81,] 1.1287621 -1.006135e-01
[82,] 1.1022359 -8.957552e-02
[83,] 1.0745098 -7.723649e-02
[84,] 1.0458809 -6.393696e-02
[85,] 1.0316166 -5.732515e-02
[86,] 1.0176596 -5.083853e-02
[87,] 0.9879054 -3.532169e-02
[88,] 0.9885345 -3.609650e-02
[89,] 0.9574278 -1.875970e-02
[90,] 0.9589417 -1.978602e-02
[91,] 0.9966464 -4.145499e-02
[92,] 0.9668326 -2.517574e-02
[93,] 0.9909773 -3.919662e-02
[94,] 0.9799499 -3.344927e-02
[95,] 0.9698719 -2.796338e-02
[96,] 0.9992297 -4.493423e-02
[97,] 0.9921108 -4.159460e-02

tea documentation built on April 19, 2020, 3:57 p.m.