dist.Multivariate.Normal.Precision.Cholesky {LaplacesDemon}  R Documentation 
Multivariate Normal Distribution: PrecisionCholesky Parameterization
Description
These functions provide the density and random number generation for the multivariate normal distribution, given the precisionCholesky parameterization.
Usage
dmvnpc(x, mu, U, log=FALSE)
rmvnpc(n=1, mu, U)
Arguments
x 
This is data or parameters in the form of a vector of length

n 
This is the number of random draws. 
mu 
This is mean vector 
U 
This is the 
log 
Logical. If 
Details
Application: Continuous Multivariate
Density:
p(\theta) = (2\pi)^{p/2} \Omega^{1/2} \exp(\frac{1}{2} (\theta\mu)^T \Omega (\theta\mu))
Inventor: Unknown (to me, anyway)
Notation 1:
\theta \sim \mathcal{MVN}(\mu, \Omega^{1})
Notation 2:
\theta \sim \mathcal{N}_k(\mu, \Omega^{1})
Notation 3:
p(\theta) = \mathcal{MVN}(\theta  \mu, \Omega^{1})
Notation 4:
p(\theta) = \mathcal{N}_k(\theta  \mu, \Omega^{1})
Parameter 1: location vector
\mu
Parameter 2: positivedefinite
k \times k
precision matrix\Omega
Mean:
E(\theta) = \mu
Variance:
var(\theta) = \Omega^{1}
Mode:
mode(\theta) = \mu
The multivariate normal distribution, or multivariate Gaussian
distribution, is a multidimensional extension of the onedimensional
or univariate normal (or Gaussian) distribution. 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 precisionCholesky parameterization for convenience and
familiarity. It is easier to calculate a multivariate normal density
with the precision parameterization, because a matrix inversion can be
avoided. The precision matrix is replaced with an uppertriangular
k \times k
matrix that is Cholesky factor
\textbf{U}
, as per the chol
function for Cholesky
decomposition.
A random vector is considered to be multivariate normally distributed
if every linear combination of its components has a univariate normal
distribution. This distribution has a mean parameter vector
\mu
of length k
and a k \times k
precision matrix \Omega
, which must be positivedefinite.
In practice, \textbf{U}
is fully unconstrained for proposals
when its diagonal is logtransformed. The diagonal is exponentiated
after a proposal and before other calculations. Overall, Cholesky
parameterization is faster than the traditional parameterization.
Compared with dmvnp
, dmvnpc
must additionally
matrixmultiply the Cholesky back to the covariance matrix, but it
does not have to check for or correct the precision matrix to
positivedefiniteness, which overall is slower. Compared with
rmvnp
, rmvnpc
is faster because the Cholesky decomposition
has already been performed.
For models where the dependent variable, Y, is specified to be
distributed multivariate normal given the model, the Mardia test (see
plot.demonoid.ppc
, plot.laplace.ppc
, or
plot.pmc.ppc
) may be used to test the residuals.
Value
dmvnpc
gives the density and
rmvnpc
generates random deviates.
Author(s)
Statisticat, LLC. software@bayesianinference.com
See Also
chol
,
dmvn
,
dmvnc
,
dmvnp
,
dnorm
,
dnormp
,
dnormv
,
dwishartc
,
plot.demonoid.ppc
,
plot.laplace.ppc
, and
plot.pmc.ppc
.
Examples
library(LaplacesDemon)
Omega < diag(3)
U < chol(Omega)
x < dmvnpc(c(1,2,3), c(0,1,2), U)
X < rmvnpc(1000, c(0,1,2), U)
joint.density.plot(X[,1], X[,2], color=TRUE)