dist.Matrix.Normal {LaplacesDemon} | R Documentation |
Matrix Normal Distribution
Description
These functions provide the density and random number generation for the matrix normal distribution.
Usage
dmatrixnorm(X, M, U, V, log=FALSE)
rmatrixnorm(M, U, V)
Arguments
X |
This is data or parameters in the form of a matrix with
|
M |
This is mean matrix with |
U |
This is a |
V |
This is a |
log |
Logical. If |
Details
Application: Continuous Multivariate Matrix
Density:
Inventors: Unknown
Notation 1:
Notation 2:
Parameter 1: location
matrix
Parameter 2: positive-definite
scale matrix
Parameter 3: positive-definite
scale matrix
Mean:
Variance: Unknown
Mode: Unknown
The matrix normal distribution is also called the matrix Gaussian, matrix-variate normal, or matrix-variate Gaussian distribution. It is a generalization of the multivariate normal distribution to matrix-valued random variables.
An example of the use of a matrix normal distribution is multivariate
regression, in which there is a matrix of
regression effects of
predictors for
dependent
variables. For univariate regression, having only one dependent
variable, the
regression effects may be multivariate normally
distributed. For multivariate regression, this multivariate normal
distribution may be extended to a matrix normal distribution to account
for relationships of the regression effects across
dependent
variables. In this example, the matrix normal distribution is the
conjugate prior distribution for these regression effects.
The matrix normal distribution has two covariance matrices, one for the
rows and one for the columns. When is diagonal, the rows are
independent. When
is diagonal, the columns are independent.
Value
dmatrixnorm
gives the density and
rmatrixnorm
generates random deviates.
Author(s)
Statisticat, LLC. software@bayesian-inference.com
See Also
dinvmatrixgamma
,
dmatrixgamma
, and
dmvn
.
Examples
library(LaplacesDemon)
N <- 10
K <- 4
U <- as.positive.definite(matrix(rnorm(N*N),N,N))
V <- as.positive.definite(matrix(rnorm(K*K),K,K))
x <- dmatrixnorm(matrix(0,N,K), matrix(0,N,K), U, V)
X <- rmatrixnorm(matrix(0,N,K), U, V)
joint.density.plot(X[,1], X[,2], color=TRUE)