The shape of the bivariate normal distribution is again similar to a that of a bell. We substitute, and in Equation (1) and obtain the following 3D plot and contour plot. The equation for the correlation is given by. We are going to consider three cases: where and are uncorrelated, positively correlated (we use a correlation of 0.7 as an example) and negatively correlated (we use a correlation of -0.7 as an example). Let us obtain plots for the joint distribution of and both of which are standard normally distributed. A contour plot is usually accompanied by a legend relating the colours to values. If two points have the same colour in the contour plot, then they have equal values for their third dimension (let’s say that is the third dimension, then the two points have equal values). The third dimension is defined by the colour. The contour plot shows only two dimensions (let’s say the -axis and the -axis). When we see a 3D image/plot on a computer screen we are looking at it from one particular angle. This is because in order to understand a 3D image properly, we need to have a look at it through a number of different angles. A 3D plot is sometimes difficult to visualise properly. A contour graph is a way of displaying 3 dimensions on a 2D plot. One method is to plot a 3D graph and the other method is to plot a contour graph. There are two methods of plotting the Bivariate Normal Distribution. Plotting the Bivariate Normal Distribution This follows from the probability result that if has a probability distribution and has a probability distribution, and and are independent, then their joint probability distribution is. One can see that this joint distribution can be expressed as the product of two independent normal distribution functions: If and are two uncorrelated normally distributed random variables, their joint bivariate normal distribution is obtained by letting in the equation above. Let the covariance between and be then their joint (bivariate) normal distribution is given by: Let and be two normal random variable that have their joint probability distribution equal to the bivariate normal distribution. You can have a look at an article dedicated solely to the univariate normal distribution, available here. If we let and, has the probability distribution: The probability that takes on a value between and is given by: This is called the univariate normal distribution because only one random variable ( ) is involved. The probability distribution of is given by: Let be a normally distributed random variable with mean and standard deviation (or variance ). The Univariate Normal Distributionįirst let us consider the univariate normal distribution and then we will extend it to the bivariate normal distribution. The R codes used to generate the plots in this article are provided in the appendix at the end.
#Contour plot how to
This will lead to a study of copulas which offers a more general way how to combine two marginal distributions into one bivariate distribution. The effect of correlation on the conditional distributions of the bivariate normal distribution is studied.
![contour plot contour plot](https://i.stack.imgur.com/JPtQ4.jpg)
In particular the case in which the two variables have equal variances is considered. The effects of the means and the variances on the bivariate distribution are also analysed. We will construct 3D graphs and contour plots with R, displaying the bivariate normal distribution for the cases where there is positive, negative and no correlation between the two variables. However, the bivariate case helps us understand more the general multivariate case, especially with the use of 3D plots and contour plots. Sometimes the bivariate case is overlooked when the analysis shift directly from the univariate case to the multivariate case. In this article we are going to have a good look at the bivariate normal distribution and distributions derived from it, namely the marginal distributions and the conditional distributions. 3D and Contour Plots of the Bivariate Normal Distribution Introduction