Added MACS source
[htsworkflow.git] / htswanalysis / MACS / lib / gsl / gsl-1.11 / doc / specfunc-erf.texi
1 @cindex error function
2 @cindex erf(x)
3 @cindex erfc(x)
4
5 The error function is described in Abramowitz & Stegun, Chapter 7.  The
6 functions in this section are declared in the header file
7 @file{gsl_sf_erf.h}.
8
9 @menu
10 * Error Function::              
11 * Complementary Error Function::  
12 * Log Complementary Error Function::  
13 * Probability functions::       
14 @end menu
15
16 @node Error Function
17 @subsection Error Function
18
19 @deftypefun double gsl_sf_erf (double @var{x})
20 @deftypefunx int gsl_sf_erf_e (double @var{x}, gsl_sf_result * @var{result})
21 These routines compute the error function @c{$\erf(x)$}
22 @math{erf(x)}, where
23 @c{$\erf(x) = (2/\sqrt{\pi}) \int_0^x dt \exp(-t^2)$}
24 @math{erf(x) = (2/\sqrt(\pi)) \int_0^x dt \exp(-t^2)}.
25 @comment Exceptional Return Values: none
26 @end deftypefun
27
28 @node Complementary Error Function
29 @subsection Complementary Error Function
30
31 @deftypefun double gsl_sf_erfc (double @var{x})
32 @deftypefunx int gsl_sf_erfc_e (double @var{x}, gsl_sf_result * @var{result})
33 These routines compute the complementary error function 
34 @c{$\erfc(x) = 1 - \erf(x) = (2/\sqrt{\pi}) \int_x^\infty \exp(-t^2)$}
35 @math{erfc(x) = 1 - erf(x) = (2/\sqrt(\pi)) \int_x^\infty \exp(-t^2)}.
36 @comment Exceptional Return Values: none
37 @end deftypefun
38
39
40 @node Log Complementary Error Function
41 @subsection Log Complementary Error Function
42
43 @deftypefun double gsl_sf_log_erfc (double @var{x})
44 @deftypefunx int gsl_sf_log_erfc_e (double @var{x}, gsl_sf_result * @var{result})
45 These routines compute the logarithm of the complementary error function
46 @math{\log(\erfc(x))}.
47 @comment Exceptional Return Values: none
48 @end deftypefun
49
50
51 @node Probability functions
52 @subsection Probability functions
53
54 The probability functions for the Normal or Gaussian distribution are
55 described in Abramowitz & Stegun, Section 26.2.
56
57 @deftypefun double gsl_sf_erf_Z (double @var{x})
58 @deftypefunx int gsl_sf_erf_Z_e (double @var{x}, gsl_sf_result * @var{result})
59 These routines compute the Gaussian probability density function 
60 @c{$Z(x) = (1/\sqrt{2\pi}) \exp(-x^2/2)$} 
61 @math{Z(x) = (1/\sqrt@{2\pi@}) \exp(-x^2/2)}.  
62 @end deftypefun
63
64 @deftypefun double gsl_sf_erf_Q (double @var{x})
65 @deftypefunx int gsl_sf_erf_Q_e (double @var{x}, gsl_sf_result * @var{result})
66 These routines compute the upper tail of the Gaussian probability
67 function 
68 @c{$Q(x) = (1/\sqrt{2\pi}) \int_x^\infty dt \exp(-t^2/2)$}
69 @math{Q(x) = (1/\sqrt@{2\pi@}) \int_x^\infty dt \exp(-t^2/2)}.
70 @comment Exceptional Return Values: none
71 @end deftypefun
72
73 @cindex hazard function, normal distribution
74 @cindex Mill's ratio, inverse
75 The @dfn{hazard function} for the normal distribution, 
76 also known as the inverse Mill's ratio, is defined as,
77 @tex
78 \beforedisplay
79 $$
80 h(x) = {Z(x)\over Q(x)} = \sqrt{2 \over \pi} {\exp(-x^2 / 2) \over \erfc(x/\sqrt 2)}
81 $$
82 \afterdisplay
83 @end tex
84 @ifinfo
85
86 @example
87 h(x) = Z(x)/Q(x) = \sqrt@{2/\pi@} \exp(-x^2 / 2) / \erfc(x/\sqrt 2)
88 @end example
89
90 @end ifinfo
91 @noindent
92 It decreases rapidly as @math{x} approaches @math{-\infty} and asymptotes
93 to @math{h(x) \sim x} as @math{x} approaches @math{+\infty}.
94
95 @deftypefun double gsl_sf_hazard (double @var{x})
96 @deftypefunx int gsl_sf_hazard_e (double @var{x}, gsl_sf_result * @var{result})
97 These routines compute the hazard function for the normal distribution.
98 @comment Exceptional Return Values: GSL_EUNDRFLW
99 @end deftypefun