R7. Introduction to Hamiltonian Monte Carlo

This recitation was prepared by Tom Röschinger.


[1]:
# Colab setup ------------------
import os, sys, subprocess
if "google.colab" in sys.modules:
    cmd = "pip install --upgrade chromatose watermark"
    process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout, stderr = process.communicate()
    data_path = "https://s3.amazonaws.com/bebi103.caltech.edu/data/"
else:
    data_path = "../data/"
# ------------------------------

import numpy as np
from scipy.special import binom
from scipy.special import factorial

import scipy.stats as st

import bokeh.plotting
from bokeh.io import curdoc,output_notebook,show
import bokeh.palettes
from bokeh.layouts import row,layout
from bokeh.models.tickers import FixedTicker

import holoviews as hv
renderer = hv.renderer('bokeh')

# Use Rosita's color map package; install with pip install chromatose
import chromatose as ct

pallete1 = ct.addams
pallete2 = ct.palpolate(bokeh.palettes.BuPu[9], 256)

hv.extension('bokeh')
output_notebook()