Last active
May 25, 2020 23:08
-
-
Save Olshansk/8377249322503c131788c57940822b24 to your computer and use it in GitHub Desktop.
Joint Probability Matrices - Data Generation
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
# Data Generation | |
NUM_STUDENTS = 30 | |
MEAN = 80 | |
STD = 20 | |
# https://stackoverflow.com/questions/36894191/how-to-get-a-normal-distribution-within-a-range-in-numpy | |
# Need to cap the values of the distributions to [0,100] | |
def get_truncated_normal(mean, sd, size, low, upp): | |
return truncnorm((low - mean) / sd, (upp - mean) / sd, loc=mean, scale=sd).rvs(size) | |
grades_GT = get_truncated_normal(MEAN, STD, NUM_STUDENTS, 0, 100) | |
grades_P = get_truncated_normal(MEAN, STD, NUM_STUDENTS, 0, 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment