In this class we’re going to talk about the multivariate Gaussian. So, in all our past lectures we’ve looked at the one-dimensional case, so one-dimensional distributions both discrete and continuous. When we talk about the multivariate Gaussian distribution we’re talking about two or more dimensions, and of course MATLAB is perfect for this because it works with all matrices and vectors. So now what happens when you extend the Gaussian like this? So the first thing is that the mean becomes a vector, and again this doesn’t really change the definition of the mean. You still add up all the values of X and divide by n to get your sample mean. So as an example let’s say we have a random matrix with 100 values and with 10 dimensions. Alright, so, if we do mean(X) we get a 1 by 10 matrix, and each component is the 100 values in that column summed up together and divided by 100. The thing that is kind of more different than the one dimensional case is the variance. So we see this Sigma symbol here and what this stands for is the covariance matrix. So, with the variance it told us how far X was spread out from the mean, the covariance does that too but only on the diagonals. So, on the off diagonals it tells us how correlated one dimension is with the other, and so you can see here the definition of the covariance matrix is the covariance of the if dimension with the jf dimension, and that would be the ij of element of the covariance matrix. We don’t really need to worry about how to calculate it because we are in the end going to end up using the matlab function cov. So let’s check that covariance is 10 by 10, so our dimensionality is 10. What’s interesting about the PDF of the Gaussian in the multi-dimensional case is that we never use the covariance directly. We use the inverse right here in the exponent and the determinant, and again since we already wrote a function to calculate Gaussians before I’m not going to ask you to do it again. There’s already a function called mvnpdf in matlab that will do this for you. So I’ve got an example here that I want to show you. We set our mean and our covariance… Don’t worry about this code too much since it is not the focus of this lecture, we’re simply setting the x-axis, so the X1 and X2 values. Note that the dimensionality of X is 2, so mu is two-dimensional and Sigma is two by two. So here we calculate PDF value using mvnpdf, and we’re going to do a surface plot of F versus X1 and X2. So now some points worth talking about is this distribution is more spread out on the X2 axis than the X1 axis, and that’s because you see here this distribution has a variance of 1 on the X2 axis, but a variance of point .25 on the X 1 axis, and since the off diagonals are not zero what we get is a Gaussian that is not perpendicular to the X1 and X2 axes.
Subscribe on YouTube!
Most Popular Courses
-
The Complete Ethical Hacking Course Bundle!
Rated 4.62 out of 5
$780.00Original price was: $780.00.$19.99Current price is: $19.99. -
The Complete Linux Administration Course Bundle!
Rated 4.94 out of 5
$780.00Original price was: $780.00.$19.99Current price is: $19.99. -
26 Course Forever Bundle!
Rated 5.00 out of 5
$2,730.00Original price was: $2,730.00.$39.99Current price is: $39.99. -
The Complete MATLAB 7 Course Bundle!
Rated 4.60 out of 5
$585.00Original price was: $585.00.$29.99Current price is: $29.99. -
The Learn to Code 8 Course Bundle!
Rated 5.00 out of 5
$780.00Original price was: $780.00.$19.99Current price is: $19.99. -
The Complete Python 3 Course: Beginner to Advanced!
Rated 5.00 out of 5
$199.99Original price was: $199.99.$9.99Current price is: $9.99. -
The Ermin Kreponic Course Bundle!
Rated 4.54 out of 5
$1,755.00Original price was: $1,755.00.$39.99Current price is: $39.99. -
The Complete Digital Marketing Course Bundle!
$780.00Original price was: $780.00.$19.99Current price is: $19.99. -
Certified Ethical Hacker Boot Camp!
$195.00Original price was: $195.00.$9.99Current price is: $9.99. -
Linux System Administration for Beginners!
Rated 5.00 out of 5
$199.99Original price was: $199.99.$9.99Current price is: $9.99.