Selects the best-fit distribution by comparing a bias-corrected Z-statistic for the sample L-kurtosis (\(\tau_4\)) against the theoretical L-moments for a set of candidate distributions. The distribution with the smallest absolute Z-statistic is selected.
For NS-FFA: To select a distribution for a nonstationary model, include the
observation years (ns_years
) and the nonstationary model structure
(ns_structure
). Then, this method will detrend the original, nonstationary data
internally using the data_decomposition()
function prior to distribution selection.
Arguments
- data
Numeric vector of observed annual maximum series values. Must be strictly positive, finite, and not missing.
- ns_years
For NS-FFA only: Numeric vector of observation years corresponding to
data
. Must be the same length asdata
and strictly increasing.- ns_structure
For NS-FFA only: Named list indicating which distribution parameters are modeled as nonstationary. Must contain two logical scalars:
location
: IfTRUE
, the location parameter has a linear temporal trend.scale
: IfTRUE
, the scale parameter has a linear temporal trend.
- samples
Integer scalar. The number of bootstrap samples. Default is 10000.
Value
A list with the results of distribution selection:
method
:"Z-selection"
.decomposed_data
: The detrended dataset used to compute the L-moments. For S-FFA, this is thedata
argument. For NS-FFA, it is output ofdata_decomposition()
.metrics
: List of computed Z-statistics for each candidate distribution.recommendation
: Name of the distribution with the smallest Z-statistic.reg_params
: Kappa distribution parameters for the data.reg_bias_t4
: Bias of the L-kurtosis from the bootstrap.reg_std_t4
: Standard deviation of the L-kurtosis from the bootstrap.log_params
: Kappa distribution parameters for the log-transformed data.log_bias_t4
: Bias of the L-kurtosis from the bootstrap usinglog_params
.log_std_t4
: Standard deviation of the L-kurtosis from the bootstrap usinglog_params
.
Details
First, this method fits a four-parameter Kappa distribution to both the original and log-transformed data. Then, bootstrapping is used to estimate the bias and variance of the L-kurtosis. These values, along with the difference between the sample and theoretical L-kurtosis, are used to compute the Z-statistic for each distribution.
References
Hosking, J.R.M. & Wallis, J.R., 1997. Regional frequency analysis: an approach based on L-Moments. Cambridge University Press, New York, USA.
Examples
data <- rnorm(n = 100, mean = 100, sd = 10)
select_zstatistic(data)
#> $method
#> [1] "Z-statistic"
#>
#> $decomposed_data
#> [1] 108.46015 107.24958 101.17380 115.17878 100.48625 93.96213 84.40808
#> [8] 94.33495 104.48243 92.09158 84.75779 106.39260 88.13787 102.65497
#> [15] 89.25667 111.51548 123.18602 109.23480 108.39826 95.96181 93.45547
#> [22] 98.95412 81.54312 100.81003 105.16527 107.33136 105.38797 95.60419
#> [29] 102.40490 104.49495 78.84581 119.48319 106.81061 91.73682 107.50677
#> [36] 101.43231 94.81273 93.39844 99.84991 105.99509 105.41103 112.38625
#> [43] 109.05877 108.87397 106.26721 109.05813 106.73623 101.05394 99.82153
#> [50] 89.31985 107.93599 100.47284 121.40463 95.28911 87.67504 95.45363
#> [57] 92.68710 104.28608 97.24062 117.85477 128.66187 115.44697 81.82928
#> [64] 105.55251 104.54792 98.46370 101.69646 107.14534 89.82659 96.33812
#> [71] 99.35319 103.36448 102.99345 108.05845 115.88706 101.88099 90.27166
#> [78] 90.94695 100.33448 104.28727 101.15612 77.60913 109.71337 90.89458
#> [85] 96.01451 90.94567 96.34790 104.43368 103.14414 101.89257 91.76334
#> [92] 106.41107 105.11925 91.95652 109.68356 105.88925 105.38664 98.80253
#> [99] 117.03117 99.89794
#>
#> $metrics
#> $metrics$GEV
#> [1] -1.573403
#>
#> $metrics$GLO
#> [1] 0.1706968
#>
#> $metrics$GNO
#> [1] -1.056235
#>
#> $metrics$PE3
#> [1] -1.06734
#>
#> $metrics$LP3
#> [1] -1.013761
#>
#> $metrics$WEI
#> [1] -1.393823
#>
#>
#> $recommendation
#> [1] "GLO"
#>
#> $reg_params
#> [1] 101.12117933 5.78188429 0.06658877 -0.78841285
#>
#> $reg_bias_t4
#> [1] 0.0002458638
#>
#> $reg_std_t4
#> [1] 0.03594635
#>
#> $log_params
#> [1] 4.61509327 0.05887982 0.13361006 -0.73988063
#>
#> $log_bias_t4
#> [1] -0.0002018031
#>
#> $log_std_t4
#> [1] 0.03820009
#>