NAG FL Interface
g01mbf (mills_​ratio)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

g01mbf returns the reciprocal of Mills' Ratio.

2 Specification

Fortran Interface
Function g01mbf ( x)
Real (Kind=nag_wp) :: g01mbf
Real (Kind=nag_wp), Intent (In) :: x
C Header Interface
#include <nag.h>
double  g01mbf_ (const double *x)
The routine may be called by the names g01mbf or nagf_stat_mills_ratio.

3 Description

g01mbf calculates the reciprocal of Mills' Ratio, the hazard rate, λ(x), for the standard Normal distribution. It is defined as the ratio of the ordinate to the upper tail area of the standard Normal distribution, that is,
λ(x)=Z(x) Q(x) =12πe-(x2/2) 12πxe-(t2/2)dt .  
The calculation is based on a Chebyshev expansion as described in s15agf.

4 References

Gross A J and Clark V A (1975) Survival Distributions: Reliability Applications in the Biomedical Sciences Wiley

5 Arguments

1: x Real (Kind=nag_wp) Input
On entry: x, the argument of the reciprocal of Mills' Ratio.

6 Error Indicators and Warnings

None.

7 Accuracy

In the left-hand tail, x<0.0, if 12e-(1/2)x2 the safe range parameter (x02amf), then 0.0 is returned, which is close to the true value.
The relative accuracy is bounded by the effective machine precision. See s15agf for further discussion.

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
g01mbf is not threaded in any implementation.

9 Further Comments

If, before entry, x is not a standard Normal variable, it has to be standardized, and on exit, g01mbf has to be divided by the standard deviation. That is, if the Normal distribution has mean μ and variance σ2, then its hazard rate, λ(x;μ,σ2), is given by
λ(x;μ,σ2)=λ((x-μ)/σ)/σ.  

10 Example

The hazard rate is evaluated at different values of x for Normal distributions with different means and variances. The results are then printed.

10.1 Program Text

Program Text (g01mbfe.f90)

10.2 Program Data

Program Data (g01mbfe.d)

10.3 Program Results

Program Results (g01mbfe.r)