11#ifndef ROOT_Math_GoFTest
12#define ROOT_Math_GoFTest
105 SetUserDistribution<Dist>(dist, userDist,
xmin,
xmax);
235 std::unique_ptr<IGenFunction>
fCDF;
270 void SetSamples(std::vector<const Double_t*> samples,
const std::vector<size_t> samplesSizes);
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
GoFTest class implementing the 1 sample and 2 sample goodness of fit tests for uni-variate distributi...
static Double_t GetSigmaN(const std::vector< size_t > &ns, size_t N)
Computation of sigma_N as described in (1)
void SetUserDistribution(Dist &dist, EUserDistribution userDist=kPDF, Double_t xmin=1, Double_t xmax=0)
Sets the user input distribution function for 1-sample test as a generic functor object.
void operator()(ETestType test, Double_t &pvalue, Double_t &testStat) const
The class's unary functions performing the gif test according to the ETestType provided.
void SetDistributionFunction(const IGenFunction &cdf, Bool_t isPDF, Double_t xmin, Double_t xmax)
GoFTest(GoFTest &gof)
Disallowed copy constructor.
std::unique_ptr< IGenFunction > fCDF
Pointer to CDF used in 1-sample test.
void SetUserPDF(const IGenFunction &pdf, Double_t xmin=1, Double_t xmax=0)
Specialization to set the user input distribution as a probability density function for 1-sample test...
EDistribution
H0 distributions for using only with 1-sample tests.
@ kLogNormal
Gaussian distribution with default mean=0, sigma=1.
@ kExponential
Lognormal distribution with default meanlog=0, sigmalog=1.
@ kGaussian
For internal use only within the class's template constructor.
@ kUserDefined
Default value for non templated 1-sample test. Set with SetDistribution.
void SetUserPDF(Dist &pdf, Double_t xmin=1, Double_t xmax=0)
Sets the user input distribution as a probability density function for 1-sample tests.
EDistribution fDist
Type of distribution.
GoFTest operator=(GoFTest &gof)
Disallowed assign operator.
void SetUserCDF(const IGenFunction &cdf, Double_t xmin=1, Double_t xmax=0)
Specialization to set the user input distribution as a cumulative distribution function for 1-sample ...
void Instantiate(const Double_t *sample, size_t sampleSize)
std::vector< Double_t > fCombinedSamples
The combined data.
void KolmogorovSmirnovTest(Double_t &pvalue, Double_t &testStat) const
Kolmogorov-Smirnov 1-Sample Test.
std::vector< Double_t > fParams
The distribution parameters (e.g. fParams[0] = mean, fParams[1] = sigma for a Gaussian)
ETestType
Goodness of Fit test types for using with the class's unary functions as a shorthand for the in-built...
@ kKS
Anderson-Darling 2-Samples Test.
@ kKS2s
Kolmogorov-Smirnov Test.
@ kAD2s
Anderson-Darling Test. Default value.
void SetSamples(std::vector< const Double_t * > samples, const std::vector< size_t > samplesSizes)
set a vector of samples
static Double_t PValueADKSamples(size_t nsamples, Double_t A2)
Computation of the K-Sample Anderson-Darling Test's p-value as described in (1)
EUserDistribution
User input distribution option.
@ kPDF
Input distribution is a CDF : cumulative distribution function.
Double_t LogNormalCDF(Double_t x) const
void LogSample()
Applies the logarithm to the sample when the specified distribution to test is LogNormal.
void SetDistribution(EDistribution dist, const std::vector< double > &distParams={})
Sets the distribution for the predefined distribution types and optionally its parameters for 1-sampl...
Double_t GaussianCDF(Double_t x) const
void SetUserDistribution(const IGenFunction &dist, GoFTest::EUserDistribution userDist=kPDF, Double_t xmin=1, Double_t xmax=0)
Sets the user input distribution function for 1-sample test using the ROOT::Math::IGenFunction interf...
void AndersonDarling2SamplesTest(Double_t &pvalue, Double_t &testStat) const
Performs the Anderson-Darling 2-Sample Test.
GoFTest()
Disallowed default constructor.
void KolmogorovSmirnov2SamplesTest(Double_t &pvalue, Double_t &testStat) const
Kolmogorov-Smirnov 2-Samples Test.
std::vector< std::vector< Double_t > > fSamples
The input data.
Double_t PValueAD1Sample(Double_t A2) const
Computation of the 1-Sample Anderson-Darling Test's p-value.
GoFTest(size_t sampleSize, const Double_t *sample, Dist &dist, EUserDistribution userDist=kPDF, Double_t xmin=1, Double_t xmax=0)
Templated constructor for 1-sample tests with a user specified distribution as a functor object imple...
void AndersonDarlingTest(Double_t &pvalue, Double_t &testStat) const
Performs the Anderson-Darling 1-Sample Test.
GoFTest(size_t sampleSize, const Double_t *sample, const IGenFunction &dist, EUserDistribution userDist=kPDF, Double_t xmin=1, Double_t xmax=0)
Constructor for 1-sample tests with a user specified distribution implementing the ROOT::Math::IGenFu...
Double_t ExponentialCDF(Double_t x) const
void SetParameters(const std::vector< double > ¶ms)
Sets the distribution parameters.
static Double_t InterpolatePValues(int nsamples, Double_t A2)
Linear interpolation used in GoFTest::PValueAD2Samples.
void SetUserCDF(Dist &cdf, Double_t xmin=1, Double_t xmax=0)
Sets the user input distribution as a cumulative distribution function for 1-sample tests.
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Template class to wrap any C++ callable object which takes one argument i.e.
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Namespace for new Math classes and functions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...