ROOT  6.06/04
Reference Guide
QuantFuncMathMore.h
Go to the documentation of this file.
1 // @(#)root/mathmore:$Id$
2 // Authors: L. Moneta, A. Zsenei 08/2005
3 
4 
5 
6  /**********************************************************************
7  * *
8  * Copyright (c) 2004 ROOT Foundation, CERN/PH-SFT *
9  * *
10  * This library is free software; you can redistribute it and/or *
11  * modify it under the terms of the GNU General Public License *
12  * as published by the Free Software Foundation; either version 2 *
13  * of the License, or (at your option) any later version. *
14  * *
15  * This library is distributed in the hope that it will be useful, *
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18  * General Public License for more details. *
19  * *
20  * You should have received a copy of the GNU General Public License *
21  * along with this library (see file COPYING); if not, write *
22  * to the Free Software Foundation, Inc., 59 Temple Place, Suite *
23  * 330, Boston, MA 02111-1307 USA, or contact the author. *
24  * *
25  **********************************************************************/
26 
27 
28 #if defined(__CINT__) && !defined(__MAKECINT__)
29 // avoid to include header file when using CINT
30 #ifndef _WIN32
31 #include "../lib/libMathMore.so"
32 #else
33 #include "../bin/libMathMore.dll"
34 #endif
35 
36 #else
37 
38 
39 #ifndef ROOT_Math_QuantFuncMathMore
40 #define ROOT_Math_QuantFuncMathMore
41 
42 
43 namespace ROOT {
44 namespace Math {
45 
46 
47 
48  /** @defgroup QuantFunc Quantile Functions
49  * @ingroup StatFunc
50  *
51  * Inverse functions of the cumulative distribution functions
52  * and the inverse of the complement of the cumulative distribution functions
53  * for various distributions.
54  * The functions with the extension <em>_quantile</em> calculate the
55  * inverse of the <em>_cdf</em> function, the
56  * lower tail integral of the probability density function
57  * \f$D^{-1}(z)\f$ where
58  *
59  * \f[ D(x) = \int_{-\infty}^{x} p(x') dx' \f]
60  *
61  * while those with the <em>_quantile_c</em> extension calculate the
62  * inverse of the <em>_cdf_c</em> functions, the upper tail integral of the probability
63  * density function \f$D^{-1}(z) \f$ where
64  *
65  * \f[ D(x) = \int_{x}^{+\infty} p(x') dx' \f]
66  *
67  * The implementation used is that of
68  * <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Random-Number-Distributions.html">GSL</A>.
69  *
70  * <strong>NOTE:</strong> In the old releases (< 5.14) the <em>_quantile</em> functions were called
71  * <em>_quant_inv</em> and the <em>_quantile_c</em> functions were called
72  * <em>_prob_inv</em>.
73  * These names are currently kept for backward compatibility, but
74  * their usage is deprecated.
75  */
76 
77  /** @name Quantile Functions from MathMore
78  * The implementation used is that of
79  * <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Random-Number-Distributions.html">GSL</A>.
80  */
81 
82  //@{
83 
84 
85  /**
86 
87  Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution
88  function of the upper tail of Student's t-distribution
89  (#tdistribution_cdf_c). For detailed description see
90  <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html">
91  Mathworld</A>. The implementation used is that of
92  <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_19.html#SEC305">GSL</A>.
93 
94  @ingroup QuantFunc
95 
96  */
97 
98  double tdistribution_quantile_c(double z, double r);
99 
100 
101 
102 
103  /**
104 
105  Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution
106  function of the lower tail of Student's t-distribution
107  (#tdistribution_cdf). For detailed description see
108  <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html">
109  Mathworld</A>. The implementation used is that of
110  <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_19.html#SEC305">GSL</A>.
111 
112  @ingroup QuantFunc
113 
114  */
115 
116  double tdistribution_quantile(double z, double r);
117 
118 
119 #ifdef HAVE_OLD_STAT_FUNC
120 
121  //@}
122  /** @name Backward compatible functions */
123 
124 
125  }
126  inline double chisquared_quant_inv(double x, double r) {
127  return chisquared_quantile (x, r );
128  }
129 
130 
131  inline double gamma_quant_inv(double x, double alpha, double theta) {
132  return gamma_quantile (x, alpha, theta );
133  }
134 
135  inline double tdistribution_prob_inv(double x, double r) {
136  return tdistribution_quantile_c (x, r );
137  }
138 
139  inline double tdistribution_quant_inv(double x, double r) {
140  return tdistribution_quantile (x, r );
141  }
142 
143 #endif
144 
145 
146 } // namespace Math
147 
148 namespace MathMore {
149 
150 
151 
152  /**
153 
154  Re-implementation in MathMore of the Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution
155  function of the lower tail of the \f$\chi^2\f$ distribution
156  with \f$r\f$ degrees of freedom (#chisquared_cdf). For detailed description see
157  <A HREF="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
158  Mathworld</A>. The implementation used is that of
159  <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_19.html#SEC303">GSL</A>.
160 
161  @ingroup QuantFunc
162 
163  */
164 
165  double chisquared_quantile(double z, double r);
166 
167 
168 
169 
170  /**
171 
172  Re-implementation in MathMore of the Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution
173  function of the lower tail of the gamma distribution
174  (#gamma_cdf). For detailed description see
175  <A HREF="http://mathworld.wolfram.com/GammaDistribution.html">
176  Mathworld</A>. The implementation used is that of
177  <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_19.html#SEC300">GSL</A>.
178 
179  @ingroup QuantFunc
180 
181  */
182 
183  double gamma_quantile(double z, double alpha, double theta);
184 
185 
186 
187 } // end namespace MathMore
188 } // namespace ROOT
189 
190 
191 
192 #endif // ROOT_Math_QuantFuncMathMore
193 
194 #endif // if defined (__CINT__) && !defined(__MAKECINT__)
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
Double_t x[n]
Definition: legend1.C:17
ROOT::R::TRInterface & r
Definition: Object.C:4
double tdistribution_quantile(double z, double r)
Inverse ( ) of the cumulative distribution function of the lower tail of Student&#39;s t-distribution (td...
Namespace for new Math classes and functions.
double gamma_quantile(double z, double alpha, double theta)
Inverse ( ) of the cumulative distribution function of the lower tail of the gamma distribution (gamm...
double chisquared_quantile(double z, double r)
Inverse ( ) of the cumulative distribution function of the lower tail of the distribution with degr...
double tdistribution_quantile_c(double z, double r)
Inverse ( ) of the cumulative distribution function of the upper tail of Student&#39;s t-distribution (td...