relliptical: Simulate a Sample from an Elliptical Distribution

View source: R/elliptical.R

rellipticalR Documentation

Simulate a Sample from an Elliptical Distribution

Description

Generate a sample from an elliptical distribution with location mu, scatter matrix sigma and generating variate specified by the sample r. Size of the generated sample is length(r).

Usage

relliptical(r, mu, sigma)

Arguments

r

A double or integer vector representing a sample from the generating variate.

mu

A double or integer vector representing location of the distribution.

sigma

A double or integer matrix representing the scatter matrix of the distribution. Argument sigma must be symmetric positive-definite scatter matrix.

Details

Function samples from a random variable X with stochastic representation

X \stackrel{d}{=} \mu + \mathcal{R} \Lambda \mathcal{U},

where \mu\in\mathbb{R}^m, \mathcal{R} is is nonnegative random variable, \mathcal{U} is a m-dimensional random vector uniformly distributed on a unit sphere and \Lambda\in \mathbb{R}^{m\times m} is a matrix such that \Sigma = \Lambda\Lambda^T is a symmetric positive-definite matrix. Random variables \mathcal{R} and \mathcal{U} are independent. See, for example, (Cambanis et al. 1981) for more information about elliptical distributions.

Matrix \Lambda is calculated with help of the eigenvalue decomposition. I.e,

\Lambda = U A^{1/2} U^T,

where U is a orthogonal matrix with eigenvectors of the matrix \Sigma as columns and A^{1/2} = \textrm{diag}(\lambda^{1/2}_1, \lambda^{1/2}_2, \dots, \lambda^{1/2}_m). Here \lambda_1, \lambda_2, \ldots, \lambda_m are eigenvalues of the matrix \Sigma.

Value

An length(r) times length(mu) matrix with one observation in each row.

References

Cambanis S, Huang S, Simons G (1981). "On the theory of elliptically contoured distributions." Journal of Multivariate Analysis, 11(3), 368-385.

See Also

ellipsoidq, qreg

Examples

# Simulate a sample from 2-dimensional t-distribution with degrees of
# freedom equal to three.
n <- 100
d <- 2
df <- 3
r <- sqrt(d * rf(n, d, df))
mu <- c(-1, 1)
sigma <- matrix(c(11, 10.5, 10.5, 11.25), nrow = 2, byrow = TRUE)
x <- relliptical(r, mu, sigma)

# Plot the sample
plot(x)


perej1/extreme documentation built on Dec. 4, 2024, 4:27 p.m.