(a) Write a function to generate multivariate normal random numbers of a specified dimension and with a...

Question:

(a) Write a function to generate multivariate normal random numbers of a specified dimension and with a specified covariance matrix. The first statement for an \(\mathrm{R}\) function should be rmulvnorm The R function chol computes the transformation matrix from Sigma. (The function rmulvnorm has the same functionality as the function rmvnorm in the mvtnorm package.)

(b) Use your function from the previous step to generate a sample of 1,000 trivariate normal random variables with mean of 0 and variance-covariance matrix \[ \Sigma=\left[\begin{array}{rrr} 9 & -3 & 2 \\ -3 & 4 & -1 \\ 2 & -1 & 1 \end{array}\right] \]
Now, produce three bivariate contour plots of each pair of variates. This is similar to the two plots in Figure 2.8.

Figure 2.8:

image text in transcribed

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: