Skip to content

Instantly share code, notes, and snippets.

View jfrelinger's full-sized avatar

Jacob Frelinger jfrelinger

View GitHub Profile
@jfrelinger
jfrelinger / invwishart.py
Created May 8, 2012 18:55
wishart and inverse wishart sampler
import numpy as np
import numpy.random as npr
from numpy.linalg import inv, cholesky
from scipy.stats import chi2
def invwishartrand_prec(nu,phi):
return inv(wishartrand(nu,phi))
def invwishartrand(nu, phi):
return inv(wishartrand(nu, inv(phi)))
@jfrelinger
jfrelinger / interpreting_table.py
Created April 4, 2012 15:16
an linear interpolating look-up table in python.
import bisect
class InterpTable(object):
'''
a look up table that linearly interperlates between values
'''
def __init__(self, x, y):
self.x = x
self.y = y