mLaplace {L1pack} | R 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 |
Scatter |
a |
log |
logical; if TRUE, the logarithm of the density function is returned. |
Details
The multivariate Laplace distribution is a multidimensional extension of the 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(\bold{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 x
is a matrix with n
rows, then dmLaplace
returns a
n\times 1
vector considering each row of x
as a copy from
the multivariate Laplace.
If n = 1
, then rmLaplace
returns 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)