Skip to content

Instantly share code, notes, and snippets.

Stucchio stucchio

Block or report user

Report or block stucchio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am stucchio on github.
  • I am stucchio ( on keybase.
  • I have a public key ASA_kgAJceWD7PGBJvFyqObwCMqZDv2hcDqFPpdi8DrJvgo

To claim this, I am signing this object:

View cutoff_fake_bias
from scipy.stats import norm
from numpy import mean
x = norm(0,1).rvs(10000)
y = norm(1,1).rvs(10000) # Group Y is 1 standard deviation better than group X
print("Mean of group X, exceeding the cutoff: " + str(mean(x[x > 3]))) # Prints 3.22
print("Mean of group Y, exceeding the cutoff: " + str(mean(y[y > 3]))) # prints 3.40
from pylab import *
from scipy.stats import uniform, binom, expon, beta
true_gamma = 0.5
N = 600
T = 15
data = zeros((2, N), dtype=float)
event_times = data[0,:]
event_times[:] = uniform(0,15).rvs(N)
from pylab import *
hiv_infections = 29418
gun_homicides = 11078
gun_suicides = 19392
gun_deaths = gun_homicides + gun_suicides
hiv_qualys = array([22.9, 31.9])
hiv_qualys_discounted = array([9.34, 13.18])
stucchio /
Created Jan 8, 2016
Bayesian compass calibration script
from pylab import *
from scipy.stats import norm, uniform
theta_grid = arange(0,2*pi,1.0/1024.0)
true_b = pi/2
b_belief = ones(shape=theta_grid.shape, dtype=float)
b_belief /= b_belief.sum()
import ghalton
from pylab import *
from scipy.stats import gamma
def qmc_gamma(alpha, N):
M = len(alpha)
sequencer = ghalton.Halton(2*M)
valid = ones(shape=(N,), dtype=bool)
hs = array(sequencer.get(N)).transpose()
stucchio / Dockerfile
Created Nov 4, 2014
dockerfile for nginx reverse proxy
View Dockerfile
FROM ubuntu:14.04
MAINTAINER Chris Stucchio <>
# Nginx
RUN apt-get update && apt-get install -y nginx nginx-extras && mkdir /var/www
ADD nginx.conf /etc/nginx/nginx.conf
ADD /bin/
RUN chmod +x /bin/
View Storage.jl
module Storage
conn = connect(Postgres, DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT)
stucchio / Dockerfile
Created Oct 28, 2014
Dockerfile for julia web stack
View Dockerfile
FROM stucchio/juliabase:0.3.2
MAINTAINER Chris Stucchio <>
# Julia libs we want
RUN julia -e "Pkg.resolve()"
# C Libraries we need
RUN apt-get install -y unixodbc unixodbc-dev libsqliteodbc odbc-postgresql libhttp-parser-dev libicu-dev # Utility libs
stucchio / Dockerfile
Created Oct 28, 2014
Dockerfile for Julia
View Dockerfile
FROM ubuntu:14.04
MAINTAINER Chris Stucchio <>
# Necessary to add a ppa
RUN apt-get update && apt-get install -y python-software-properties software-properties-common
# Julia repository
RUN add-apt-repository ppa:staticfloat/juliareleases && apt-get update
# Yay julia
You can’t perform that action at this time.