Exercise

Calculating the density of multivariate normal

For many statistical tasks, like hypothesis testing, clustering, and likelihood calculation, you are required to calculate the density of a specified multivariate normal distribution. In this exercise, you will use the dmvnorm() function to calculate multivariate normal densities with specified mean and variance-covariance matrix at each of the observations from your previously generated sample multnorm.sample.

The mean and the variance-covariance matrix are preloaded for you as objects mu.sim and sigma.sim.

Instructions

100 XP
  • Use dmvnorm() to calculate the density heights of the 100 samples in multnorm.sample for a bivariate normal.
  • Use scatterplot3d() to plot a 3D scatterplot of the density heights at each of the generated sample points.