Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dist.Multivariate.Cauchy.Precision.Cholesky

Multivariate Cauchy Distribution: Precision-Cholesky Parameterization


Description

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

Usage

dmvcpc(x, mu, U, log=FALSE)
rmvcpc(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 precision matrix Omega.

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 precision matrix Omega.

log

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

Details

  • Application: Continuous Multivariate

  • Density:

    p(theta) = (Gamma((nu+k)/2) / (Gamma(1/2)*1^(k/2)*pi^(k/2))) * |Omega|^(1/2) * (1 + (theta-mu)^T Omega (theta-mu))^(-(1+k)/2)

  • Inventor: Unknown (to me, anyway)

  • Notation 1: theta ~ MC[k](mu, Omega^(-1))

  • Notation 2: p(theta) = MC[k](theta | mu, Omega^(-1))

  • Parameter 1: location vector mu

  • Parameter 2: positive-definite k x k precision matrix Omega

  • Mean: E(theta) = mu

  • Variance: var(theta) =

  • Mode: mode(theta) = mu

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

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.

It is usually parameterized with mean and a covariance matrix, or in Bayesian inference, with mean and a precision matrix, where the precision matrix is the matrix inverse of the covariance matrix. These functions provide the precision parameterization for convenience and familiarity. It is easier to calculate a multivariate Cauchy density with the precision parameterization, because a matrix inversion can be avoided.

This distribution has a mean parameter vector mu of length k, and a k x k precision matrix Omega, which must be positive-definite. The precision matrix is replaced with the upper-triangular Cholesky factor, as in chol.

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, Cholesky parameterization is faster than the traditional parameterization. Compared with dmvcp, dmvcpc must additionally matrix-multiply the Cholesky back to the covariance matrix, but it does not have to check for or correct the precision matrix to positive-definiteness, which overall is slower. Compared with rmvcp, rmvcpc is faster because the Cholesky decomposition has already been performed.

Value

dmvcpc gives the density and rmvcpc generates random deviates.

Author(s)

See Also

Examples

library(LaplacesDemon)
x <- seq(-2,4,length=21)
y <- 2*x+10
z <- x+cos(y) 
mu <- c(1,12,2)
Omega <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3)
U <- chol(Omega)
f <- dmvcpc(cbind(x,y,z), mu, U)

X <- rmvcpc(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

Complete Environment for Bayesian Inference

v16.1.4
MIT + file LICENSE
Authors
Byron Hall [aut], Martina Hall [aut], Statisticat, LLC [aut], Eric Brown [ctb], Richard Hermanson [ctb], Emmanuel Charpentier [ctb], Daniel Heck [ctb], Stephane Laurent [ctb], Quentin F. Gronau [ctb], Henrik Singmann [cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.