Created
April 6, 2020 15:26
-
-
Save jdavidrcamacho/3373f8100ef7b4c0a3b0349db1c57cc9 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import matplotlib.pylab as plt | |
from scipy import stats | |
myclip_a, myclip_b = -2, 2 | |
my_mean, my_std = 0, 0.5 | |
a, b = (myclip_a - my_mean) / my_std, (myclip_b - my_mean) / my_std | |
plt.hist(stats.norm(0,0.5).rvs(10000), bins = 100) | |
plt.hist(stats.truncnorm(a, b, loc = my_mean, scale = my_std).rvs(10000), bins=100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment