truncated normal distribution with scipy in python truncated normal distribution with scipy in python python-3.x python-3.x

truncated normal distribution with scipy in python


Here's the procedure to follow according to the documentation of truncnorm.

# user inputmyclip_a = 0myclip_b = 1my_mean = 0.5my_std = 0.3a, b = (myclip_a - my_mean) / my_std, (myclip_b - my_mean) / my_stdx_range = np.linspace(-1,2,1000)plt.plot(x_range, truncnorm.pdf(x_range, a, b, loc = my_mean, scale = my_std))

enter image description here