Multidimensional gaussians

An important case of a random vector is the multidimensional Gaussian. For d-dimensions:

fX(x)=1(2π)d|Σ|exp(12(xμ)TΣ1(xμ)) It can be shown that:

E[X]=μ and Cov(X)=Σ

If the variables are independant this simplifies (as shown in text):

fX(x)=ni=11(2π)σ2iexp((xμi)22σ2i)

where σ2i=Var[Xi]

Example in R

Recall the example above, where Σ=[3111]

data |> ggplot(aes(x=x,y=y))+geom_point()

Let’s compute the covariance matrix from the data:

cov(data)
##          x        y
## x 3.066814 1.012193
## y 1.012193 1.011582