Peter Ralph
Advanced Biological Statistics
multivariate Gaussian
or MVN
If \(X\) is random vector that has a multivariate Normal distribution, we say \[\begin{aligned} X = (X_1, \ldots, X_k) \sim \MVN(\mu, \Sigma) . \end{aligned}\]
The parameters are the mean vector \(\mu\) and covariance matrix \(\Sigma\): \[\begin{aligned} \E[X_i] = \mu_i \end{aligned}\] and \[\begin{aligned} \cov[X_i, X_j] = \Sigma_{i,j} . \end{aligned}\]
Properties:
\(X_i \sim \Normal(\mu_i, \sqrt{\Sigma_{i,i}})\)
If \(\Sigma_{i,j} = 0\) then \(X_i\) and \(X_j\) are independent.
Level curves of the probability density function are ellipses.
Let’s say that \(X \sim \Normal(0, 1)\) and \[\begin{aligned} Y &= \beta X + \epsilon \\ \epsilon &\sim \Normal(0, \sigma) . \end{aligned}\]
Then \(Y\) also has a Normal distribution, and \[\begin{aligned} \var[X] &= 1, \\ \var[Y] &= \beta^2 + \sigma^2 \qquad \text{and} \\ \cov[X, Y] &= \beta, \end{aligned}\]
so \[\begin{aligned} (X, Y) \sim \MVN\left( \begin{bmatrix} 0 \\ 0 \end{bmatrix} \begin{bmatrix} 1 & \beta \\ \beta & \beta^2 + \sigma^2 \end{bmatrix} \right) . \end{aligned}\]
Let’s have a look:
Let’s have a look:
Think of three, correlated variables and decide what their means and covariance matrix, \(\Sigma\) should be. (Do this by choosing (a) standard deviations, sigma
, (b) correlations C
and using Sigma <- diag(sigma) %*% C %*% diag(sigma)
.)
Use mvtnorm::rmvnorm( )
to simulate 10,000 random draws from this distribution. This will give you a \(10^4 \times 3\) matrix. Make histograms of each variable, and look at a pairs(X, asp=1)
plot.