Applies the wavelet-based and non-stationary simulation algorithm to multiple sites (single site possible as well)
prsim.wave.nonstat(data, station_id="Qobs", number_sim=1, win_h_length=15,
marginal=c("kappa","empirical"), n_par=4, n_wave=100, cov_name='T',
marginalpar=TRUE, GoFtest=NULL, verbose=TRUE,
suppWarn=FALSE, warming_level, ...)
A list with elements
A data frame with time information, observations, and
number_sim
columns containing the simulated runoff.
A matrix containing the estimated parameters of the marginal distribution (if marginalpar
).
A vector containing the p-values of ks.test
or ad.test
applied to the daily detrended data (if GoFtest
is not NULL)
list of data frames. One list entry, i.e. data frame, corresponds to one station. Each data frame contains the time indications and runoff of one station. See ‘Details’.
identifies the station in case several time series are present in data
. See ‘Details’.
number of simulations to be carried out.
(half-)length of moving window size.
marginal distribution to be used for the backtransformation. Can be either "kappa"
, "empirical"
, or any type of CDF (see ‘Details’). "kappa"
uses the four-parameter kappa distribution for backtransformation, "empirical"
uses the empirical distribution. CDF allows for specifying any distribution ‘Examples’.
number of parameters of the marginal distribution used
If (non-null) a GoF test for daily data should be performed: "KS"
performs a Kolmogorof-Smirnov test, and "AD"
performs an Anderson-Darling test. see ‘Details’)
logical. Should progress be reported?
character. 'T' for temperature. Has to correspond to covariate name used in data list.
logical. Should the estimated parameters of the distribution used be returned?
number of scales to be considered in the continuous wavelet transform.
logical. See ‘Details’.
a vector of station-specific warming levels. Each vector entry contains the warming level for the corresponding station part of the data list. For example, vector entry 1 represents the warming level for station 1 in the data list.
any other argument passed to the sub-function specifying the cdf for fitting. See ‘Details’ and ‘Examples’.
Manuela Brunner
Time can be given with three columns named "YYYY"
, "MM"
, "DD"
, or as in POSIXct format YYYY-MM-DD
.
All leap days (Feb 29th) will be omitted from the analysis, but no missing observations are allowed.
Stations are identified by list index.
The function homtest::par.kappa
might issue quite a few warnings of type In fn(par, ...) : value out of range in 'gammafn'
. The argument suppWarn
allows to silence warnings for the specific function call via suppressWarnings()
. Of course, a subsequent check via warnings()
is recommended.
Alternative distributions can be specified by providing three functions: (1) a function fitting the parameters of a distributions and providing a vector of these parameters as output (CDF_fit), (2) a function simulating random numbers from this distribution (rCDF), and (3) a function specifying the distribution (pCDF). See ‘Examples’ for the generalized beta for the second kind and for the Generalized Extreme Values (GEV) distribution.
When using the kappa distribution, the AD test can for certain values of the parameter h not be performed.
Brunner, M. I., and E. Gilleland (2024). Future changes in floods, droughts, and their extents in the Alps: a sensitivity analysis with a non-stationary stochastic streamflow generator, Earth's Future.
ks.test