Exercise

Samples from multivariate normal distributions

The multivariate normal is the most important distribution in multivariate statistics. Here, you will learn to simulate data that follow a specified multivariate normal distribution by generating samples from a bivariate normal distribution, with a mean and variance-covariance matrix specified as:

$${\mu}={\begin{pmatrix} 2 \\ -2 \end{pmatrix}},\quad { \Sigma }={\begin{pmatrix} 9 & 5 \\ 5 & 4 \end{pmatrix}}$$

For this exercise, and the rest of the chapter, the mean and the variance-covariance matrix will be preloaded for you as mu.sim and sigma.sim.

Instructions

100 XP
  • Generate 100 samples from the bivariate normal distribution and assign them to the object multnorm.sample.
  • Print the first six samples.
  • Create a scatter plot of the generated samples.