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:
pricehas a mean of 20 andsizehas a mean of 500pricehas a variance of 19 andsizehas a variance of 50,000- The covariance for
priceandsizeis 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.
Cet exercice fait partie du cours
Monte Carlo Simulations in Python
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Assign the mean of price and size, sample size, and covariance matrix of price and size
mean_value = ____
cov_mat = np.array(____)
sample_size = ____