Exercise

Multivariate normal sampling

In this exercise, you'll continue working with the house_price_size DataFrame, which has been loaded for you. As a reminder, house_price_size contains two columns called price and size representing the price and size of houses in that order.

Having explored the house_price_size DataFrame, you suspect that this is a multivariate normal distribution because price and size each seem to follow a normal distribution. Based on the covariance matrix that you calculated in the previous exercise, you can now perform multivariate normal distribution sampling with a defined covariance structure!

To perform multivariate normal distribution sampling with defined covariance, you'll need the following information:

  • price has a mean of 20 and size has a mean of 500
  • price has a variance of 19 and size has a variance of 50,000
  • The covariance for price and size is 950
  • You'll sample 5,000 times

The following imports have been completed for you: seaborn as sns, pandas as pd, numpy as np, matplotlib.pyplot as plt, and scipy.stats as st.

Instructions 1/2

undefined XP
    1
    2
  • Set up the parameters for multivariate normal sampling based on the stated means, variances, covariance, and sample size.