mLaplace: Multivariate Laplace distribution

mLaplaceR Documentation

Multivariate Laplace distribution

Description

These functions provide the density and random number generation from the multivariate Laplace distribution.

Usage

dmLaplace(x, center = rep(0, nrow(Scatter)), Scatter = diag(length(center)), log = FALSE)
rmLaplace(n = 1, center = rep(0, nrow(Scatter)), Scatter = diag(length(center)))

Arguments

x

vector or matrix of data.

n

the number of samples requested.

center

a k\times 1 vector giving the locations.

Scatter

a k \times k positive-definite dispersion matrix.

log

logical; if TRUE, the logarithm of the density function is returned.

Details

The multivariate Laplace distribution is a multidimensional extension of the one-dimensional or univariate symmetric Laplace distribution. There are multiple forms of the multivariate Laplace distribution. Here, a particular case of the multivarite power exponential distribution introduced by Gomez et al. (1998) is considered.

The multivariate Laplace distribution with location \bold{\mu} = center and \bold{\Sigma} = Scatter has density

f(x) = \frac{\Gamma(k/2)}{\pi^{k/2}\Gamma(k)2^{k+1}}|\bold{\Sigma}|^{-1/2} \exp\left\{-\frac{1}{2}[(\bold{x} - \bold{\mu})^T \bold{\Sigma}^{-1} (\bold{x} - \bold{\mu})]^{1/2}\right\}.

The function rmLaplace is an interface to C routines, which make calls to subroutines from LAPACK. The matrix decomposition is internally done using the Cholesky decomposition. If Scatter is not non-negative definite then there will be a warning message.

Value

If n = 1 a vector of the same length as center, otherwise a matrix of n rows of random vectors.

References

Fang, K.T., Kotz, S., Ng, K.W. (1990). Symmetric Multivariate and Related Distributions. Chapman & Hall, London.

Gomez, E., Gomez-Villegas, M.A., Marin, J.M. (1998). A multivariate generalization of the power exponential family of distributions. Communications in Statistics - Theory and Methods 27, 589-600.

Examples

# dispersion parameters
Scatter <- matrix(c(1,.5,.5,1), ncol = 2)
Scatter

# generate the sample
y <- rmLaplace(n = 2000, Scatter = Scatter)

# scatterplot of a random bivariate Laplace sample with center
# vector zero and scale matrix 'Scatter'
par(pty = "s")
plot(y, xlab = "", ylab = "")
title("bivariate Laplace sample", font.main = 1)

L1pack documentation built on May 31, 2023, 6:31 p.m.

Related to mLaplace in L1pack...