Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:08

0001 // @(#)root/mathmore:$Id$
0002 // Authors: L. Moneta, A. Zsenei   08/2005
0003 
0004 
0005 
0006  /**********************************************************************
0007   *                                                                    *
0008   * Copyright (c) 2004 ROOT Foundation,  CERN/PH-SFT                   *
0009   *                                                                    *
0010   * This library is free software; you can redistribute it and/or      *
0011   * modify it under the terms of the GNU General Public License        *
0012   * as published by the Free Software Foundation; either version 2     *
0013   * of the License, or (at your option) any later version.             *
0014   *                                                                    *
0015   * This library is distributed in the hope that it will be useful,    *
0016   * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
0017   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
0018   * General Public License for more details.                           *
0019   *                                                                    *
0020   * You should have received a copy of the GNU General Public License  *
0021   * along with this library (see file COPYING); if not, write          *
0022   * to the Free Software Foundation, Inc., 59 Temple Place, Suite      *
0023   * 330, Boston, MA 02111-1307 USA, or contact the author.             *
0024   *                                                                    *
0025   **********************************************************************/
0026 
0027 
0028 #ifndef ROOT_Math_QuantFuncMathMore
0029 #define ROOT_Math_QuantFuncMathMore
0030 
0031 
0032 namespace ROOT {
0033 namespace Math {
0034 
0035 
0036 
0037   /** @defgroup QuantFunc Quantile Functions
0038    *  @ingroup StatFunc
0039    *
0040    *  Inverse functions of the cumulative distribution functions
0041    *  and the inverse of the complement of the cumulative distribution functions
0042    *  for various distributions.
0043    *  The functions with the extension <em>_quantile</em> calculate the
0044    *  inverse of the <em>_cdf</em> function, the
0045    *  lower tail integral of the probability density function
0046    *  \f$D^{-1}(z)\f$ where
0047    *
0048    *  \f[ D(x) = \int_{-\infty}^{x} p(x') dx' \f]
0049    *
0050    *  while those with the <em>_quantile_c</em> extension calculate the
0051    *  inverse of the <em>_cdf_c</em> functions, the upper tail integral of the probability
0052    *  density function \f$D^{-1}(z) \f$ where
0053    *
0054    *  \f[ D(x) = \int_{x}^{+\infty} p(x') dx' \f]
0055    *
0056    * The implementation used is that of
0057    * <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Random-Number-Distributions.html">GSL</A>.
0058    *
0059    * <strong>NOTE:</strong> In the old releases (< 5.14) the <em>_quantile</em> functions were called
0060    * <em>_quant_inv</em> and the <em>_quantile_c</em> functions were called
0061    * <em>_prob_inv</em>.
0062    * These names are currently kept for backward compatibility, but
0063    * their usage is deprecated.
0064    */
0065 
0066    /** @name Quantile Functions from MathMore
0067    * The implementation used is that of
0068    * <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Random-Number-Distributions.html">GSL</A>.
0069    */
0070 
0071   //@{
0072 
0073 
0074   /**
0075 
0076   Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution
0077   function of the upper tail of Student's t-distribution
0078   (#tdistribution_cdf_c). For detailed description see
0079   <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html">
0080   Mathworld</A>. The implementation used is that of
0081   <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_19.html#SEC305">GSL</A>.
0082 
0083   @ingroup QuantFunc
0084 
0085   */
0086 
0087   double tdistribution_quantile_c(double z, double r);
0088 
0089 
0090 
0091 
0092   /**
0093 
0094   Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution
0095   function of the lower tail of Student's t-distribution
0096   (#tdistribution_cdf). For detailed description see
0097   <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html">
0098   Mathworld</A>. The implementation used is that of
0099   <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_19.html#SEC305">GSL</A>.
0100 
0101   @ingroup QuantFunc
0102 
0103   */
0104 
0105   double tdistribution_quantile(double z, double r);
0106 
0107 
0108 #ifdef HAVE_OLD_STAT_FUNC
0109 
0110   //@}
0111    /** @name Backward compatible functions */
0112 
0113 
0114    }
0115    inline double chisquared_quant_inv(double x, double r) {
0116       return chisquared_quantile  (x, r );
0117    }
0118 
0119 
0120    inline double gamma_quant_inv(double x, double alpha, double theta) {
0121       return gamma_quantile   (x, alpha, theta );
0122    }
0123 
0124    inline double tdistribution_prob_inv(double x, double r) {
0125       return tdistribution_quantile_c  (x, r );
0126    }
0127 
0128    inline double tdistribution_quant_inv(double x, double r) {
0129       return tdistribution_quantile    (x, r );
0130    }
0131 
0132 #endif
0133 
0134 
0135 } // namespace Math
0136 
0137 namespace MathMore {
0138 
0139 
0140 
0141   /**
0142 
0143   Re-implementation in MathMore of the Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution
0144   function of the lower tail of the \f$\chi^2\f$ distribution
0145   with \f$r\f$ degrees of freedom (ROOT::Math::chisquared_cdf). For detailed description see
0146   <A HREF="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
0147   Mathworld</A>. The implementation used is that of
0148   <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_19.html#SEC303">GSL</A>.
0149 
0150   @ingroup QuantFunc
0151 
0152   */
0153 
0154   double chisquared_quantile(double z, double r);
0155 
0156 
0157 
0158 
0159   /**
0160 
0161   Re-implementation in MathMore of the Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution
0162   function of the lower tail of the gamma distribution
0163   (#ROOT::Math::gamma_cdf). For detailed description see
0164   <A HREF="http://mathworld.wolfram.com/GammaDistribution.html">
0165   Mathworld</A>. The implementation used is that of
0166   <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_19.html#SEC300">GSL</A>.
0167 
0168   @ingroup QuantFunc
0169 
0170   */
0171 
0172   double gamma_quantile(double z, double alpha, double theta);
0173 
0174 
0175 
0176 } // end namespace MathMore
0177 } // namespace ROOT
0178 
0179 
0180 
0181 #endif // ROOT_Math_QuantFuncMathMore