dist.Multivariate.Cauchy.Cholesky: Multivariate Cauchy Distribution: Cholesky Parameterization

Description Usage Arguments Details Value Author(s) See Also Examples

Description

These functions provide the density and random number generation for the multivariate Cauchy distribution, given the Cholesky parameterization.

Usage

1
2
dmvcc(x, mu, U, log=FALSE)
rmvcc(n=1, mu, U)

Arguments

x

This is either a vector of length k or a matrix with a number of columns, k, equal to the number of columns in scale matrix S.

n

This is the number of random draws.

mu

This is a numeric vector representing the location parameter, mu (the mean vector), of the multivariate distribution It must be of length k, as defined above.

U

This is the k x k upper-triangular matrix that is Cholesky factor U of the positive-definite scale matrix S.

log

Logical. If log=TRUE, then the logarithm of the density is returned.

Details

The multivariate Cauchy distribution is a multidimensional extension of the one-dimensional or univariate Cauchy distribution. The multivariate Cauchy distribution is equivalent to a multivariate t distribution with 1 degree of freedom. A random vector is considered to be multivariate Cauchy-distributed if every linear combination of its components has a univariate Cauchy distribution.

The Cauchy distribution is known as a pathological distribution because its mean and variance are undefined, and it does not satisfy the central limit theorem.

In practice, U is fully unconstrained for proposals when its diagonal is log-transformed. The diagonal is exponentiated after a proposal and before other calculations. Overall, the Cholesky parameterization is faster than the traditional parameterization. Compared with dmvc, dmvcc must additionally matrix-multiply the Cholesky back to the scake matrix, but it does not have to check for or correct the scale matrix to positive-definiteness, which overall is slower. Compared with rmvc, rmvcc is faster because the Cholesky decomposition has already been performed.

Value

dmvcc gives the density and rmvcc generates random deviates.

Author(s)

Statisticat, LLC. software@bayesian-inference.com

See Also

chol, dcauchy, dinvwishartc, dmvcpc, dmvtc, and dmvtpc.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(LaplacesDemon)
x <- seq(-2,4,length=21)
y <- 2*x+10
z <- x+cos(y) 
mu <- c(1,12,2)
Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3)
U <- chol(Sigma)
f <- dmvcc(cbind(x,y,z), mu, U)

X <- rmvcc(1000, rep(0,2), diag(2))
X <- X[rowSums((X >= quantile(X, probs=0.025)) &
     (X <= quantile(X, probs=0.975)))==2,]
joint.density.plot(X[,1], X[,2], color=TRUE)

LaplacesDemon documentation built on July 9, 2021, 5:07 p.m.