Performs a bootstrapped version of the Mann-Kendall trend test to adjust for serial correlation in annual maximum series data. The BBMK test uses Spearman’s serial correlation test to identify the least insignificant lag, then applies a shuffling procedure to obtain the empirical p-value and confidence bounds for the Mann-Kendall test statistic.
Arguments
- data
Numeric vector of observed annual maximum series values. Must be strictly positive, finite, and not missing.
- alpha
Numeric scalar in \([0.01, 0.1]\). The significance level for confidence intervals or hypothesis tests. Default is 0.05.
- samples
Integer scalar. The number of bootstrap samples. Default is 10000.
Value
A list containing the test results, including:
data
: Thedata
argument.alpha
: The significance level as specified in thealpha
argument.null_hypothesis
: A string describing the null hypothesis.alternative_hypothesis
: A string describing the alternative hypothesis.statistic
: The Mann-Kendall S-statistic computed on the original series.bootstrap
: Vector of bootstrapped Mann-Kendall test statistics.p_value
: Empirical two-sided p-value derived from the bootstrap distribution.bounds
: Empirical confidence interval bounds from the bootstrap distribution.reject
: IfTRUE
, the null hypothesis was rejected at significancealpha
.
Details
The block size for reshuffling is equal to the least_lag
as estimated in
eda_spearman_test()
. Bootstrap samples are generated by resampling blocks
of the original data without replacement. This procedure effectively removes
serial correlation from the data.
References
Bayazit, M., 2015. Nonstationarity of hydrological records and recent trends in trend analysis: a state-of-the-art review. Environmental Processes 2 (3), 527–542. doi:10.1007/s40710-015-0081-7
Khaliq, M.N., Ouarda, T.B.M.J., Gachon, P., Sushama, L., St-Hilaire, A., 2009. Identification of hydrological trends in the presence of serial and cross correlations: a review of selected methods and their application to annual flow regimes of Canadian rivers. Journal Hydrolology 368 (1–4), 117–130. doi:10.1016/j.jhydrol.2009.01.035
Sonali, P., Nagesh Kumar, D., 2013. Review of trend detection methods and their application to detect temperature changes in India. Journal Hydrology 476, 212–227. doi:10.1016/j.jhydrol.2012.10.034
Examples
data <- rnorm(n = 100, mean = 100, sd = 10)
eda_bbmk_test(data, samples = 1000L)
#> $data
#> [1] 105.58514 104.15406 85.47700 109.41206 96.61064 99.24426 100.40204
#> [8] 101.24301 90.01567 112.33390 103.40424 95.27298 107.08753 84.71041
#> [15] 102.37425 86.87186 107.47029 84.37482 100.71053 93.60465 91.54804
#> [22] 106.75245 111.53376 83.13495 90.97185 113.17634 111.00190 112.03768
#> [29] 85.68729 113.82911 100.03126 99.22113 104.41428 101.28923 91.69786
#> [36] 94.96407 88.06359 92.48277 114.55841 91.71396 102.89774 95.19947
#> [43] 93.95171 114.60110 101.49679 85.66679 99.89697 97.87764 90.93660
#> [50] 78.97848 118.93360 90.31874 98.97397 102.39960 100.60899 78.22424
#> [57] 98.82140 101.12295 100.07886 118.77744 121.58757 107.09715 107.66983
#> [64] 96.91789 110.12002 90.80948 105.63380 103.22483 103.66674 111.29835
#> [71] 90.58502 102.17838 114.15412 96.16267 98.25914 97.78255 89.90471
#> [78] 104.80725 116.04407 84.84975 85.83976 108.76777 106.24132 121.12277
#> [85] 96.43876 89.35536 110.77117 111.81576 101.98392 95.99595 106.16154
#> [92] 119.74157 118.84662 84.11379 94.60077 88.30539 105.59106 81.80653
#> [99] 103.93344 100.42134
#>
#> $alpha
#> [1] 0.05
#>
#> $null_hypothesis
#> [1] "There is no monotonic trend in the mean of the data."
#>
#> $alternative_hypothesis
#> [1] "There is a monotonic trend in the mean of the data."
#>
#> $statistic
#> [1] 244
#>
#> $bootstrap
#> [1] 756 -346 -912 498 760 -222 -116 430 -164 -476 -162 -224
#> [13] 120 -324 -20 508 -824 -188 -374 220 -444 406 12 162
#> [25] 260 -400 382 38 -368 110 -278 168 418 -52 -28 164
#> [37] -408 800 336 -28 412 318 -664 136 -52 834 138 614
#> [49] 134 -220 290 376 -390 -214 -664 102 274 -26 -230 -378
#> [61] 236 -238 48 132 450 -28 8 34 -352 -522 140 526
#> [73] -220 -166 -322 76 418 -704 -198 -230 592 408 -262 -330
#> [85] 108 -32 -304 908 -130 58 -516 80 132 554 -248 194
#> [97] -172 -10 184 -178 -62 -156 300 -94 -176 -22 -90 -134
#> [109] -316 -174 -350 -16 170 -372 22 -386 -422 186 252 40
#> [121] -34 294 -372 -178 -180 -242 -334 172 160 -428 434 738
#> [133] 288 -52 158 -76 -50 -86 -544 -954 126 -130 -496 254
#> [145] 98 -364 192 482 -90 100 -178 -486 -512 52 -120 -212
#> [157] -38 372 14 -448 -406 -470 -40 166 380 -102 592 -120
#> [169] 38 198 322 434 266 -72 -154 92 152 -740 -46 -800
#> [181] 104 -326 -456 62 -86 220 -106 602 -456 16 -228 -594
#> [193] -482 -604 -52 -914 246 176 -192 -554 -140 -30 -226 -192
#> [205] -38 130 0 -122 486 52 196 712 354 612 -372 214
#> [217] -632 290 140 226 212 -6 -6 -12 -128 370 28 174
#> [229] 12 184 232 408 -272 -250 -248 36 -332 186 -260 -130
#> [241] 102 -56 -984 332 -96 16 328 224 -214 -190 -678 312
#> [253] -234 -30 -658 -408 138 586 -454 -16 258 -92 124 -280
#> [265] -130 -256 206 -572 170 102 -332 464 316 -12 -18 38
#> [277] -642 -164 -72 280 2 -156 202 278 -180 1074 -176 -4
#> [289] -468 106 158 -208 16 -528 232 136 -180 4 -180 428
#> [301] -262 -428 -552 26 410 -556 -104 50 -90 -204 -158 -286
#> [313] -206 -222 -16 262 312 -326 120 -208 424 66 -492 370
#> [325] 610 238 -826 128 -158 526 158 200 -626 -132 -28 -516
#> [337] -216 730 -108 308 -106 158 -18 -202 -330 -226 234 -260
#> [349] 120 -310 -206 -778 72 72 174 -80 226 -156 -510 -468
#> [361] 518 -116 -618 134 10 -94 288 46 -248 -74 270 -76
#> [373] -536 800 -242 -30 -178 426 -68 -166 240 500 366 -266
#> [385] 594 -108 62 -302 -454 156 382 -64 186 -16 -214 -116
#> [397] -254 -118 -282 -42 -296 534 -34 -796 -422 36 270 -88
#> [409] -72 116 60 -512 120 -126 240 -348 114 -40 -168 26
#> [421] 92 -158 -122 498 312 -294 770 198 500 -352 90 192
#> [433] 86 -168 -372 96 180 240 -584 -806 -214 244 -364 -576
#> [445] 264 -422 266 -450 18 -98 -338 368 -184 -550 574 -290
#> [457] 516 -108 -354 -108 -102 -396 350 -136 122 618 68 -300
#> [469] -166 -178 206 -360 -338 142 44 8 84 -62 -426 -590
#> [481] -340 496 -158 4 192 40 162 234 -68 -428 280 108
#> [493] 308 -426 -314 -84 -172 180 -370 88 -110 350 368 430
#> [505] -720 454 922 -182 198 -144 14 -48 -212 578 198 308
#> [517] -584 470 510 -136 -448 -130 -284 118 424 -226 332 774
#> [529] -204 -178 86 -216 -92 10 -152 -132 68 -40 -706 -234
#> [541] 144 198 642 104 490 -160 710 -358 494 -460 -108 238
#> [553] 22 -104 -472 -778 220 -832 -542 -122 -286 -234 308 -68
#> [565] 82 130 4 -236 14 -220 180 116 -132 436 192 -280
#> [577] -176 18 -52 -318 244 438 224 -58 -92 44 -392 122
#> [589] 152 768 254 -92 -112 -446 252 284 276 406 120 -352
#> [601] 220 -186 348 -482 -192 148 88 408 -140 304 -102 316
#> [613] -212 536 -720 -482 -108 -236 -220 -304 -242 180 -64 -176
#> [625] -510 66 -30 262 -416 490 252 84 334 286 -144 152
#> [637] -134 610 -368 -356 18 276 -166 -96 -384 -738 94 -240
#> [649] 456 -20 -240 -562 -308 -720 -438 -272 -510 -486 72 -182
#> [661] 12 -110 -108 166 90 -196 -22 -294 -20 -602 126 50
#> [673] -280 40 458 -92 166 26 -24 106 -330 370 -384 -140
#> [685] -34 -184 246 -358 216 -424 40 -74 -366 -676 240 -278
#> [697] 78 376 -124 42 562 86 -100 -20 52 -56 -160 -18
#> [709] 222 92 414 -62 -38 182 -274 -124 -526 104 412 390
#> [721] 314 20 -386 -306 -470 -396 36 -482 -216 22 302 -430
#> [733] 812 2 -290 636 152 -118 302 824 -46 384 -410 -350
#> [745] -344 630 -74 -378 448 624 392 240 -460 -246 20 -136
#> [757] 244 -800 -228 -234 152 168 756 -252 596 -276 -892 -428
#> [769] 150 -198 28 548 836 -378 496 -194 346 74 22 -296
#> [781] 602 -240 -426 -556 0 -144 -292 -134 -252 -100 368 -204
#> [793] -552 -244 -76 128 -314 -706 -274 82 -16 -474 252 120
#> [805] -214 -154 -298 -526 224 -292 224 128 -454 -270 328 -126
#> [817] 178 -364 68 926 50 120 98 452 478 58 -108 344
#> [829] 80 -468 -258 -114 -274 404 70 -330 -170 -410 364 -738
#> [841] 286 -8 -134 -74 -26 294 -312 152 -10 372 -374 722
#> [853] 420 -134 -20 108 546 288 -284 46 -34 -122 102 -20
#> [865] -74 -480 214 488 316 -76 -1088 338 -416 480 -66 -284
#> [877] -376 -68 568 224 -434 -60 28 -226 584 0 0 348
#> [889] 166 -34 -76 168 618 -362 -164 62 -38 -272 320 -246
#> [901] 278 -594 -400 148 -280 -456 -268 352 -142 -312 398 -94
#> [913] -498 -68 -128 -384 456 -152 190 -504 44 -302 426 -324
#> [925] 14 -158 -288 390 -60 42 624 138 34 -176 112 458
#> [937] -90 70 16 102 -162 530 -252 294 -318 240 722 -326
#> [949] 206 -280 204 382 764 326 -558 -144 -316 -166 410 656
#> [961] 114 -438 -148 482 -144 444 -190 326 -398 290 -222 414
#> [973] -534 -212 366 -98 -216 -654 250 842 -138 36 -168 304
#> [985] 322 -276 320 -196 218 -184 302 170 560 38 -12 148
#> [997] -384 -160 642 402
#>
#> $p_value
#> [1] 0.432
#>
#> $bounds
#> 2.5% 97.5%
#> -676.05 642.35
#>
#> $reject
#> [1] FALSE
#>