rmdata {ExtremeRisks}R Documentation

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)

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.

Value

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

Author(s)

Simone Padoan, simone.padoan@unibocconi.it, http://mypage.unibocconi.it/simonepadoan/; Gilles Stupfler, gilles.stupfler@ensai.fr, http://ensai.fr/en/equipe/stupfler-gilles/

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

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

[Package ExtremeRisks version 0.0.4 Index]