Learn R Programming

ExtremeRisks (version 0.0.4)

rmdata: Simulation of \(d\)-Dimensional Temporally Independent Observations

Description

Simulates samples of independent \(d\)-dimensional observations from parametric families of joint distributions with a given copula and equal marginal distributions.

Usage

rmdata (ndata, dist="studentT", copula="studentT", par)

Value

A matrix of \((n \times d)\) observations simulated from a specified multivariate parametric joint distribution.

Arguments

ndata

A positive interger specifying the number of observations to simulate.

dist

A string specifying the parametric family of equal marginal distributions. By default dist="studentT" specifies a Student-t family of distributions. See Details.

copula

A string specifying the type copula to be used. By default copula="studentT" specifies the Student-t copula. See Details.

par

A list of \(p\) parameters to be specified for the multivariate parametric family of distributions. See Details.

Details

For a joint multivariate distribution with a given parametric copula class (copula) and a given parametric family of equal marginal distributions (dist), a sample of size ndata is simulated.

  • The available copula classes are: Student-t (copula="studentT") with \(\nu>0\) degrees of freedom (df) and scale parameters \(\rho_{i,j}\in (-1,1)\) for \(i \neq j=1,\ldots,d\) (sigma), Gaussian (copula="Gaussian") with correlation parameters \(\rho_{i,j}\in (-1,1)\) for \(i \neq j=1,\ldots,d\) (sigma), Clayton (copula="Clayton") with dependence parameter \(\theta>0\) (dep), Gumbel (copula="Gumbel") with dependence parameter \(\theta\geq 1\) (dep) and Frank (copula="Frank") with dependence parameter \(\theta>0\) (dep).

  • The available families of marginal distributions are:

    • Student-t (dist="studentT") with \(\nu>0\) degrees of freedom (df);

    • Asymmetric Student-t (dist="AStudentT") with \(\nu>0\) degrees of freedom (df). In this case all the observations are only positive;

    • Frechet (dist="Frechet") with scale \(\sigma>0\) (scale) and shape \(\alpha>0\) (shape) parameters.

    • Frechet (dist="double-Frechet") with scale \(\sigma>0\) (scale) and shape \(\alpha>0\) (shape) parameters. In this case positive and negative observations are allowed;

    • symmetric Pareto (dist="double-Pareto") with scale \(\sigma>0\) (scale) and shape \(\alpha>0\) (shape) parameters. In this case positive and negative observations are allowed.

  • The available classes of multivariate joint distributions are:

    • studentT-studentT (dist="studentT" and copula="studentT") with parameters par <- list(df, sigma);

    • studentT (dist="studentT" and copula="None" with parameters par <- list(df, dim). In this case the d variables are regarded as independent;

    • studentT-AstudentT (dist="AstudentT" and copula="studentT") with parameters par <- list(df, sigma, shape);

    • Gaussian-studentT (dist="studentT" and copula="Gaussian") with parameters par <- list(df, sigma);

    • Gaussian-AstudentT (dist="AstudentT" and copula="Gaussian") with parameters par <- list(df, sigma, shape);

    • Frechet (dist="Frechet" and copula="None") with parameters par <- list(shape, dim). In this case the d variables are regarded as independent;

    • Clayton-Frechet (dist="Frechet" and copula="Clayton") with parameters par <- list(dep, dim, scale, shape);

    • Gumbel-Frechet (dist="Frechet" and copula="Gumbel") with parameters par <- list(dep, dim, scale, shape);

    • Frank-Frechet (dist="Frechet" and copula="Frank") with parameters par <- list(dep, dim, scale, shape);

    • Clayton-double-Frechet (dist="double-Frechet" and copula="Clayton") with parameters par <- list(dep, dim, scale, shape);

    • Gumbel-double-Frechet (dist="double-Frechet" and copula="Gumbel") with parameters par <- list(dep, dim, scale, shape);

    • Frank-double-Frechet (dist="double-Frechet" and copula="Frank") with parameters par <- list(dep, dim, scale, shape);

    • Clayton-double-Pareto (dist="double-Pareto" and copula="Clayton") with parameters par <- list(dep, dim, scale, shape);

    • Gumbel-double-Pareto (dist="double-Pareto" and copula="Gumbel") with parameters par <- list(dep, dim, scale, shape);

    • Frank-double-Pareto (dist="double-Pareto" and copula="Frank") with parameters par <- list(dep, dim, scale, shape).

    Note that above dim indicates the number of d marginal variables.

References

Joe, H. (2014). Dependence Modeling with Copulas. Chapman & Hall/CRC Press, Boca Raton, USA.

Padoan A.S. and Stupfler, G. (2020). Joint inference on extreme expectiles for multivariate heavy-tailed distributions. arXiv e-prints arXiv:2007.08944, https://arxiv.org/abs/2007.08944.

See Also

rtimeseries, rbtimeseries

Examples

Run this code
library(plot3D)
library(copula)
library(evd)

# Data simulation from a 3-dimensional random vector a with multivariate distribution
# given by a Gumbel copula and three equal Frechet marginal distributions

# distributional setting
copula <- "Gumbel"
dist <- "Frechet"

# parameter setting
dep <- 3
dim <- 3
scale <- rep(1, dim)
shape <- rep(3, dim)
par <- list(dep=dep, scale=scale, shape=shape, dim=dim)

# sample size
ndata <- 1000

# Simulates a sample from a multivariate distribution with equal Frechet
# marginal distributions and a Gumbel copula
data <- rmdata(ndata, dist, copula, par)
scatter3D(data[,1], data[,2], data[,3])


# Data simulation from a 3-dimensional random vector a with multivariate distribution
# given by a Gaussian copula and three equal Student-t marginal distributions

# distributional setting
dist <- "studentT"
copula <- "Gaussian"

# parameter setting
rho <- c(0.9, 0.8, 0.7)
sigma <- c(1, 1, 1)
Sigma <- sigma^2 * diag(dim)
Sigma[lower.tri(Sigma)] <- rho
Sigma <- t(Sigma)
Sigma[lower.tri(Sigma)] <- rho
df <- 3
par <- list(sigma=Sigma, df=df)

# sample size
ndata <- 1000

# Simulates a sample from a multivariate distribution with equal Student-t
# marginal distributions and a Gaussian copula
data <- rmdata(ndata, dist, copula, par)
scatter3D(data[,1], data[,2], data[,3])

Run the code above in your browser using DataLab