Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import random
- import numpy as np
- N = 100000
- # alpha = .009 # This leads to a mean of about .05
- alpha = .1 # This leads to a mean of about .33
- a = np.zeros(N)
- for i in range(N):
- p1 = random() # Get one p-value
- p2 = random() # Get another p-value
- p3 = p1 * p2 # Get the multiplied p-value
- if p3 < alpha: # Determine if the multiplied p-value is below alpa
- a[i] = 1
- print a.mean()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement