Created
October 16, 2022 18:03
-
-
Save galenseilis/4e73306fe17075eabf05c6b7dc4ff06f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 matplotlib.pyplot as plt | |
| import numpy as np | |
| from scipy import stats | |
| z1 = np.random.chisquare(10, 10**4) | |
| z2 = np.random.chisquare(10, 10**4) | |
| c = 10 | |
| y = (z1 + c) / (z1 - z2) | |
| sort_y = np.sort(y) | |
| density = stats.gaussian_kde(sort_y) | |
| plt.hist(y, bins=100) | |
| plt.yscale('log') | |
| plt.plot(sort_y, density(sort_y)) | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment