# Matrix normal distribution

The matrix normal distribution is a probability distribution that is a generalization of the normal distribution. The probability density function for the random matrix X (n × p) that follows the matrix normal distribution has the form

${\displaystyle p(\mathbf {X} |\mathbf {M} ,{\boldsymbol {\Omega }},{\boldsymbol {\Sigma }})=(2\pi )^{-np/2}|{\boldsymbol {\Omega }}|^{-n/2}|{\boldsymbol {\Sigma }}|^{-p/2}\exp \left(-{\frac {1}{2}}{\mbox{tr}}\left[{\boldsymbol {\Omega }}^{-1}(\mathbf {X} -\mathbf {M} )^{T}{\boldsymbol {\Sigma }}^{-1}(\mathbf {X} -\mathbf {M} )\right]\right).}$

where M is n × p, Ω is p × p and Σ is n × n. There are several ways to define the two covariance matrices. One possibility is

${\displaystyle {\boldsymbol {\Sigma }}=E[(\mathbf {X} -\mathbf {M} )(\mathbf {X} -\mathbf {M} )^{T}]\;,\;\;\;\;{\boldsymbol {\Omega }}=E[(\mathbf {X} -\mathbf {M} )^{T}(\mathbf {X} -\mathbf {M} )]/c,}$

where c is a constant which depends on Σ and ensures appropriate power normalization.

The matrix normal is related to the multivariate normal distribution in the following way:

${\displaystyle \mathbf {X} \sim MN_{n\times p}(\mathbf {M} ,{\boldsymbol {\Omega }},{\boldsymbol {\Sigma }})}$

if and only if

${\displaystyle \mathrm {vec} \;\mathbf {X} \sim N_{np}(\mathrm {vec} \;\mathbf {M} ,{\boldsymbol {\Omega }}\otimes {\boldsymbol {\Sigma }}),}$

where ${\displaystyle \otimes }$ denotes the Kronecker product and ${\displaystyle \mathrm {vec} \;\mathbf {M} }$ denotes the vectorization of ${\displaystyle \mathbf {M} }$.