ROOT
6.06/09
Reference Guide
|
Class describing a Vavilov distribution.
The probability density function of the Vavilov distribution as function of Landau's parameter is given by:
\[ p(\lambda_L; \kappa, \beta^2) = \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} \phi(s) e^{\lambda_L s} ds\]
where \(\phi(s) = e^{C} e^{\psi(s)}\) with \( C = \kappa (1+\beta^2 \gamma )\) and \(\psi(s)= s \ln \kappa + (s+\beta^2 \kappa) \cdot \left ( \int \limits_{0}^{1} \frac{1 - e^{\frac{-st}{\kappa}}}{t} \,d t- \gamma \right ) - \kappa \, e^{\frac{-s}{\kappa}}\). \( \gamma = 0.5772156649\dots\) is Euler's constant.
For the class VavilovAccurate, Pdf returns the Vavilov distribution as function of Landau's parameter \(\lambda_L = \lambda_V/\kappa - \ln \kappa\), which is the convention used in the CERNLIB routines, and in the tables by S.M. Seltzer and M.J. Berger: Energy loss stragglin of protons and mesons: Tabulation of the Vavilov distribution, pp 187-203 in: National Research Council (U.S.), Committee on Nuclear Science: Studies in penetration of charged particles in matter, Nat. Akad. Sci. Publication 1133, Nucl. Sci. Series Report No. 39, Washington (Nat. Akad. Sci.) 1964, 388 pp. Available from Google books
Therefore, for small values of \(\kappa < 0.01\), pdf approaches the Landau distribution.
For values \(\kappa > 10\), the Gauss approximation should be used with \(\mu\) and \(\sigma\) given by Vavilov::mean(kappa, beta2) and sqrt(Vavilov::variance(kappa, beta2).
The original Vavilov pdf is obtained by v.Pdf(lambdaV/kappa-log(kappa))/kappa.
For detailed description see B. Schorr, Programs for the Landau and the Vavilov distributions and the corresponding random numbers, Computer Phys. Comm. 7 (1974) 215-224, which has been implemented in CERNLIB (G116).
The class stores coefficients needed to calculate \(p(\lambda; \kappa, \beta^2)\) for fixed values of \(\kappa\) and \(\beta^2\). Changing these values is computationally expensive.
The parameter \(\kappa\) should be in the range \(0.01 \le \kappa \le 10\). In contrast to the CERNLIB implementation, all values of \(\kappa \ge 0.001\) may be used, but may result in slower running and/or inaccurate results.
The parameter \(\beta^2\) must be in the range \(0 \le \beta^2 \le 1\).
Two parameters which are fixed in the CERNLIB implementation may be set by the user:
For the quantile calculation, the algorithm given by Schorr is not used, because it turns out to be very slow and still inaccurate. Instead, an initial estimate is calculated based on a precalculated table, which is subsequently improved by Newton iterations.
While the CERNLIB implementation calculates at most 156 terms in the series expansion for the pdf and cdf calculation, this class calculates up to 500 terms, depending on the values of epsilonPM and epsilon.
Average times on a Pentium Core2 Duo P8400 2.26GHz:
Benno List, June 2010
Definition at line 131 of file VavilovAccurate.h.
Public Member Functions | |
VavilovAccurate (double kappa=1, double beta2=1, double epsilonPM=5E-4, double epsilon=1E-5) | |
Initialize an object to calculate the Vavilov distribution. More... | |
virtual | ~VavilovAccurate () |
Destructor. More... | |
double | Pdf (double x) const |
Evaluate the Vavilov probability density function. More... | |
double | Pdf (double x, double kappa, double beta2) |
Evaluate the Vavilov probability density function, and set kappa and beta2, if necessary. More... | |
double | Cdf (double x) const |
Evaluate the Vavilov cummulative probability density function. More... | |
double | Cdf (double x, double kappa, double beta2) |
Evaluate the Vavilov cummulative probability density function, and set kappa and beta2, if necessary. More... | |
double | Cdf_c (double x) const |
Evaluate the Vavilov complementary cummulative probability density function. More... | |
double | Cdf_c (double x, double kappa, double beta2) |
Evaluate the Vavilov complementary cummulative probability density function, and set kappa and beta2, if necessary. More... | |
double | Quantile (double z) const |
Evaluate the inverse of the Vavilov cummulative probability density function. More... | |
double | Quantile (double z, double kappa, double beta2) |
Evaluate the inverse of the Vavilov cummulative probability density function, and set kappa and beta2, if necessary. More... | |
double | Quantile_c (double z) const |
Evaluate the inverse of the complementary Vavilov cummulative probability density function. More... | |
double | Quantile_c (double z, double kappa, double beta2) |
Evaluate the inverse of the complementary Vavilov cummulative probability density function, and set kappa and beta2, if necessary. More... | |
virtual void | SetKappaBeta2 (double kappa, double beta2) |
Change \(\kappa\) and \(\beta^2\) and recalculate coefficients if necessary. More... | |
void | Set (double kappa, double beta2, double epsilonPM=5E-4, double epsilon=1E-5) |
(Re)Initialize the object More... | |
virtual double | GetLambdaMin () const |
Return the minimum value of \(\lambda\) for which \(p(\lambda; \kappa, \beta^2)\) is nonzero in the current approximation. More... | |
virtual double | GetLambdaMax () const |
Return the maximum value of \(\lambda\) for which \(p(\lambda; \kappa, \beta^2)\) is nonzero in the current approximation. More... | |
virtual double | GetKappa () const |
Return the current value of \(\kappa\). More... | |
virtual double | GetBeta2 () const |
Return the current value of \(\beta^2\). More... | |
virtual double | Mode () const |
Return the value of \(\lambda\) where the pdf is maximal. More... | |
virtual double | Mode (double kappa, double beta2) |
Return the value of \(\lambda\) where the pdf is maximal function, and set kappa and beta2, if necessary. More... | |
double | GetEpsilonPM () const |
Return the current value of \(\epsilon^+ = \epsilon^-\). More... | |
double | GetEpsilon () const |
Return the current value of \(\epsilon\). More... | |
double | GetNTerms () const |
Return the number of terms used in the series expansion. More... | |
Public Member Functions inherited from ROOT::Math::Vavilov | |
Vavilov () | |
Default constructor. More... | |
virtual | ~Vavilov () |
Destructor. More... | |
virtual double | Mean () const |
Return the theoretical mean \(\mu = \gamma-1- \ln \kappa - \beta^2\), where \(\gamma = 0.5772\dots\) is Euler's constant. More... | |
virtual double | Variance () const |
Return the theoretical variance \(\sigma^2 = \frac{1 - \beta^2/2}{\kappa}\). More... | |
virtual double | Skewness () const |
Return the theoretical skewness \(\gamma_1 = \frac{1/2 - \beta^2/3}{\kappa^2 \sigma^3} \). More... | |
virtual double | Kurtosis () const |
Return the theoretical kurtosis \(\gamma_2 = \frac{1/3 - \beta^2/4}{\kappa^3 \sigma^4}\). More... | |
Static Public Member Functions | |
static VavilovAccurate * | GetInstance () |
Returns a static instance of class VavilovFast. More... | |
static VavilovAccurate * | GetInstance (double kappa, double beta2) |
Returns a static instance of class VavilovFast, and sets the values of kappa and beta2. More... | |
Static Public Member Functions inherited from ROOT::Math::Vavilov | |
static double | Mean (double kappa, double beta2) |
Return the theoretical Mean \(\mu = \gamma-1- \ln \kappa - \beta^2\). More... | |
static double | Variance (double kappa, double beta2) |
Return the theoretical Variance \(\sigma^2 = \frac{1 - \beta^2/2}{\kappa}\). More... | |
static double | Skewness (double kappa, double beta2) |
Return the theoretical skewness \(\gamma_1 = \frac{1/2 - \beta^2/3}{\kappa^2 \sigma^3} \). More... | |
static double | Kurtosis (double kappa, double beta2) |
Return the theoretical kurtosis \(\gamma_2 = \frac{1/3 - \beta^2/4}{\kappa^3 \sigma^4}\). More... | |
Private Types | |
enum | { MAXTERMS =500 } |
enum | { kNquantMax =32 } |
Private Member Functions | |
void | InitQuantile () const |
double | G116f1 (double x) const |
double | G116f2 (double x) const |
int | Rzero (double a, double b, double &x0, double eps, int mxf, double(VavilovAccurate::*f)(double) const) const |
Static Private Member Functions | |
static double | E1plLog (double x) |
Private Attributes | |
double | fH [8] |
double | fT0 |
double | fT1 |
double | fT |
double | fOmega |
double | fA_pdf [MAXTERMS+1] |
double | fB_pdf [MAXTERMS+1] |
double | fA_cdf [MAXTERMS+1] |
double | fB_cdf [MAXTERMS+1] |
double | fX0 |
double | fKappa |
double | fBeta2 |
double | fEpsilonPM |
double | fEpsilon |
bool | fQuantileInit |
int | fNQuant |
double | fQuant [kNquantMax] |
double | fLambda [kNquantMax] |
Static Private Attributes | |
static VavilovAccurate * | fgInstance = 0 |
#include <Math/VavilovAccurate.h>
ROOT::Math::VavilovAccurate::VavilovAccurate | ( | double | kappa = 1 , |
double | beta2 = 1 , |
||
double | epsilonPM = 5E-4 , |
||
double | epsilon = 1E-5 |
||
) |
Initialize an object to calculate the Vavilov distribution.
kappa | The parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \) |
beta2 | The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \) |
epsilonPM | \(\epsilon^+ = \epsilon^-\) in Eqs. (2.1) and (2.2) of Schorr's paper; gives an estimate on the integral of the cummulative distribution function outside the range \(\lambda_{min} \le \lambda \le \lambda_{max}\) where the approximation is valid. |
epsilon | \(\epsilon\) in Eq. (4.10) of Schorr's paper; determines the accuracy of the series expansion. |
Definition at line 52 of file VavilovAccurate.cxx.
Referenced by GetInstance().
|
virtual |
Destructor.
Definition at line 58 of file VavilovAccurate.cxx.
Evaluate the Vavilov cummulative probability density function.
x | The Landau parameter \(x = \lambda_L\) |
Implements ROOT::Math::Vavilov.
Definition at line 257 of file VavilovAccurate.cxx.
Referenced by Cdf(), ROOT::Math::VavilovAccurateCdf::DoEval(), ROOT::Math::VavilovAccurateCdf::DoEvalPar(), InitQuantile(), Quantile(), and ROOT::Math::vavilov_accurate_cdf().
Evaluate the Vavilov cummulative probability density function, and set kappa and beta2, if necessary.
x | The Landau parameter \(x = \lambda_L\) |
kappa | The parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \) |
beta2 | The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \) |
Implements ROOT::Math::Vavilov.
Definition at line 292 of file VavilovAccurate.cxx.
Evaluate the Vavilov complementary cummulative probability density function.
x | The Landau parameter \(x = \lambda_L\) |
Implements ROOT::Math::Vavilov.
Definition at line 297 of file VavilovAccurate.cxx.
Referenced by Cdf_c(), Quantile_c(), and ROOT::Math::vavilov_accurate_cdf_c().
Evaluate the Vavilov complementary cummulative probability density function, and set kappa and beta2, if necessary.
x | The Landau parameter \(x = \lambda_L\) |
kappa | The parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \) |
beta2 | The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \) |
Implements ROOT::Math::Vavilov.
Definition at line 332 of file VavilovAccurate.cxx.
Definition at line 645 of file VavilovAccurate.cxx.
Definition at line 487 of file VavilovAccurate.cxx.
Referenced by Set().
Definition at line 496 of file VavilovAccurate.cxx.
Referenced by Set().
|
virtual |
Return the current value of \(\beta^2\).
Implements ROOT::Math::Vavilov.
Definition at line 672 of file VavilovAccurate.cxx.
double ROOT::Math::VavilovAccurate::GetEpsilon | ( | ) | const |
Return the current value of \(\epsilon\).
Definition at line 704 of file VavilovAccurate.cxx.
double ROOT::Math::VavilovAccurate::GetEpsilonPM | ( | ) | const |
Return the current value of \(\epsilon^+ = \epsilon^-\).
Definition at line 700 of file VavilovAccurate.cxx.
|
static |
Returns a static instance of class VavilovFast.
Definition at line 451 of file VavilovAccurate.cxx.
Referenced by ROOT::Math::vavilov_accurate_cdf(), ROOT::Math::vavilov_accurate_cdf_c(), ROOT::Math::vavilov_accurate_pdf(), ROOT::Math::vavilov_accurate_quantile(), and ROOT::Math::vavilov_accurate_quantile_c().
|
static |
Returns a static instance of class VavilovFast, and sets the values of kappa and beta2.
kappa | The parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \) |
beta2 | The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \) |
Definition at line 456 of file VavilovAccurate.cxx.
|
virtual |
Return the current value of \(\kappa\).
Implements ROOT::Math::Vavilov.
Definition at line 668 of file VavilovAccurate.cxx.
|
virtual |
Return the maximum value of \(\lambda\) for which \(p(\lambda; \kappa, \beta^2)\) is nonzero in the current approximation.
Implements ROOT::Math::Vavilov.
Definition at line 664 of file VavilovAccurate.cxx.
|
virtual |
Return the minimum value of \(\lambda\) for which \(p(\lambda; \kappa, \beta^2)\) is nonzero in the current approximation.
Implements ROOT::Math::Vavilov.
Definition at line 660 of file VavilovAccurate.cxx.
double ROOT::Math::VavilovAccurate::GetNTerms | ( | ) | const |
Return the number of terms used in the series expansion.
Definition at line 708 of file VavilovAccurate.cxx.
|
private |
Definition at line 186 of file VavilovAccurate.cxx.
Referenced by Quantile(), and Quantile_c().
|
virtual |
Return the value of \(\lambda\) where the pdf is maximal.
Reimplemented from ROOT::Math::Vavilov.
Definition at line 676 of file VavilovAccurate.cxx.
Referenced by Mode().
Return the value of \(\lambda\) where the pdf is maximal function, and set kappa and beta2, if necessary.
kappa | The parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \) |
beta2 | The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \) |
Reimplemented from ROOT::Math::Vavilov.
Definition at line 695 of file VavilovAccurate.cxx.
Evaluate the Vavilov probability density function.
x | The Landau parameter \(x = \lambda_L\) |
Implements ROOT::Math::Vavilov.
Definition at line 218 of file VavilovAccurate.cxx.
Referenced by ROOT::Math::VavilovAccuratePdf::DoEval(), ROOT::Math::VavilovAccuratePdf::DoEvalPar(), Mode(), Pdf(), Quantile(), Quantile_c(), and ROOT::Math::vavilov_accurate_pdf().
Evaluate the Vavilov probability density function, and set kappa and beta2, if necessary.
x | The Landau parameter \(x = \lambda_L\) |
kappa | The parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \) |
beta2 | The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \) |
Implements ROOT::Math::Vavilov.
Definition at line 252 of file VavilovAccurate.cxx.
Evaluate the inverse of the Vavilov cummulative probability density function.
z | The argument \(z\), which must be in the range \(0 \le z \le 1\) |
Implements ROOT::Math::Vavilov.
Definition at line 337 of file VavilovAccurate.cxx.
Referenced by ROOT::Math::VavilovAccurateQuantile::DoEval(), ROOT::Math::VavilovAccurateQuantile::DoEvalPar(), Quantile(), and ROOT::Math::vavilov_accurate_quantile().
Evaluate the inverse of the Vavilov cummulative probability density function, and set kappa and beta2, if necessary.
z | The argument \(z\), which must be in the range \(0 \le z \le 1\) |
kappa | The parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \) |
beta2 | The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \) |
Implements ROOT::Math::Vavilov.
Definition at line 384 of file VavilovAccurate.cxx.
Evaluate the inverse of the complementary Vavilov cummulative probability density function.
z | The argument \(z\), which must be in the range \(0 \le z \le 1\) |
Implements ROOT::Math::Vavilov.
Definition at line 389 of file VavilovAccurate.cxx.
Referenced by Quantile_c(), and ROOT::Math::vavilov_accurate_quantile_c().
Evaluate the inverse of the complementary Vavilov cummulative probability density function, and set kappa and beta2, if necessary.
z | The argument \(z\), which must be in the range \(0 \le z \le 1\) |
kappa | The parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \) |
beta2 | The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \) |
Implements ROOT::Math::Vavilov.
Definition at line 446 of file VavilovAccurate.cxx.
|
private |
Definition at line 505 of file VavilovAccurate.cxx.
Referenced by Set().
void ROOT::Math::VavilovAccurate::Set | ( | double | kappa, |
double | beta2, | ||
double | epsilonPM = 5E-4 , |
||
double | epsilon = 1E-5 |
||
) |
(Re)Initialize the object
kappa | The parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \) |
beta2 | The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \) |
epsilonPM | \(\epsilon^+ = \epsilon^-\) in Eqs. (2.1) and (2.2) of Schorr's paper; gives an estimate on the integral of the cummulative distribution function outside the range \(\lambda_{min} \le \lambda \le \lambda_{max}\) where the approximation is valid. |
epsilon | \(\epsilon\) in Eq. (4.10) of Schorr's paper; determines the accuracy of the series expansion. |
Definition at line 67 of file VavilovAccurate.cxx.
Referenced by Cdf(), Cdf_c(), GetInstance(), Mode(), Pdf(), Quantile(), Quantile_c(), SetKappaBeta2(), and VavilovAccurate().
Change \(\kappa\) and \(\beta^2\) and recalculate coefficients if necessary.
kappa | The parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \) |
beta2 | The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \) |
Implements ROOT::Math::Vavilov.
Definition at line 63 of file VavilovAccurate.cxx.
Definition at line 333 of file VavilovAccurate.h.
Definition at line 333 of file VavilovAccurate.h.
Definition at line 333 of file VavilovAccurate.h.
Definition at line 333 of file VavilovAccurate.h.
|
private |
Definition at line 334 of file VavilovAccurate.h.
Referenced by Cdf(), Cdf_c(), GetBeta2(), GetInstance(), InitQuantile(), Mode(), Pdf(), Quantile(), Quantile_c(), and Set().
|
private |
Definition at line 335 of file VavilovAccurate.h.
Referenced by GetEpsilon(), Quantile(), Quantile_c(), and Set().
|
private |
Definition at line 335 of file VavilovAccurate.h.
Referenced by GetEpsilonPM(), Quantile(), Quantile_c(), and Set().
|
staticprivate |
Definition at line 345 of file VavilovAccurate.h.
Referenced by GetInstance().
|
private |
Definition at line 333 of file VavilovAccurate.h.
|
private |
Definition at line 334 of file VavilovAccurate.h.
Referenced by Cdf(), Cdf_c(), GetInstance(), GetKappa(), InitQuantile(), Mode(), Pdf(), Quantile(), Quantile_c(), and Set().
|
mutableprivate |
Definition at line 341 of file VavilovAccurate.h.
Referenced by InitQuantile(), Quantile(), and Quantile_c().
|
mutableprivate |
Definition at line 338 of file VavilovAccurate.h.
Referenced by InitQuantile(), Quantile(), and Quantile_c().
|
private |
|
mutableprivate |
Definition at line 340 of file VavilovAccurate.h.
Referenced by InitQuantile(), Quantile(), and Quantile_c().
|
mutableprivate |
Definition at line 337 of file VavilovAccurate.h.
Referenced by InitQuantile(), Quantile(), Quantile_c(), and Set().
|
private |
Definition at line 333 of file VavilovAccurate.h.
|
private |
Definition at line 333 of file VavilovAccurate.h.
Referenced by Cdf(), Cdf_c(), GetLambdaMin(), InitQuantile(), Pdf(), Quantile(), Quantile_c(), and Set().
|
private |
Definition at line 333 of file VavilovAccurate.h.
Referenced by Cdf(), Cdf_c(), GetLambdaMax(), InitQuantile(), Pdf(), Quantile(), Quantile_c(), and Set().
|
private |
Definition at line 333 of file VavilovAccurate.h.
Referenced by Cdf(), Cdf_c(), GetNTerms(), Pdf(), and Set().