def cumulative_log_smooth(self, x_min, x_max, npoints=200):
"""
This function ...
:param x_min:
:param x_max:
:param npoints:
:return:
"""
x_smooth, y_smooth = self.smooth_values_log(x_min, x_max, npoints)
# Normalize y by calculating the integral
#total = simps(y_smooth, x_smooth)
# NO, by calculating the sum (why?)
total = np.sum(y_smooth)
# Now, y should be normalized within x_min:x_max
y_smooth /= total
# Return the cumulative distribution
return x_smooth, np.cumsum(y_smooth)
# -----------------------------------------------------------------
评论列表
文章目录