hide long namesshow long names
hide short namesshow short names
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)λ(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)) = (1/(sqrt(2π))e(x2 / 2))/(1/(sqrt(2π))xe(t2 / 2)dt).
λ(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 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
xx, the argument of the reciprocal of Mills' Ratio.

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

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

Error Indicators and Warnings

None.

Accuracy

In the left-hand tail, x < 0.0x<0.0, if (1/2)e(1 / 2)x212e-(1/2)x2 the safe range parameter (nag_machine_real_safe (x02am)), then 0.00.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.

Further Comments

If, before entry, xx 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 μμ and variance σ2σ2, then its hazard rate, λ(x ; μ,σ2)λ(x;μ,σ2), 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