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
import config
from azure.keyvault.secrets import SecretClient
from azure.identity import ClientSecretCredential
from azure.core.exceptions import ResourceNotFoundError
import time
class AzureKeyVaultConfiguration(config.Configuration):
Configuration class.
stucchio /
Last active Oct 20, 2019
How to compute the valuation of a cash flow in the presence of a wealth tax.
import numpy as np
from numpy.linalg import solve
def vmat(n, discount_rate, tax_rate):
m = np.zeros(shape=(n,n))
discount = tax_rate*np.exp(-1*discount_rate*np.arange(n))
for i in range(n):
m[i, i:n] = discount[0:n-i]
m[i,i] = 1
return m

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)
You can’t perform that action at this time.