Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_stat_mills_ratio (g01mb)

## Purpose

nag_stat_mills_ratio (g01mb) returns the reciprocal of Mills' Ratio.

## Syntax

[result] = g01mb(x)
[result] = nag_stat_mills_ratio(x)

## Description

nag_stat_mills_ratio (g01mb) calculates the reciprocal of Mills' Ratio, the hazard rate, λ(x)$\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) = (Z(x))/(Q(x)) = (1/(sqrt(2π))e − (x2 / 2))/(1/(sqrt(2π)) ∫ x∞e − (t2 / 2)dt). $λ(x)=Z(x) Q(x) =12πe-(x2/2) 12π∫x∞e-(t2/2)dt .$
The calculation is based on a Chebyshev expansion as described in nag_specfun_erfcx_real (s15ag).

## References

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

## Parameters

### Compulsory Input Parameters

1:     x – double scalar
x$x$, the argument of the reciprocal of Mills' Ratio.

None.

None.

### Output Parameters

1:     result – double scalar
The result of the function.

None.

## Accuracy

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

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

## Example

```function nag_stat_mills_ratio_example
x = 0;
[result] = nag_stat_mills_ratio(x)
```
```

result =

0.7979

```
```function g01mb_example
x = 0;
[result] = g01mb(x)
```
```

result =

0.7979

```

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013