g01 Chapter Contents
g01 Chapter Introduction
NAG C Library Manual

# NAG Library Function Documentnag_mills_ratio (g01mbc)

## 1  Purpose

nag_mills_ratio (g01mbc) returns the reciprocal of Mills' Ratio.

## 2  Specification

 #include #include
 double nag_mills_ratio (double x)

## 3  Description

nag_mills_ratio (g01mbc) calculates the reciprocal of Mills' Ratio, the hazard rate, $\lambda \left(x\right)$, 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=Zx Qx =12πe-x2/2 12π∫x∞e-t2/2dt .$
The calculation is based on a Chebyshev expansion as described in nag_erfcx (s15agc).

## 4  References

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

## 5  Arguments

1:     xdoubleInput
On entry: $x$, the argument of the reciprocal of Mills' Ratio.

None.

## 7  Accuracy

In the left-hand tail, $x<0.0$, if $\frac{1}{2}{e}^{-\left(1/2\right){x}^{2}}\le \text{}$ the safe range argument (nag_real_safe_small_number (X02AMC)), then $0.0$ is returned, which is close to the true value.
The relative accuracy is bounded by the effective machine precision. See nag_erfcx (s15agc) for further discussion.

If, before entry, $x$ is not a standard Normal variable, it has to be standardized, and on exit, nag_mills_ratio (g01mbc) has to be divided by the standard deviation. That is, if the Normal distribution has mean $\mu$ and variance ${\sigma }^{2}$, then its hazard rate, $\lambda \left(x;\mu ,{\sigma }^{2}\right)$, is given by
 $λx;μ,σ2=λx-μ/σ/σ.$

## 9  Example

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

### 9.1  Program Text

Program Text (g01mbce.c)

### 9.2  Program Data

Program Data (g01mbce.d)

### 9.3  Program Results

Program Results (g01mbce.r)