Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def make_gauss(N, sigma, mu):
- return (lambda x: N/(sigma * (2*numpy.pi)**.5) *
- numpy.e ** (-(x-mu)**2/(2 * sigma**2)))
- quad(make_gauss(N=10, sigma=2, mu=0), -inf, inf)
- quad(gen_gauss, -inf, inf, (10,2,0))
- def make_gauss(N, sigma, mu):
- k = N / (sigma * math.sqrt(2*math.pi))
- s = -1.0 / (2 * sigma * sigma)
- def f(x):
- return k * math.exp(s * (x - mu)*(x - mu))
- return f
- import scipy.special
- help(scipy.special.erf)
- from scipy.integrate import quad
- from math import pi, exp
- mean = 0
- sd = 1
- quad(lambda x: 1 / ( sd * ( 2 * pi ) ** 0.5 ) * exp( x ** 2 / (-2 * sd ** 2) ), 0, inf )
Add Comment
Please, Sign In to add comment