Skip to content

Instantly share code, notes, and snippets.

View seekshreyas's full-sized avatar
🐼
\_(*|*)_/

Shreyas seekshreyas

🐼
\_(*|*)_/
  • DocuSign
  • San Francisco, CA
  • 19:50 (UTC -08:00)
View GitHub Profile
@seekshreyas
seekshreyas / retroDesign.py
Created June 22, 2020 05:26 — forked from chums2020/retroDesign.py
Translates Gelman's retrodesign function from R to Python
from scipy.stats import t
def retroDesign(A, s, alpha=0.05, df=1000000, n_sims=10000):
"""
:param A: the hypothesized true effect size
:param s: standard error
:param alpha: confidence level
:param df: degree of freedom
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)