Skip to content

Instantly share code, notes, and snippets.

@rationalism
Created May 16, 2022 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rationalism/b8925017700605b339b8f8439283d670 to your computer and use it in GitHub Desktop.
Save rationalism/b8925017700605b339b8f8439283d670 to your computer and use it in GitHub Desktop.
def simulate_model_runs():
rng = np.random.RandomState(42)
for i in range(0, 300):
j = i / 100
scalabilities = rng.normal(loc=1.0, scale=j, size=60)
a = rng.normal(size=60)
b = rng.normal(size=60) + scalabilities
c = rng.normal(size=60) + scalabilities * 2
slope, intercept, r_value, p_value, std_err = scipy.stats.linregress(b - a, c - b)
print('{},{}'.format(j, r_value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment