Last active
January 11, 2022 12:45
-
-
Save john-adeojo/da6e63e83f0de636bc83368dae4a943d 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
from scipy.stats import ks_2samp | |
# Run a montecarlo simulation over 1,000 turns to get distribution of KS scores for each | |
def KS_MonteCarlo(euro_league, n_teams, n_seasons): | |
simulation = np.arange(1,1001,1) | |
ks_run =[] | |
for run in simulation: | |
flat20 = perfect_competition(n_teams, n_seasons).T.to_numpy().flatten() | |
ks_run.append(ks_2samp(euro_league.Pts, flat20).statistic) | |
return pd.DataFrame(ks_run) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment