rmcd {mcauchyd}R Documentation

Simulate from a Multivariate Cauchy Distribution

Description

Produces one or more samples from the multivariate (pp variables) Cauchy distribution (MCD) with location parameter mu and scatter matrix Sigma.

Usage

rmcd(n, mu, Sigma, tol = 1e-6)

Arguments

n

integer. Number of observations.

mu

length pp numeric vector. The location parameter.

Sigma

symmetric, positive-definite square matrix of order pp. The scatter matrix.

tol

tolerance for numerical lack of positive-definiteness in Sigma (for mvrnorm, see Details).

Details

A sample from a MCD with parameters μ\boldsymbol{\mu} and Σ\Sigma can be generated using:

X=μ+Yu\displaystyle{\mathbf{X} = \boldsymbol{\mu} + \frac{\mathbf{Y}}{\sqrt{u}}}

where Y\mathbf{Y} is a random vector distributed among a centered Gaussian density with covariance matrix Σ\Sigma (generated using mvrnorm) and uu is distributed among a Chi-squared distribution with 1 degree of freedom.

Value

A matrix with pp columns and nn rows.

Author(s)

Pierre Santagostini, Nizar Bouhlel

See Also

dmcd: probability density of a MCD.

Examples

mu <- c(0, 1, 4)
sigma <- matrix(c(1, 0.6, 0.2, 0.6, 1, 0.3, 0.2, 0.3, 1), nrow = 3)
x <- rmcd(100, mu, sigma)
x
apply(x, 2, median)


[Package mcauchyd version 1.3.2 Index]