Thank you for this answer, it is appreciated. I knew there was a factor of 1000 because of the distance between the x-values. You put it very nicely. I knew from elementary statistics at uni that it was the area under the curve. Again you put it very nicely.

Many thanks again,

Anthony of Sydney NSW ]]>

A proleptic calendar uses its rule even for time periods where that rule is historically invalid. So a proleptic Gregorian calendar

uses the Gregorian leap year rule (“4:400:100”) even for periods before 1582. And a proleptic Julian uses the Julian calendar

rules even for years after 1582.

Regards,

Prasanth

For a continuous probability distribution probability is area under curve and not just the sum of the pdf. An approximate way to calculate area is to multiply each value of pdf with the distance between the x values. In the example you give the distance between x values is 0.001 and this will give the correct answer.

Regards,

Prasanth

#For z = +-2, computing the area under the z curve selected_values = y_axis[(x_axis >= -2 ) & (x_axis <= 2)] sum(selected_values) 953.7 #instead of 0.9537

AND

#for z=+- 3 std devs computing the area under the z curve selected_values = y_axis[(x_axis >= -3 ) & (x_axis <= 3)] sum(selected_values) 997 #instead of 0.997

My result is 1000 times the magnitude of the well known approximations for z=+-2 and z=+-3. Similarly my result was 10000 times the mangnitude of the well known approximations for z=+-1.

Sorry and thanks,

Anthony of Sydney

#for z=+-2 std devs selected_values = y_axis[(x_axis >= -2 ) & (x_axis = -3 ) & (x_axis <= 3)] sum(selected_values) 997 #instead of 0.997

I also forgot to say thanks for the previous post.

Thanks

Anthony of Sydney

Import the various packages

import numpy as np from numpy import arange from matplotlib import pyplot from scipy.stats import norm

First I generate the values of x between -3 and 3

x_axis = arange(-3,3,0.001)

Then I generate the gaussian pdf with mean of 0 and stddev of 1 associated with the particular x_axis

y_axis = norm.pdf(x_axis,0,1

I want to find the probability of z between -1 and 1

selected_values = y_axis[(x_axis >= -1 ) & (x_axis <= 1)]

We that the total area of a gaussian distribution with mean = 0 and stdev = 1 between z=-1 and z=1 is approximately 0.682.

But I get the total area to be 682, 1000 times greater than the expected value.

sum(selected_values) 682.68 # instead of 0.682

We know that the area between z=+-2 is 0.95 approx and the area between z=+-3 to be 0.99 approx.

BUT when I compute the respective probabilities, I get 953 and 997

#Computing the area between z=+-2 expect area to be 0.953 selected_values = y_axis[(x_axis >= -2 ) & (x_axis = -3 ) & (x_axis <= 3)] sum(selected_values) 997 #instead of 0.997

Question I get similar numbers to the approximate area under the guassian curve BUT the magnitude of the calculations is out by 1000. i.e. instead of 0.682, 0.953 and 0.997 I get 682, 953 and 997.

]]>NameError: name ‘x’ is not defined

on the last list.

]]>