Skip to content

Instantly share code, notes, and snippets.

@bbbales2
bbbales2 / adjustment.py
Last active April 16, 2017 20:36
Constrain sigma to be [0.0, inf)
import pystan
import numpy
import matplotlib.pyplot as plt
# We gotta only have a few datapoints. Too much data and the mistake isn't visible
y = numpy.random.lognormal(mean = 0.7, sigma = 1.0, size = 5)
# This model does not have the adjustment and so is incorrect
model_code = """
data {
@bbbales2
bbbales2 / lognormal.py
Last active April 16, 2017 16:29
Log normal sampling
import pystan
import numpy
import matplotlib.pyplot as plt
y = numpy.random.lognormal(mean = 0.7, sigma = 1.0, size = 5)
# Both of these models produce the same results
model_code = """
data {
int<lower=1> N;
@bbbales2
bbbales2 / dump.ecoli
Created May 13, 2014 17:10
Dump of chemcell ecoli example
ITEM: TIMESTEP
1000
ITEM: NUMBER OF ATOMS
38
ITEM: BOX BOUNDS
0 2.801
0 1.001
0 1.001
ITEM: ATOMS
892916343 5 0.188849 0.248032 0.763223