Learn R Programming

ExtremalDep (version 1.0.0)

rExtDep: Parametric and semi-parametric random generator of extreme events

Description

Generates random samples of iid observations from extremal dependence models and semi-parametric stochastic generators.

Usage

rExtDep(n, model, par, angular = FALSE, mar = c(1,1,1), num, threshold, exceed.type)

Value

A matrix with \(n\) rows and \(p \ge 2\) columns. \(p = 2\) when model = "semi.bvevd" or "semi.bvexceed".

Arguments

n

An integer indicating the number of observations.

model

A character string with the name of the model. Parametric models include "HR" (Husler-Reiss), "ET" (Extremal-t), "EST" (Extremal Skew-t). Semi-parametric generators include "semi.bvevd" and "semi.bvexceed".

par

A vector representing the parameters of the (parametric or non-parametric) model.

angular

Logical; TRUE for angular outputs.

mar

A vector or matrix of marginal parameters.

num

An integer indicating the number of observations over which the componentwise maxima is computed. Required for model = "HR", "ET" or "EST". Default: 5e+5.

threshold

A bivariate vector indicating the level of exceedances. Required for model = "semi.bvexceed".

exceed.type

A character string taking values "and" or "or" indicating the type of exceedances. Required for model = "semi.bvexceed".

Details

There is no limit on the dimensionality when model = "HR", "ET" or "EST", while model = "semi.bvevd" and "semi.bvexceed" can only generate bivariate observations.

When angular = TRUE and model = "semi.bvevd" or "semi.bvexceed", the simulation of pseudo-angles follows Algorithm 1 of Marcon et al. (2017).

When model = "semi.bvevd" and angular = FALSE, maxima samples are generated according to Algorithm 2 of Marcon et al. (2017).

When model = "semi.bvexceed" and angular = FALSE, exceedance samples are generated above the value specified by threshold, according to Algorithm 3 of Marcon et al. (2017). exceed.type = "and" generates samples that exceed both thresholds while exceed.type = "or" generates samples exceeding at least one threshold.

If mar is a vector, the marginal distributions are identical. If a matrix is provided, each row corresponds to a set of marginal parameters. No marginal transformation is applied when mar = c(1,1,1).

References

Marcon, G., Naveau, P. and Padoan, S. A. (2017). A semi-parametric stochastic generator for bivariate extreme events. Stat, 6, 184--201.

See Also

dExtDep, pExtDep, fExtDep, fExtDep.np

Examples

Run this code
# \donttest{
# Example using the trivariate Husler-Reiss
set.seed(1)
data <- rExtDep(n = 10, model = "HR", par = c(2,3,3))

# Example using the semi-parametric generator of maxima
set.seed(2)
beta <- c(1.0000000, 0.8714286, 0.7671560, 0.7569398, 
          0.7771908, 0.8031573, 0.8857143, 1.0000000)
data <- rExtDep(n = 10, model = "semi.bvevd", par = beta, 
                mar = rbind(c(0.2, 1.5, 0.6), c(-0.5, 0.4, 0.9)))

# Example using the semi-parametric generator of exceedances
set.seed(3)
data <- rExtDep(n = 10, model = "semi.bvexceed", par = beta, 
                threshold = c(0.2, 0.4), exceed.type = "and")
# }

Run the code above in your browser using DataLab