Decomposes a nonstationary annual maxima series to derive its stationary stochastic component, which can be used to identify a best-fit distribution using conventional stationary methods, like those based on L-moments. The decomposition procedure follows that proposed by Vidrio-Sahagún and He (2022), which relies on the statistical representation of nonstationary stochastic processes.
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.
Details
Internally, the function does the following:
If there is a trend in the location, fit Sen's trend estimator and subtract away the fitted trend.
If there is a trend in the scale, estimate the variability of the data with
data_mw_variability()
, fit Sen's trend estimator to the variability vector, and rescale the data to remove the trend.If necessary, shift the data so that its minimum is at least 1.
References
Vidrio-Sahagún, C. T., and He, J. (2022). The decomposition-based nonstationary flood frequency analysis. Journal of Hydrology, 612 (September 2022), 128186. doi:10.1016/j.jhydrol.2022.128186
Examples
data <- rnorm(n = 100, mean = 100, sd = 10)
ns_years <- seq(from = 1901, to = 2000)
ns_structure <- list(location = TRUE, scale = FALSE)
data_decomposition(data, ns_years, ns_structure)
#> [1] 102.48618 75.49338 99.74332 105.94756 111.14916 81.37988 97.05781
#> [8] 97.02208 96.57003 93.79310 105.55292 119.84636 82.81923 104.18640
#> [15] 80.36503 93.70802 98.33514 104.22413 89.58643 103.34173 102.22271
#> [22] 85.48077 105.83698 117.27727 97.35078 88.89977 98.03175 89.85637
#> [29] 82.93328 107.34391 99.68818 100.29315 114.02480 98.84270 96.31536
#> [36] 78.48746 94.72897 94.31990 108.06044 98.02072 90.86215 96.68674
#> [43] 94.60457 101.50038 124.53960 97.38374 102.62853 97.96640 77.60025
#> [50] 105.27133 94.15111 94.45562 96.64127 96.67811 101.81379 73.50738
#> [57] 123.00711 92.50233 98.18111 106.72402 89.26269 106.98611 93.32063
#> [64] 83.93697 85.88710 106.22919 96.82833 100.33093 78.38314 80.60329
#> [71] 98.08517 108.54988 97.47665 108.22563 100.21480 100.97619 93.74237
#> [78] 96.49655 93.80447 113.88418 107.55769 101.99468 100.00202 88.89021
#> [85] 105.41115 68.11546 92.61488 98.44372 90.21832 98.21272 104.53487
#> [92] 104.32399 93.38884 98.56437 110.36472 90.02529 102.96539 106.60318
#> [99] 90.40153 89.42880