Last active
May 12, 2019 18:31
-
-
Save ychennay/84c60cda78c5d3c32f9f51b9bb51c614 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
true_median = np.median(X["Impressions"]) | |
errors = [] | |
variances = [] | |
for b in range(1, 500): | |
sample_medians = [np.median(X.sample(len(X), replace=True)["Impressions"]) for i in range(b)] | |
error = np.mean(sample_medians) - true_median | |
variances.append(np.std(sample_medians) ** 2) # record the variance of the bootstrap estimates | |
errors.append(error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment