Bivariate normal distribution

Bivariate normal distribution with mean \[\begin{bmatrix} 0 \\ 0 \end{bmatrix}\]

and covariance matrix \(\begin{bmatrix} 3 &-1 \\ -1 & 3 \end{bmatrix}\)

library(mnormt)

#make this example reproducible
set.seed(0)

#create bivariate normal distribution
x     <- seq(-3, 3, 0.1) 
y     <- seq(-3, 3, 0.1)
mu    <- c(0, 0)
sigma <- matrix(c(3, -1, -1, 3), nrow=2)
f     <- function(x, y) dmnorm(cbind(x, y), mu, sigma)
z     <- outer(x, y, f)

#create surface plot
persp(x, y, z, theta=-45, phi=25, expand=0.5, ticktype='detailed')

Bivariate normal distribution in nature

Bell mountain (钟山石窟), Shanxi, China