/pymc3

Primary LanguageJupyter Notebook

PyMC & Bayesian Regression


Materials We Provide

Topic Description Link
Lesson PyMC & Bayesian Regression Notebook Link

Dataset description: Skittles bag contents, wage gap data


Learning Objectives

After this lesson, students will be able to:

  1. Recap the purpose of Bayesian methods.
  2. Define conjugacy
  3. Fit models in PyMC.
  4. Interpret traceplots and posterior distributions.

Student Requirements

Before this lesson(s), students should already be able to:

  1. Describe prior distributions, likelihood functions, and posterior distributions.
  2. Fit and interpret linear and logistic regression models.
  3. Interpret confidence intervals.

Lesson Outline

Total Time: 110 minutes

I. Recap and Conjugacy (40 minutes total)

  • Priors, Likelihoods, Posteriors
  • Conjugacy

II. Regression in PyMC (70 minutes total)

  • Selecting Priors
  • Fitting a Model
  • Checking Output
  • Example 1: Skittles
  • Example 2: Election
  • Example 3: Wage Gap Analysis

OPTIONAL: Resources for Practice and Learning

For supplemental reading material on this topic, check out the following resources: