90 "KernelType:Gaussian;Iteration:Adaptive;Mirror:noMirror;Binning:RelaxedBinning",
Double_t rho = 1.0) {
91 Instantiate(
nullptr, events, data,
nullptr, xMin, xMax, option, rho);
96 "KernelType:Gaussian;Iteration:Adaptive;Mirror:noMirror;Binning:RelaxedBinning",
Double_t rho = 1.0) {
97 Instantiate(
nullptr, events, data, dataWeight, xMin, xMax, option, rho);
101 template<
class KernelFunction>
106 template<
class KernelFunction>
234 Double_t k2_PI_ROOT_INV = 0.398942280401432703;
235 return (
x > -9. &&
x < 9.) ? k2_PI_ROOT_INV * std::exp(-.5 *
x *
x) : 0.0;
238 return (
x > -1. &&
x < 1.) ? 3. / 4. * (1. -
x *
x) : 0.0;
242 return (
x > -1. &&
x < 1.) ? 15. / 16. * (1. -
x *
x) * (1. -
x *
x) : 0.0;
276 void GetOptions(std::string optionType, std::string option);
#define ClassDef(name, id)
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.
A TGraphErrors is a TGraph with error bars.
std::vector< Double_t > fWeights
void ComputeAdaptiveWeights()
Double_t GetFixedWeight() const
Double_t GetWeight(Double_t x) const
Double_t operator()(Double_t x) const
const std::vector< Double_t > & GetAdaptiveWeights() const
Kernel Density Estimation class.
TF1 * GetPDFUpperConfidenceInterval(Double_t confidenceLevel=0.95, UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
TF1 * GetKDEApproximateBias(UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
void SetData(const Double_t *data, const Double_t *weights)
TF1 * fLowerPDF
Output Kernel Density Estimation upper confidence interval PDF function.
std::vector< Double_t > fKernelSigmas2
Double_t ComputeKernelL2Norm() const
TF1 * GetPDFLowerConfidenceInterval(Double_t confidenceLevel=0.95, UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
void SetKernelType(EKernelType kern)
std::vector< Double_t > fCanonicalBandwidths
void SetKernelFunction(KernelFunction_Ptr kernfunc=0)
void ComputeDataStats()
Internal funciton to compute statistics (mean,stddev) using always all the provided data (i....
Double_t UpperConfidenceInterval(const Double_t *x, const Double_t *p) const
TF1 * GetDrawnUpperFunction()
Double_t ApproximateBias(const Double_t *x, const Double_t *) const
Double_t ComputeMidspread()
void DrawConfidenceInterval(TString &drawOpt, double cl=0.95)
// Draws the KDE and its confidence interval
TF1 * GetDrawnLowerFunction()
void SetMirroredEvents()
Intgernal function to mirror the data.
void SetUserCanonicalBandwidth()
void CheckKernelValidity()
TKDE(const Char_t *, const KernelFunction &kernfunc, UInt_t events, const Double_t *data, const Double_t *dataWeight, Double_t xMin=0.0, Double_t xMax=0.0, const Option_t *option="KernelType:UserDefined;Iteration:Adaptive;Mirror:noMirror;Binning:RelaxedBinning", Double_t rho=1.0)
Constructor for weighted data and a user defined kernel function.
const Double_t * GetAdaptiveWeights() const
Double_t fAdaptiveBandwidthFactor
Double_t LowerConfidenceInterval(const Double_t *x, const Double_t *p) const
std::vector< Double_t > fBinCount
EIteration
Iteration types. They can be set using SetIteration()
Double_t GetRAMISE() const
void SetIteration(EIteration iter)
Double_t ComputeKernelIntegral() const
Double_t CosineArchKernel(Double_t x) const
Double_t operator()(Double_t x) const
void SetUserKernelSigma2()
Double_t GetBias(Double_t x) const
std::vector< Double_t > fData
TGraphErrors * GetGraphWithErrors(UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
return a TGraphErrors with the KDE values and errors The return object is managed by the user
ROOT::Math::IBaseFunctionOneDim * KernelFunction_Ptr
void SetUseBinsNEvents(UInt_t nEvents)
std::vector< Double_t > fEvents
Double_t GetError(Double_t x) const
TF1 * GetKDEFunction(UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
void SetBinning(EBinning)
void GetOptions(std::string optionType, std::string option)
Double_t GetValue(Double_t x) const
std::vector< Bool_t > fSettedOptions
Double_t GaussianKernel(Double_t x) const
void SetRange(Double_t xMin, Double_t xMax)
Double_t ComputeKernelSigma2() const
void SetOptions(const Option_t *option, Double_t rho)
Double_t GetFixedWeight() const
TF1 * GetFunction(UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
TF1 * GetUpperFunction(Double_t confidenceLevel=0.95, UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
void Instantiate(KernelFunction_Ptr kernfunc, UInt_t events, const Double_t *data, const Double_t *weight, Double_t xMin, Double_t xMax, const Option_t *option, Double_t rho)
void SetDrawOptions(const Option_t *option, TString &plotOpt, TString &drawOpt)
EMirror
Data "mirroring" option to address the probability "spill out" boundary effect They can be set using ...
TGraphErrors * GetDrawnGraph()
TGraphErrors * fGraph
Output Kernel Density Estimation approximate bias.
void SetCanonicalBandwidths()
TKDE()
default constructor used only by I/O
void SetBinCentreData(Double_t xmin, Double_t xmax)
TKDE(const Char_t *, const KernelFunction &kernfunc, UInt_t events, const Double_t *data, Double_t xMin=0.0, Double_t xMax=0.0, const Option_t *option="KernelType:UserDefined;Iteration:Adaptive;Mirror:noMirror;Binning:RelaxedBinning", Double_t rho=1.0)
Constructor for unwweighted data and a user defined kernel function.
void SetTuneFactor(Double_t rho)
TF1 * fUpperPDF
Output Kernel Density Estimation PDF function.
Double_t ComputeKernelMu() const
EKernelType
Types of Kernel functions They can be set using the function SetKernelType()
void DrawErrors(TString &drawOpt)
Draws a TGraphErrors wih KDE values and errors.
void SetNBins(UInt_t nbins)
void CheckOptions(Bool_t isUserDefinedKernel=kFALSE)
Double_t EpanechnikovKernel(Double_t x) const
Double_t BiweightKernel(Double_t x) const
std::unique_ptr< TKernel > fKernel
! internal kernel class. Transient because it is recreated after reading from a file
Bool_t fUseMinMaxFromData
Double_t GetSigma() const
EKernelType fKernelType
Graph with the errors.
TF1 * fApproximateBias
Output Kernel Density Estimation lower confidence interval PDF function.
TKDE operator=(TKDE &kde)
void SetSigma(Double_t R)
TKDE(UInt_t events, const Double_t *data, Double_t xMin=0.0, Double_t xMax=0.0, const Option_t *option="KernelType:Gaussian;Iteration:Adaptive;Mirror:noMirror;Binning:RelaxedBinning", Double_t rho=1.0)
Constructor for unweighted data Varius option for TKDE can be passed in the option string as below.
std::vector< Double_t > fEventWeights
TF1 * GetApproximateBias(UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
TF1 * GetLowerFunction(Double_t confidenceLevel=0.95, UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
TKDE(UInt_t events, const Double_t *data, const Double_t *dataWeight, Double_t xMin=0.0, Double_t xMax=0.0, const Option_t *option="KernelType:Gaussian;Iteration:Adaptive;Mirror:noMirror;Binning:RelaxedBinning", Double_t rho=1.0)
Constructor for weighted data.
KernelFunction_Ptr fKernelFunction
! pointer to kernel function
friend struct KernelIntegrand
EBinning
Data binning option.
The TNamed class is the base class for all named ROOT classes.