title: Python, calculating the area inder a gaussian by integration
body: <p>I have a function, a gaussian, I have fitted this to my data from a data file. I now need to integrate the gaussian function to give the area under it. </p>
  
  <p>This is my gaussian function</p>
  
  <pre><code>def I(theta,max_x,max_y,sigma):
      return (max_y/(sigma*(math.sqrt(2*pi))))*np.exp(-((theta-max_x)**2)/(2*sigma**2))
  </code></pre>
  
  <p>COMPARING WITH GENERAL FORMULA</p>
  
  <blockquote>
    <p>N(x | mu, sigma, n) := (n/(sigma*sqrt(2*pi))) * exp((-(x-mu)^2)/(2*sigma^2))</p>
  </blockquote>
  
  <p>i.e n = max_y , MU = max_x , x = theta</p>
  
  <p>this is what is given on another page:</p>
  
  <blockquote>
    <p>If Phi(z) = integral(N(x|0,1,1), -inf, z); that is, Phi(z) is the integral of the standard normal distribution from >minus infinity up to z, then it's true by the definition of the error function that
    Phi(z) = 0.5 + 0.5 * erf(z / sqrt(2)).</p>
    
    <p>Likewise, if Phi(z | mu, sigma, n) = integral( N(x|sigma, mu, n),
    -inf, z); that is, Phi(z | mu, sigma, n) is the integral of the normal distribution given parameters mu, sigma, and n from minus infinity up
    to z, then it's true by the definition of the error function that</p>
    
    <p>Phi(z | mu, sigma, n) = (n/2) * (1 + erf((x - mu) / (sigma *
    sqrt(2)))).</p>
  </blockquote>
  
  <p>I am unsure how this helps?? I just want to integrate my function over the plotted values under the curve. Is it saying this is the integral:</p>
  
  <pre><code>Phi(z | mu, sigma, n) = (n/2) * (1 + erf((x - mu) / (sigma * sqrt(2))))
  </code></pre>