Logo ROOT   6.12/07
Reference Guide
VavilovAccurateQuantile.h
Go to the documentation of this file.
1 // @(#)root/mathmore:$Id$
2 // Authors: B. List 29.4.2010
3 
4  /**********************************************************************
5  * *
6  * Copyright (c) 2004 ROOT Foundation, CERN/PH-SFT *
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU General Public License *
10  * as published by the Free Software Foundation; either version 2 *
11  * of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this library (see file COPYING); if not, write *
20  * to the Free Software Foundation, Inc., 59 Temple Place, Suite *
21  * 330, Boston, MA 02111-1307 USA, or contact the author. *
22  * *
23  **********************************************************************/
24 
25 // Header file for class VavilovAccurateQuantile
26 //
27 // Created by: blist at Thu Apr 29 11:19:00 2010
28 //
29 // Last update: Thu Apr 29 11:19:00 2010
30 //
31 #ifndef ROOT_Math_VavilovAccurateQuantile
32 #define ROOT_Math_VavilovAccurateQuantile
33 
34 
35 #include "Math/IParamFunction.h"
36 #include "Math/VavilovAccurate.h"
37 
38 namespace ROOT {
39 namespace Math {
40 
41 //____________________________________________________________________________
42 /**
43  Class describing the Vavilov quantile function.
44 
45  The probability density function of the Vavilov distribution
46  is given by:
47  \f[ p(\lambda; \kappa, \beta^2) =
48  \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} \phi(s) e^{\lambda s} ds\f]
49  where \f$\phi(s) = e^{C} e^{\psi(s)}\f$
50  with \f$ C = \kappa (1+\beta^2 \gamma )\f$
51  and \f[\psi(s) = s \ln \kappa + (s+\beta^2 \kappa)
52  \cdot \left ( \int \limits_{0}^{1}
53  \frac{1 - e^{\frac{-st}{\kappa}}}{t} \, dt- \gamma \right )
54  - \kappa \, e^{\frac{-s}{\kappa}}\f].
55  \f$ \gamma = 0.5772156649\dots\f$ is Euler's constant.
56 
57  The parameters are:
58  - 0: Norm: Normalization constant
59  - 1: x0: Location parameter
60  - 2: xi: Width parameter
61  - 3: kappa: Parameter \f$\kappa\f$ of the Vavilov distribution
62  - 4: beta2: Parameter \f$\beta^2\f$ of the Vavilov distribution
63 
64  Benno List, June 2010
65 
66 
67  @ingroup StatFunc
68  */
69 
70 
72  public:
73 
74  /**
75  Default constructor
76  */
78 
79  /**
80  Constructor with parameter values
81  @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2).
82  */
83  VavilovAccurateQuantile(const double *p);
84 
85  /**
86  Destructor
87  */
88  virtual ~VavilovAccurateQuantile ();
89 
90  /**
91  Access the parameter values
92  */
93  virtual const double * Parameters() const;
94 
95  /**
96  Set the parameter values
97  @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2).
98 
99  */
100  virtual void SetParameters(const double * p );
101 
102  /**
103  Return the number of Parameters
104  */
105  virtual unsigned int NPar() const;
106 
107  /**
108  Return the name of the i-th parameter (starting from zero)
109  */
110  virtual std::string ParameterName(unsigned int i) const;
111 
112  /**
113  Evaluate the function
114 
115  @param x The Quantile \f$z\f$ , \f$0 \le z \le 1\f$
116  */
117  virtual double DoEval(double x) const;
118 
119  /**
120  Evaluate the function, using parameters p
121 
122  @param x The Quantile \f$z\f$, \f$0 \le z \le 1\f$
123  @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2).
124  */
125  virtual double DoEvalPar(double x, const double * p) const;
126 
127  /**
128  Return a clone of the object
129  */
130  virtual IBaseFunctionOneDim * Clone() const;
131 
132  private:
133  double fP[5];
134 
135 };
136 
137 
138 } // namespace Math
139 } // namespace ROOT
140 
141 #endif /* ROOT_Math_VavilovAccurateQuantile */
virtual std::string ParameterName(unsigned int i) const
Return the name of the i-th parameter (starting from zero)
virtual void SetParameters(const double *p)
Set the parameter values.
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Definition: IFunction.h:135
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Double_t x[n]
Definition: legend1.C:17
Class describing the Vavilov quantile function.
virtual const double * Parameters() const
Access the parameter values.
virtual unsigned int NPar() const
Return the number of Parameters.
Specialized IParamFunction interface (abstract class) for one-dimensional parametric functions It is ...
virtual IBaseFunctionOneDim * Clone() const
Return a clone of the object.
Namespace for new Math classes and functions.
virtual double DoEval(double x) const
Evaluate the function.
virtual double DoEvalPar(double x, const double *p) const
Evaluate the function, using parameters p.