TRUNCATED_NORMAL_RULE
Quadrature Rule for Truncated Normal Distribution
TRUNCATED_NORMAL_RULE,
a Python program which
computes a quadrature rule for a normal probability density function (PDF),
sometimes called a Gaussian distribution, that has been
truncated to [A,+oo), (oo,B] or [A,B].
Licensing:
The computer code and data files made available on this
web page are distributed under
the GNU LGPL license.
Languages:
TRUNCATED_NORMAL_RULE is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Data and Programs:
DISK_RULE,
a Python library which
computes quadrature rules
over the interior of the general disk in 2D,
with radius RC and center (XC,YC).
DISK01_RULE,
a Python library which
computes quadrature rules
over the interior of the unit disk in 2D, with center (0,0) and radius 1.
TRUNCATED_NORMAL,
a Python library which
works with the truncated normal distribution over [A,B], or
[A,+oo) or (oo,B], returning the probability density function (PDF),
the cumulative density function (CDF), the inverse CDF, the mean,
the variance, and sample values.
Reference:

Gene Golub, John Welsch,
Calculation of Gaussian Quadrature Rules,
Mathematics of Computation,
Volume 23, Number 106, April 1969, pages 221230.

Norman Johnson, Samuel Kotz, Narayanaswamy Balakrishnan,
Continuous Univariate Distributions,
Second edition,
Wiley, 1994,
ISBN: 0471584940,
LC: QA273.6.J6.
Source Code:

truncated_normal_rule.py,
the main program, which can interact with the user to compute a
quadrature rule for the truncated normal distribution.

i4_uniform_ab.py,
returns a randomly selected integer between A and B.

moment_method.py,
computes a quadrature rule by the method of moments.

normal_01_cdf.py,
evaluates the Normal 01 CDF.

normal_01_moment.py,
evaluates a moment of the Normal 01 distribution.

normal_01_pdf.py,
evaluates the Normal 01 PDF.

normal_MS_moment.py,
evaluates a moment of the Normal MS distribution.

r8_choose.py,
computes the binomial coefficient C(N,K) as an R8.

r8_factorial.py,
computes the factorial of N.

r8_factorial_values.py,
returns selected values of the factorial function.

r8_factorial2.py,
computes the double factorial function.

r8_factorial2_values.py,
returns selected values of the double factorial function.

r8_gamma_log.py,
returns the logarithm of the gamma function.

r8_huge.py,
returns a very large R8.

r8_mop.py,
returns the Ith power of 1 as an R8.

r8mat_print.py,
prints an R8MAT.

r8mat_print_some.py,
prints some of an R8MAT.

r8mat_write.py,
writes an R8MAT file.

r8vec_print.py,
prints an R8VEC.

rule_write.py,
writes a quadrature rule to a file.

timestamp.py,
prints the current YMDHMS date as a time stamp.

truncated_normal_a_moment.py,
moments of the lower truncated Normal PDF.

truncated_normal_ab_moment.py,
moments of the truncated Normal PDF.

truncated_normal_b_moment.py,
moments of the upper truncated Normal PDF.
Examples and Tests:
OPTION0_TEST is a test included within the text of truncated_normal_rule.py
which computes a quadrature rule for the normal distribution,
n = 5, mu = 1.0, sigma = 2.0;
OPTION1_TEST is a test included within the text of truncated_normal_rule.py
which computes a quadrature rule for the lower truncated normal distribution,
n = 9, mu = 2.0, sigma = 0.5, a = 0.0;
OPTION2_TEST is a test included within the text of truncated_normal_rule.py
which computes a quadrature rule for the upper truncated normal distribution,
n = 9, mu = 2.0, sigma = 0.5, b = 3.0;
OPTION3_TEST is a test included within the text of truncated_normal_rule.py
which computes a quadrature rule for the doubly truncated normal distribution,
n = 5, mu = 100.0, sigma = 25.0, a = 50.0, b = 100.0;
You can go up one level to
the Python source codes.
Last revised on 23 March 2015.