Created
June 28, 2023 00:11
-
-
Save ryxcommar/a63d7d3834d1650ac01fe4624675206c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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