开始使用免费开始使用

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.

本练习是课程的一部分

Multivariate Probability Distributions in R

查看课程

练习说明

  • 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.

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Generate 100 bivariate normal samples
multnorm.sample <- ___

# View the first 6 samples
___

# Scatterplot of the bivariate samples 
plot(___)
编辑并运行代码