Skip to content

jamesahnjoonchul/Solutions-to-A-Students-Guide-to-Bayesian-Statistics-by-Ben-Lambert

 
 

Repository files navigation

Solutions-to-Problems-in-Bayesian-Statistics

This repository contains my solutions to the assignments in the book: "A Student’s Guide to Bayesian Statistics" by Ben Lambert. I will update the repository with my solutions continuously.

Each chapter of the book has its corresponding folder in this repository. These solutions consist of Python code as well as pdfs.

Let me know (by posting an issue or via email: hotti@kth.se) if you have any questions or would like to discuss a certain solution or assignment!

Content

An introduction to Bayesian inference

Chapter 2 - The subjective worlds of Frequentist and Bayesian statistics

The code for this section can be found: HERE The report can be found: HERE

Chapter 3 - Probability - the nuts and bolts of Bayesian inference

The code for this section can be found: HERE The report can be found: HERE

Understanding the Bayesian formula

Chapter 4 - Likelihoods

The report can be found: HERE

Excerpt of some results

Chapter 5 - Priors

The report can be found: HERE

Chapter 6 - The devil is in the denominator

The report can be found: HERE

Excerpt of some results

Chapter 7 - The posterior - The goal of Bayesian inference

Analytic Bayesian methods

Chapter 8 - Distributions

Excerpt of some results

Chapter 9 - Conjugate priors

Excerpt of some results

Chapter 10 - Evaluation of model fit and hypothesis testing

Chapter 11 - Making Bayesian analysis objective?

Computational Bayes

Chapter 12 - Leaving conjugates behind: Markov chain Monte Carlo

Chapter 13 - Metropolis Hastings

The report can be found: HERE

Modeling presence of Borrelia amongst Ticks
Symmetric Kernel - Random Walk Metropolis

Using a Binomial likelihood, a Beta prior and an symmetric Normal jumping kernel.

Assymmetric Kernel - Metropolis Hastings

Using a Beta-Binomial likelihood, a Gamma prior and an assymmetric log-Normal jumping kernel.

Modeling Mosquito Death Rate

Using a Poisson Likelihood, a Gamma prior, a Beta Prior, a log-Normal jumping kernel and a beta jumping kernel.

Chapter 14 - Gibbs Sampling

The report can be found: HERE

The sensitivity and specificity of a test for a disease - Gibbs Sampling

Coal mining disasters in the UK - Gibbs Sampling

Using Gibbs sampling to estimate the point in time when legislative and societal changes caused a reduction in coal mining disasters in the UK. The number of disasters per year pre and post legislations were modeled using Poisson Likelihoods: Possion(lambda_1), Possion(lambda_2) with Gamma priors. The point in time when the new legislations were enacted is called n.

Chapter 15 - Hamiltonian Monte Carlo

Chapter 16 - Stan

Hierarchical models and regression

Chapter 17 - Hierarchical models

Chapter 18 - Linear regression models

Chapter 19 - Generalized linear models and other animals

About

My solutions to the assignments in the book: "A Student’s Guide to Bayesian Statistics" by Ben Lambert.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.4%
  • R 8.6%