Aml Assignment 3 Bayesian Linear Regression PDF
Aml Assignment 3 Bayesian Linear Regression PDF
• Section ??
• Section ??
• Section ??
• Section ??
## Project Overview
EXPECTED TIME 3 HRS This assignment will test your abilities in two different sections: the
Section ?? section will revisit Bayes’ formula and evaluate your ability to calculate simple Bayesian
posterior probabilities. The Section ?? section will ask you to build functions that calculate the
parameters of Bayesian posteriors for Bayesian Linear Regression.
In a separate notebook, there is a brief demonstration of pymc3. The pymc3 module is a stan-
dard for using Markov Chain Monte Carlo to estimate Bayesian derived distributions, in lieu of
calculating exact integrals.
One note on pymc3: it may be tricky to make function on your individual machine
Programming questions will include: - Calculation of Bayesian Posterior - Calculating the
w MAP - Estimating σ2 - Calculating Σ
Motivation: Bayesian regression allows us to quantify the uncertainty in our model building
/ the point estimates of our weights calculated in Least Squares Regression.
Objectives: This assignment will: - Test fundamental Bayesian knowledge, particulary in re-
gard to Linear Regression - Introduce pymc3
Problem: Once again we will be using housing data to predict house price using living area
and year built.
Data: Our data comes from Kaggle’s House Prices Dataset.
1
Imports:
In [1]: ### This cell imports the necessary modules and sets a few plotting parameters for disp
%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (20.0, 10.0)
Say you know the following results of a study about YouTube viewing habits:
Prompt: If you know a user watches YouTube every day, what is the probability that they
are under 35?
We will start with a prior, then update that prior using the likelihood and the normalization
from Bayes’s formula. We define the following notation:
P( B ≤ 35) = 0.25
We are looking to calculate the posterior probability:
P( B ≤ 35| A = 1)