EllDistrSim {ElliptCopulas}  R Documentation 
This function uses the decomposition X = \mu + R * A * U
where \mu
is the mean of X
, R
is the random radius,
A
is the squareroot of the covariance matrix of X
,
and U
is a uniform random variable of the ddimensional unit sphere.
Note that R
is generated using the MetropolisHasting algorithm.
EllDistrSim(
n,
d,
A = diag(d),
mu = 0,
density_R2,
genR = list(method = "pinv")
)
n 
number of observations. 
d 
dimension of 
A 
squareroot of the covariance matrix of 
mu 
mean of 
density_R2 
density of the random variable 
genR 
additional arguments for the generation of the squared radius. It must be a list with a component method:

a matrix of dimensions (n,d)
of simulated observations.
EllCopSim
for the simulation of elliptical copula samples,
EllCopEst
for the estimation of elliptical distributions,
EllDistrSimCond
for the conditional simulation of
elliptically distributed random vectors given some observe components.
# Sample from a 3dimensional normal distribution
X = EllDistrSim(n = 200, d = 3, density_R2 = function(x){stats::dchisq(x=x,df=3)})
plot(X[,1], X[,2])
X = EllDistrSim(n = 200, d = 3, density_R2 = function(x){stats::dchisq(x=x,df=3)},
genR = list(method = "MH", niter = 500))
plot(X[,1], X[,2])
# Sample from an Elliptical distribution for which the squared radius
# follows an exponential distribution
cov1 = rbind(c(1,0.5), c(0.5,1))
X = EllDistrSim(n = 1000, d = 2,
A = chol(cov1), mu = c(2,6),
density_R2 = function(x){return(exp(x) * (x > 0))} )