TRUNCATED_NORMAL_RULE
Quadrature Rule for Truncated Normal Distribution


TRUNCATED_NORMAL_RULE, a FORTRAN77 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 FORTRAN77 version and a FORTRAN90 version and a MATLAB version and a Python version.

Related Data and Programs:

CLENSHAW_CURTIS_RULE, a FORTRAN77 program which defines a Clenshaw Curtis quadrature rule.

LAGUERRE_RULE, a FORTRAN77 program which can compute and print a Gauss-Laguerre quadrature rule for estimating the integral of a function with density exp(-x) over the interval [0,+oo).

PATTERSON_RULE, a FORTRAN77 program which returns the points and weights of a 1D Gauss-Patterson quadrature rule of order 1, 3, 7, 15, 31, 63, 127, 255 or 511.

QUADRULE, a FORTRAN77 library which defines 1-dimensional quadrature rules.

TRUNCATED_NORMAL, a FORTRAN77 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:

  1. Gene Golub, John Welsch,
    Calculation of Gaussian Quadrature Rules,
    Mathematics of Computation,
    Volume 23, Number 106, April 1969, pages 221-230.
  2. Norman Johnson, Samuel Kotz, Narayanaswamy Balakrishnan,
    Continuous Univariate Distributions,
    Second edition,
    Wiley, 1994,
    ISBN: 0471584940,
    LC: QA273.6.J6.
  3. Source Code:

    Examples and Tests:

    "OPTION0" computes a quadrature rule for the normal distribution, n = 5, mu = 1.0, sigma = 2.0;

    "OPTION1" computes a quadrature rule for the lower truncated normal distribution, n = 9, mu = 2.0, sigma = 0.5, a = 0.0;

    "OPTION2" computes a quadrature rule for the upper truncated normal distribution, n = 9, mu = 2.0, sigma = 0.5, b = 3.0;

    "OPTION3" computes a quadrature rule for the doubly truncated normal distribution, n = 5, mu = 100.0, sigma = 25.0, a = 50.0, b = 100.0;

    List of Routines:

    You can go up one level to the FORTRAN77 source codes.


    Last revised on 20 September 2013.