In a previous blog post, I have discussed the case of normally distributed random variables. But what happens if we have a vector whose components are random variables with this kind of distribution? In particular, what is the expression of the joint probability density? I don’t know how to derive this formula from the marginal distributions, but I have been able to demonstrate, after several hours of work, the following proposition.

**Proposition 1. **The joint probability density in the case of a random vector whose two components follow a normal distribution is:

where σ_1 and σ_2 are the standard deviations, μ_1 and μ_2 are the expectations of the two random variables and ρ is the correlation coefficient between the two variables.

**Proof. **The marginal distribution of x_1 is given by

By operating the substitutions

we obtain

This demonstrates that x_1 is in fact a normally distributed random variable and that its expectation and standard deviation are σ_1 and μ_1, respectively. The same applies to x_2. In order to demonstrate that ρ is the correlation coefficient between x_1 and x_2 we have to calculate the covariance of f_X, which is given by E[X_1,X_2]-E[X_1]E[X_2]. The first addend is given by:

Let’s consider the inner integral and the following substitutions

We have:

The two integrals inside the root square are not the easiest ones, and I will not discuss them here. Just consider that they can be solved using the well known results:

We have

If we put these two integrals inside I, we obtain

The two inner integrals are two difficult ones, again. The first one can be solved using the same exponential integral used above:

For the other inner integral we have

The first and the second integrals can be solved using the table previously reported, while the third one is zero. At the end of all this work, we have:

And this proves that ρ is the correlation coefficient between x_1 and x_2. This is a complete demonstration of the expression of the joint probability density of a bivariate normal distribution ■

This formula can be extended to the case of *m *components.

**Proposition 2. **The joint probability density in the case of a random vector whose *m* components follow a normal distribution is:

where C is the covariance matrix, given by

**Proof. **This formula is easy to prove in the case of *m=2*, using proposition 1. I have no idea about how it could be proved when *m>2 ■*

I have written a code in Fortran (download) that asks you for expectations, standard deviations and correlation coefficient and plots the joint density of the bivariate normal distribution. I have written a code in Octave that does the same job (download). In the picture below you find the joint density for two standard normally distributed random variables with ρ=0 (left), ρ=0.7 (right, upper half) and ρ=-0.7 (right, lower half). These pictures have been plotted by the code in Fortran. The other image is a comparison between the two programs, for another bivariate normal distribution.

## One thought on “Bivariate normal distribution”