Skip to content

Instantly share code, notes, and snippets.

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 ryxcommar/a63d7d3834d1650ac01fe4624675206c to your computer and use it in GitHub Desktop.
Save ryxcommar/a63d7d3834d1650ac01fe4624675206c to your computer and use it in GitHub Desktop.
import numpy as np
np.set_printoptions(suppress=True)
stdevs = [i / 2 for i in range(1, 24 + 1)]
TRIALS = 1_000
WOMEN = 500_000
trial_results = {k: list() for k in stdevs}
np.random.seed(69420)
for t in range(TRIALS):
true_attractiveness_norm = np.random.normal(0, 1, size=WOMEN)
for std in stdevs:
true_attractiveness = (true_attractiveness_norm * std) + 5
bound_attractiveness = np.maximum(np.minimum(np.round(true_attractiveness, 0), 10), 0)
mse = np.mean(((true_attractiveness - bound_attractiveness) / std) ** 2)
trial_results[std].append(mse)
for std, mse_list in trial_results.items():
print(f"{std=} --> {np.mean(mse_list)}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment