rmdata {ExtremeRisks} | R Documentation |
Simulation of
-Dimensional Temporally Independent Observations
Description
Simulates samples of independent -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 |
copula |
A string specifying the type copula to be used. By default |
par |
A list of |
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"
) withdegrees of freedom (
df
) and scale parametersfor
(
sigma
), Gaussian (copula="Gaussian"
) with correlation parametersfor
(
sigma
), Clayton (copula="Clayton"
) with dependence parameter(
dep
), Gumbel (copula="Gumbel"
) with dependence parameter(
dep
) and Frank (copula="Frank"
) with dependence parameter(
dep
).The available families of marginal distributions are:
Student-t (
dist="studentT"
) withdegrees of freedom (
df
);Asymmetric Student-t (
dist="AStudentT"
) withdegrees of freedom (
df
). In this case all the observations are only positive;Frechet (
dist="Frechet"
) with scale(
scale
) and shape(
shape
) parameters.Frechet (
dist="double-Frechet"
) with scale(
scale
) and shape(
shape
) parameters. In this case positive and negative observations are allowed;symmetric Pareto (
dist="double-Pareto"
) with scale(
scale
) and shape(
shape
) parameters. In this case positive and negative observations are allowed.
The available classes of multivariate joint distributions are:
studentT-studentT (
dist="studentT"
andcopula="studentT"
) with parameterspar <- list(df, sigma)
;studentT (
dist="studentT"
andcopula="None"
with parameterspar <- list(df, dim)
. In this case thed
variables are regarded as independent;studentT-AstudentT (
dist="AstudentT"
andcopula="studentT"
) with parameterspar <- list(df, sigma, shape)
;Gaussian-studentT (
dist="studentT"
andcopula="Gaussian"
) with parameterspar <- list(df, sigma)
;Gaussian-AstudentT (
dist="AstudentT"
andcopula="Gaussian"
) with parameterspar <- list(df, sigma, shape)
;Frechet (
dist="Frechet"
andcopula="None"
) with parameterspar <- list(shape, dim)
. In this case thed
variables are regarded as independent;Clayton-Frechet (
dist="Frechet"
andcopula="Clayton"
) with parameterspar <- list(dep, dim, scale, shape)
;Gumbel-Frechet (
dist="Frechet"
andcopula="Gumbel"
) with parameterspar <- list(dep, dim, scale, shape)
;Frank-Frechet (
dist="Frechet"
andcopula="Frank"
) with parameterspar <- list(dep, dim, scale, shape)
;Clayton-double-Frechet (
dist="double-Frechet"
andcopula="Clayton"
) with parameterspar <- list(dep, dim, scale, shape)
;Gumbel-double-Frechet (
dist="double-Frechet"
andcopula="Gumbel"
) with parameterspar <- list(dep, dim, scale, shape)
;Frank-double-Frechet (
dist="double-Frechet"
andcopula="Frank"
) with parameterspar <- list(dep, dim, scale, shape)
;Clayton-double-Pareto (
dist="double-Pareto"
andcopula="Clayton"
) with parameterspar <- list(dep, dim, scale, shape)
;Gumbel-double-Pareto (
dist="double-Pareto"
andcopula="Gumbel"
) with parameterspar <- list(dep, dim, scale, shape)
;Frank-double-Pareto (
dist="double-Pareto"
andcopula="Frank"
) with parameterspar <- list(dep, dim, scale, shape)
.
Note that above
dim
indicates the number ofd
marginal variables.
Value
A matrix of 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
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])