pRsim.wave.nonstat {PRSim}R Documentation

Simulate for multiple stations under non-stationary conditions

Description

Applies the wavelet-based and non-stationary simulation algorithm to multiple sites (single site possible as well)

Usage

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, ...)

Arguments

data

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’.

station_id

identifies the station in case several time series are present in data. See ‘Details’.

number_sim

number of simulations to be carried out.

win_h_length

(half-)length of moving window size.

marginal

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’.

n_par

number of parameters of the marginal distribution used

GoFtest

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’)

verbose

logical. Should progress be reported?

cov_name

character. 'T' for temperature. Has to correspond to covariate name used in data list.

marginalpar

logical. Should the estimated parameters of the distribution used be returned?

n_wave

number of scales to be considered in the continuous wavelet transform.

suppWarn

logical. See ‘Details’.

warming_level

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’.

Details

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.

Value

A list with elements

simulation

A data frame with time information, observations, and number_sim columns containing the simulated runoff.

pars

A matrix containing the estimated parameters of the marginal distribution (if marginalpar).

p_val

A vector containing the p-values of ks.test or ad.test applied to the daily detrended data (if GoFtest is not NULL)

Author(s)

Manuela Brunner

References

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.

See Also

ks.test


[Package PRSim version 1.5 Index]