VavilovAccurateQuantile.h

Go to the documentation of this file.
00001 // @(#)root/mathmore:$Id: VavilovAccurateQuantile.h 34195 2010-06-30 04:33:36Z brun $
00002 // Authors: B. List 29.4.2010
00003 
00004  /**********************************************************************
00005   *                                                                    *
00006   * Copyright (c) 2004 ROOT Foundation,  CERN/PH-SFT                   *
00007   *                                                                    *
00008   * This library is free software; you can redistribute it and/or      *
00009   * modify it under the terms of the GNU General Public License        *
00010   * as published by the Free Software Foundation; either version 2     *
00011   * of the License, or (at your option) any later version.             *
00012   *                                                                    *
00013   * This library is distributed in the hope that it will be useful,    *
00014   * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
00015   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
00016   * General Public License for more details.                           *
00017   *                                                                    *
00018   * You should have received a copy of the GNU General Public License  *
00019   * along with this library (see file COPYING); if not, write          *
00020   * to the Free Software Foundation, Inc., 59 Temple Place, Suite      *
00021   * 330, Boston, MA 02111-1307 USA, or contact the author.             *
00022   *                                                                    *
00023   **********************************************************************/
00024 
00025 // Header file for class VavilovAccurateQuantile
00026 // 
00027 // Created by: blist  at Thu Apr 29 11:19:00 2010
00028 // 
00029 // Last update: Thu Apr 29 11:19:00 2010
00030 // 
00031 #ifndef ROOT_Math_VavilovAccurateQuantile
00032 #define ROOT_Math_VavilovAccurateQuantile
00033 
00034 
00035 #include "Math/IParamFunction.h"
00036 #include "Math/VavilovAccurate.h"
00037 
00038 #include <memory>
00039 
00040 namespace ROOT {
00041 namespace Math {
00042 
00043 //____________________________________________________________________________
00044 /**
00045    Class describing the Vavilov quantile function.
00046    
00047    The probability density function of the Vavilov distribution
00048    is given by:
00049   \f[ p(\lambda; \kappa, \beta^2) =  
00050   \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} \phi(s) e^{\lambda s} ds\f]
00051    where \f$\phi(s) = e^{C} e^{\psi(s)}\f$
00052    with  \f$ C = \kappa (1+\beta^2 \gamma )\f$
00053    and \f$\psi(s)&=& s \ln \kappa + (s+\beta^2 \kappa)
00054                \cdot \left ( \int \limits_{0}^{1}
00055                \frac{1 - e^{\frac{-st}{\kappa}}}{t} \,\der t- \gamma \right )
00056                - \kappa \, e^{\frac{-s}{\kappa}}\f$.
00057    \f$ \gamma = 0.5772156649\dots\f$ is Euler's constant.
00058    
00059    The parameters are:
00060    - 0: Norm: Normalization constant
00061    - 1: x0:   Location parameter
00062    - 2: xi:   Width parameter
00063    - 3: kappa: Parameter \f$\kappa\f$ of the Vavilov distribution
00064    - 4: beta2: Parameter \f$\beta^2\f$ of the Vavilov distribution
00065    
00066    Benno List, June 2010
00067        
00068      
00069    @ingroup StatFunc
00070  */
00071 
00072 
00073 class VavilovAccurateQuantile: public IParametricFunctionOneDim {
00074    public:
00075 
00076       /**
00077          Default constructor
00078       */
00079       VavilovAccurateQuantile();
00080       
00081       /**
00082          Constructor with parameter values
00083          @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2). 
00084       */
00085       VavilovAccurateQuantile(const double *p);
00086       
00087       /**
00088          Destructor
00089       */
00090       virtual ~VavilovAccurateQuantile ();
00091       
00092       /**
00093          Access the parameter values
00094       */
00095       virtual const double * Parameters() const;
00096 
00097       /**
00098          Set the parameter values
00099          @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2). 
00100 
00101       */
00102       virtual void SetParameters(const double * p );
00103        
00104       /**
00105          Return the number of Parameters
00106       */
00107       virtual unsigned int NPar() const;
00108 
00109       /**
00110          Return the name of the i-th parameter (starting from zero)
00111        */
00112       virtual std::string ParameterName(unsigned int i) const;
00113             
00114       /**
00115          Evaluate the function
00116 
00117        @param x The Quantile \f$z\f$ , \f$0 \le z \le 1\f$ 
00118        */
00119       virtual double DoEval(double x) const;
00120    
00121       /**
00122          Evaluate the function, using parameters p
00123 
00124        @param x The Quantile \f$z\f$, \f$0 \le z \le 1\f$ 
00125          @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2). 
00126        */
00127       virtual double DoEvalPar(double x, const double * p) const;
00128    
00129       /**
00130          Return a clone of the object
00131        */
00132       virtual IBaseFunctionOneDim  * Clone() const;
00133       
00134    private:
00135      double fP[5];    
00136 
00137 };
00138 
00139 
00140 } // namespace Math
00141 } // namespace ROOT
00142 
00143 #endif /* ROOT_Math_VavilovAccurateQuantile */

Generated on Tue Jul 5 14:25:39 2011 for ROOT_528-00b_version by  doxygen 1.5.1