patel-zeel / pml_baselines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pml_baselines

Compare different baselines for the Baysian Inference problems.

We compare:

  • MCMC- Markov Chain Monte Carlo
  • ajax - Variational Inference using ajax.
  • Laplace Approximation
  • PyStan - Variational Inference using Stan

1. Coin toss Problem

Stan

coin_toss = """
data {
  int<lower=0> n;
  int<lower=0, upper=1> heads[n];
  real alpha0;
  real beta0;
}
parameters {
  real<lower=0, upper=1> theta;
}
model {
  heads ~ bernoulli(theta);
  theta ~ beta(alpha0, beta0);
}
"""

Model

image

Results

Stan Ajax
image VI_ajax_coin_toss
Laplace Approximation RMH in Blackjax
laplace_coin_toss mcmc_coin_toss

2. Linear Regression

3. Logistic Regression

About


Languages

Language:Jupyter Notebook 99.9%Language:Python 0.1%