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
View keybase.md

Keybase proof

I hereby claim:

  • I am stucchio on github.
  • I am stucchio (https://keybase.io/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
View delayed_reaction.py
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)
View hiv_vs_guns.py
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
stucchio / compass.py
Created Jan 8, 2016
Bayesian compass calibration script
View compass.py
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()
View quasimontecarlo.py
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
stucchio / Dockerfile
Created Nov 4, 2014
dockerfile for nginx reverse proxy
View Dockerfile
FROM ubuntu:14.04
MAINTAINER Chris Stucchio <stucchio@gmail.com>
# Nginx
RUN apt-get update && apt-get install -y nginx nginx-extras && mkdir /var/www
ADD nginx.conf /etc/nginx/nginx.conf
ADD run_nginx.sh /bin/run_nginx.sh
RUN chmod +x /bin/run_nginx.sh
View Storage.jl
module Storage
DB_HOST = ENV["POSTGRES_PORT_5432_TCP_ADDR"]
DB_PORT = ENV["POSTGRES_PORT_5432_TCP_PORT"]
DB_NAME = ENV["POSTGRES_DBNAME"]
DB_USER = ENV["POSTGRES_PGUSER"]
DB_PASS = ENV["POSTGRES_PGPASS"]
conn = connect(Postgres, DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT)
@stucchio
stucchio / Dockerfile
Created Oct 28, 2014
Dockerfile for julia web stack
View Dockerfile
FROM stucchio/juliabase:0.3.2
MAINTAINER Chris Stucchio <stucchio@gmail.com>
# Julia libs we want
ADD REQUIRE /.julia/v0.3/REQUIRE
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
stucchio / Dockerfile
Created Oct 28, 2014
Dockerfile for Julia
View Dockerfile
FROM ubuntu:14.04
MAINTAINER Chris Stucchio <stucchio@gmail.com>
# 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.