Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TKDE.h
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Authors: Bartolomeu Rabacal 07/2010
3/**********************************************************************
4 * *
5 * Copyright (c) 2006 , LCG ROOT MathLib Team *
6 * *
7 * *
8 **********************************************************************/
9// Header file for TKDE
10
11#ifndef ROOT_TKDE
12#define ROOT_TKDE
13
15
16#include "TNamed.h"
17
18#include "Math/Math.h"
19
20#include <string>
21#include <vector>
22#include <memory>
23
24class TGraphErrors;
25class TF1;
26
27/*
28 Kernel Density Estimation class. The three main references are (1) "Scott DW, Multivariate Density Estimation.
29Theory, Practice and Visualization. New York: Wiley", (2) "Jann Ben - ETH Zurich, Switzerland -, Univariate kernel density estimation document for KDENS: Stata module for univariate kernel density estimation." and (3) "Hardle W, Muller M, Sperlich S, Werwatz A, Nonparametric and Semiparametric Models. Springer."
30 The algorithm is briefly described in (4) "Cranmer KS, Kernel Estimation in High-Energy
31Physics. Computer Physics Communications 136:198-207,2001" - e-Print Archive: hep ex/0011057.
32 A binned version is also implemented to address the performance issue due to its data size dependence.
33*/
34class TKDE : public TNamed {
35public:
36
37 /// Types of Kernel functions
38 /// They can be set using the function SetKernelType()
39 // or as a string in the constructor
40 enum EKernelType { // Kernel function type option
45 kUserDefined, // Internal use only for the class's template constructor
46 kTotalKernels // Internal use only for member initialization
47 };
48
49 /// Iteration types. They can be set using SetIteration()
52 kFixed
53 };
54
55 /// Data "mirroring" option to address the probability "spill out" boundary effect
56 /// They can be set using SetMirror()
57 enum EMirror {
67 };
68
69 /// Data binning option.
70 /// They can be set using SetBinning()
73 kRelaxedBinning, // The algorithm is allowed to use binning if the data is large enough
75 };
76
77 /// default constructor used only by I/O
78 TKDE();
79
80 /// Constructor for unweighted data
81 /// Varius option for TKDE can be passed in the option string as below.
82 /// Note that min and max will define the plotting range but will not restrict the data in the unbinned case
83 /// Instead when use binning, only the data in the range will be considered.
84 /// Note also, that when some data exists outside the range, one should not use the mirror option with unbinned.
85 /// Adaptive will be soon very slow especially for Nevents > 10000.
86 /// For this reason, by default for Nevents >=10000, the data are automatically binned in
87 /// nbins=Min(10000,Nevents/10)
88 /// In case of ForceBinning option the default number of bins is 1000
89 TKDE(UInt_t events, const Double_t* data, Double_t xMin = 0.0, Double_t xMax = 0.0, const Option_t* option =
90 "KernelType:Gaussian;Iteration:Adaptive;Mirror:noMirror;Binning:RelaxedBinning", Double_t rho = 1.0) {
91 Instantiate( nullptr, events, data, nullptr, xMin, xMax, option, rho);
92 }
93
94 /// Constructor for weighted data
95 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 =
96 "KernelType:Gaussian;Iteration:Adaptive;Mirror:noMirror;Binning:RelaxedBinning", Double_t rho = 1.0) {
97 Instantiate( nullptr, events, data, dataWeight, xMin, xMax, option, rho);
98 }
99
100 /// Constructor for unwweighted data and a user defined kernel function
101 template<class KernelFunction>
102 TKDE(const Char_t* /*name*/, 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) {
103 Instantiate(new ROOT::Math::WrappedFunction<const KernelFunction&>(kernfunc), events, data, nullptr, xMin, xMax, option, rho);
104 }
105 /// Constructor for weighted data and a user defined kernel function
106 template<class KernelFunction>
107 TKDE(const Char_t* /*name*/, 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) {
108 Instantiate(new ROOT::Math::WrappedFunction<const KernelFunction&>(kernfunc), events, data, dataWeight, xMin, xMax, option, rho);
109 }
110
111 virtual ~TKDE();
112
113 void Fill(Double_t data);
114 void Fill(Double_t data, Double_t weight);
115 void SetKernelType(EKernelType kern);
116 void SetIteration(EIteration iter);
117 void SetMirror(EMirror mir);
118 void SetBinning(EBinning);
119 void SetNBins(UInt_t nbins);
120 void SetUseBinsNEvents(UInt_t nEvents);
121 void SetTuneFactor(Double_t rho);
122 void SetRange(Double_t xMin, Double_t xMax); // By default computed from the data
123
124 virtual void Draw(const Option_t* option = "");
125
127 Double_t operator()(const Double_t* x, const Double_t* p=0) const; // Needed for creating TF1
128
129 Double_t GetValue(Double_t x) const { return (*this)(x); }
131
132 Double_t GetBias(Double_t x) const;
133 Double_t GetMean() const;
134 Double_t GetSigma() const;
135 Double_t GetRAMISE() const;
136
137 Double_t GetFixedWeight() const;
138
139 TF1* GetFunction(UInt_t npx = 100, Double_t xMin = 1.0, Double_t xMax = 0.0);
140 TF1* GetUpperFunction(Double_t confidenceLevel = 0.95, UInt_t npx = 100, Double_t xMin = 1.0, Double_t xMax = 0.0);
141 TF1* GetLowerFunction(Double_t confidenceLevel = 0.95, UInt_t npx = 100, Double_t xMin = 1.0, Double_t xMax = 0.0);
142 TF1* GetApproximateBias(UInt_t npx = 100, Double_t xMin = 1.0, Double_t xMax = 0.0);
143 TGraphErrors * GetGraphWithErrors(UInt_t npx = 100, Double_t xMin = 1.0, Double_t xMax = 0.0);
144
145 // get the drawn object to chanage settings
146 // These objects are managed by TKDE and should not be deleted by the user
147 TF1 * GetDrawnFunction() { return fPDF;}
151
152 const Double_t * GetAdaptiveWeights() const;
153
154
155public:
156
157 class TKernel {
159 UInt_t fNWeights; // Number of kernel weights (bandwidth as vectorized for binning)
160 std::vector<Double_t> fWeights; // Kernel weights (bandwidth)
161 public:
162 TKernel(Double_t weight, TKDE *kde);
166 Double_t GetFixedWeight() const;
167 const std::vector<Double_t> &GetAdaptiveWeights() const;
168 };
169
170 friend class TKernel;
171
172private:
173
174 TKDE(TKDE& kde); // Disallowed copy constructor
175 TKDE operator=(TKDE& kde); // Disallowed assign operator
176
177 // Kernel funciton pointer. It is managed by class for internal kernels or exernally for user defined kernels
179 KernelFunction_Ptr fKernelFunction; ///<! pointer to kernel function
180
181 std::unique_ptr<TKernel> fKernel; ///<! internal kernel class. Transient because it is recreated after reading from a file
182
183 std::vector<Double_t> fData; // Data events
184 std::vector<Double_t> fEvents; // Original data storage
185 std::vector<Double_t> fEventWeights; // Original data weights
186
187 TF1* fPDF; //! Output Kernel Density Estimation PDF function
188 TF1* fUpperPDF; //! Output Kernel Density Estimation upper confidence interval PDF function
189 TF1* fLowerPDF; //! Output Kernel Density Estimation lower confidence interval PDF function
190 TF1* fApproximateBias; //! Output Kernel Density Estimation approximate bias
191 TGraphErrors* fGraph; //! Graph with the errors
192
197
198
201 Bool_t fNewData; // flag to control when new data are given
202 Bool_t fUseMinMaxFromData; // flag top control if min and max must be used from data
203
204 UInt_t fNBins; // Number of bins for binned data option
205 UInt_t fNEvents; // Data's number of events
206 Double_t fSumOfCounts; // Data sum of weights
207 UInt_t fUseBinsNEvents; // If the algorithm is allowed to use automatic (relaxed) binning this is the minimum number of events to do so
208
209 Double_t fMean; // Data mean
210 Double_t fSigma; // Data std deviation
211 Double_t fSigmaRob; // Data std deviation (robust estimation)
212 Double_t fXMin; // Data minimum value
213 Double_t fXMax; // Data maximum value
214 Double_t fRho; // Adjustment factor for sigma
215 Double_t fAdaptiveBandwidthFactor; // Geometric mean of the kernel density estimation from the data for adaptive iteration
216
217 Double_t fWeightSize; // Caches the weight size
218
219 std::vector<Double_t> fCanonicalBandwidths;
220 std::vector<Double_t> fKernelSigmas2;
221
222 std::vector<Double_t> fBinCount; // Number of events per bin for binned data option
223
224 std::vector<Bool_t> fSettedOptions; // User input options flag
225
226 struct KernelIntegrand;
227 friend struct KernelIntegrand;
228
229 void Instantiate(KernelFunction_Ptr kernfunc, UInt_t events, const Double_t* data, const Double_t* weight,
230 Double_t xMin, Double_t xMax, const Option_t* option, Double_t rho);
231
233 // Returns the kernel evaluation at x
234 Double_t k2_PI_ROOT_INV = 0.398942280401432703; // (2 * M_PI)**-0.5
235 return (x > -9. && x < 9.) ? k2_PI_ROOT_INV * std::exp(-.5 * x * x) : 0.0;
236 }
238 return (x > -1. && x < 1.) ? 3. / 4. * (1. - x * x) : 0.0;
239 }
241 // Returns the kernel evaluation at x
242 return (x > -1. && x < 1.) ? 15. / 16. * (1. - x * x) * (1. - x * x) : 0.0;
243 }
245 // Returns the kernel evaluation at x
246 return (x > -1. && x < 1.) ? M_PI_4 * std::cos(M_PI_2 * x) : 0.0;
247 }
248 Double_t UpperConfidenceInterval(const Double_t* x, const Double_t* p) const; // Valid if the bandwidth is small compared to nEvents**1/5
249 Double_t LowerConfidenceInterval(const Double_t* x, const Double_t* p) const; // Valid if the bandwidth is small compared to nEvents**1/5
250 Double_t ApproximateBias(const Double_t* x, const Double_t* ) const { return GetBias(*x); }
256 void ComputeDataStats() ;
257
258 UInt_t Index(Double_t x) const;
259
261 void SetBinCountData();
262 void CheckKernelValidity();
264 void SetUserKernelSigma2();
266 void SetKernelSigmas2();
268 void SetUseBins();
269 void SetMirror();
270 void SetMean();
271 void SetSigma(Double_t R);
272 void SetKernel();
273 void SetKernelFunction(KernelFunction_Ptr kernfunc = 0);
274 void SetOptions(const Option_t* option, Double_t rho);
275 void CheckOptions(Bool_t isUserDefinedKernel = kFALSE);
276 void GetOptions(std::string optionType, std::string option);
277 void AssureOptions();
278 void SetData(const Double_t* data, const Double_t * weights);
279 void ReInit();
280 void InitFromNewData();
281 void SetMirroredEvents();
282 void SetDrawOptions(const Option_t* option, TString& plotOpt, TString& drawOpt);
283 void DrawErrors(TString& drawOpt);
284 void DrawConfidenceInterval(TString& drawOpt, double cl=0.95);
285
286 TF1* GetKDEFunction(UInt_t npx = 100, Double_t xMin = 1.0, Double_t xMax = 0.0);
287 TF1* GetKDEApproximateBias(UInt_t npx = 100, Double_t xMin = 1.0, Double_t xMax = 0.0);
288 // The density to estimate should be at least twice differentiable.
289 TF1* GetPDFUpperConfidenceInterval(Double_t confidenceLevel = 0.95, UInt_t npx = 100, Double_t xMin = 1.0, Double_t xMax = 0.0);
290 TF1* GetPDFLowerConfidenceInterval(Double_t confidenceLevel = 0.95, UInt_t npx = 100, Double_t xMin = 1.0, Double_t xMax = 0.0);
291
292 ClassDef(TKDE, 3) // One dimensional semi-parametric Kernel Density Estimation
293
294};
295
296#endif
#define M_PI_2
Definition Math.h:40
#define M_PI_4
Definition Math.h:44
char Char_t
Definition RtypesCore.h:37
unsigned int UInt_t
Definition RtypesCore.h:46
const Bool_t kFALSE
Definition RtypesCore.h:92
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
float xmin
float xmax
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Definition IFunction.h:135
Template class to wrap any C++ callable object which takes one argument i.e.
1-Dim function class
Definition TF1.h:213
A TGraphErrors is a TGraph with error bars.
std::vector< Double_t > fWeights
Definition TKDE.h:160
void ComputeAdaptiveWeights()
Definition TKDE.cxx:778
Double_t GetFixedWeight() const
Definition TKDE.cxx:1002
Double_t GetWeight(Double_t x) const
Definition TKDE.cxx:816
Double_t operator()(Double_t x) const
Definition TKDE.cxx:1012
UInt_t fNWeights
Definition TKDE.h:159
TKDE * fKDE
Definition TKDE.h:158
const std::vector< Double_t > & GetAdaptiveWeights() const
Definition TKDE.cxx:1007
Kernel Density Estimation class.
Definition TKDE.h:34
TF1 * GetPDFUpperConfidenceInterval(Double_t confidenceLevel=0.95, UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
Definition TKDE.cxx:1247
TF1 * GetKDEApproximateBias(UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
Definition TKDE.cxx:1273
void SetData(const Double_t *data, const Double_t *weights)
Definition TKDE.cxx:444
TF1 * fLowerPDF
Output Kernel Density Estimation upper confidence interval PDF function.
Definition TKDE.h:189
virtual ~TKDE()
Definition TKDE.cxx:79
std::vector< Double_t > fKernelSigmas2
Definition TKDE.h:220
Double_t ComputeKernelL2Norm() const
Definition TKDE.cxx:1126
TF1 * fPDF
Definition TKDE.h:187
TF1 * GetPDFLowerConfidenceInterval(Double_t confidenceLevel=0.95, UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
Definition TKDE.cxx:1260
void SetKernelType(EKernelType kern)
Definition TKDE.cxx:311
std::vector< Double_t > fCanonicalBandwidths
Definition TKDE.h:219
void SetKernelFunction(KernelFunction_Ptr kernfunc=0)
Definition TKDE.cxx:627
UInt_t fNEvents
Definition TKDE.h:205
void ComputeDataStats()
Internal funciton to compute statistics (mean,stddev) using always all the provided data (i....
Definition TKDE.cxx:1164
Double_t fXMax
Definition TKDE.h:213
Double_t UpperConfidenceInterval(const Double_t *x, const Double_t *p) const
Definition TKDE.cxx:1065
void ReInit()
Definition TKDE.cxx:480
TF1 * GetDrawnUpperFunction()
Definition TKDE.h:148
Double_t ApproximateBias(const Double_t *x, const Double_t *) const
Definition TKDE.h:250
Double_t ComputeMidspread()
Definition TKDE.cxx:1193
Bool_t fNewData
Definition TKDE.h:201
void SetMirror()
Definition TKDE.cxx:435
Bool_t fUseMirroring
Definition TKDE.h:199
void DrawConfidenceInterval(TString &drawOpt, double cl=0.95)
// Draws the KDE and its confidence interval
Definition TKDE.cxx:967
TF1 * GetDrawnLowerFunction()
Definition TKDE.h:149
void SetMirroredEvents()
Intgernal function to mirror the data.
Definition TKDE.cxx:528
EMirror fMirror
Definition TKDE.h:195
void SetUserCanonicalBandwidth()
Definition TKDE.cxx:1204
Bool_t fMirrorLeft
Definition TKDE.h:199
EIteration fIteration
Definition TKDE.h:194
void CheckKernelValidity()
Definition TKDE.cxx:1102
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.
Definition TKDE.h:107
const Double_t * GetAdaptiveWeights() const
Definition TKDE.cxx:992
Double_t fAdaptiveBandwidthFactor
Definition TKDE.h:215
TF1 * GetDrawnFunction()
Definition TKDE.h:147
Double_t LowerConfidenceInterval(const Double_t *x, const Double_t *p) const
Definition TKDE.cxx:1074
Double_t fSigmaRob
Definition TKDE.h:211
std::vector< Double_t > fBinCount
Definition TKDE.h:222
EBinning fBinning
Definition TKDE.h:196
EIteration
Iteration types. They can be set using SetIteration()
Definition TKDE.h:50
@ kAdaptive
Definition TKDE.h:51
@ kFixed
Definition TKDE.h:52
Double_t GetRAMISE() const
Definition TKDE.cxx:765
void SetIteration(EIteration iter)
Definition TKDE.cxx:323
Double_t ComputeKernelIntegral() const
Definition TKDE.cxx:1153
Double_t CosineArchKernel(Double_t x) const
Definition TKDE.h:244
Double_t fXMin
Definition TKDE.h:212
Double_t operator()(Double_t x) const
Definition TKDE.cxx:743
void SetUserKernelSigma2()
Definition TKDE.cxx:1209
Double_t GetBias(Double_t x) const
Definition TKDE.cxx:1084
std::vector< Double_t > fData
Definition TKDE.h:183
Double_t fSumOfCounts
Definition TKDE.h:206
UInt_t fUseBinsNEvents
Definition TKDE.h:207
void SetKernel()
Definition TKDE.cxx:598
Double_t fSigma
Definition TKDE.h:210
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
Definition TKDE.cxx:942
Double_t GetMean() const
Definition TKDE.cxx:753
Double_t fRho
Definition TKDE.h:214
ROOT::Math::IBaseFunctionOneDim * KernelFunction_Ptr
Definition TKDE.h:178
Bool_t fAsymRight
Definition TKDE.h:199
Double_t fWeightSize
Definition TKDE.h:217
void SetUseBinsNEvents(UInt_t nEvents)
Definition TKDE.cxx:366
std::vector< Double_t > fEvents
Definition TKDE.h:184
Double_t GetError(Double_t x) const
Definition TKDE.cxx:1093
TF1 * GetKDEFunction(UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
Definition TKDE.cxx:1233
void SetBinning(EBinning)
Definition TKDE.cxx:341
void GetOptions(std::string optionType, std::string option)
Definition TKDE.cxx:200
Double_t GetValue(Double_t x) const
Definition TKDE.h:129
Bool_t fAsymLeft
Definition TKDE.h:199
std::vector< Bool_t > fSettedOptions
Definition TKDE.h:224
Double_t GaussianKernel(Double_t x) const
Definition TKDE.h:232
void SetRange(Double_t xMin, Double_t xMax)
Definition TKDE.cxx:382
void SetMean()
Definition TKDE.cxx:587
Double_t ComputeKernelSigma2() const
Definition TKDE.cxx:1135
void SetOptions(const Option_t *option, Double_t rho)
Definition TKDE.cxx:128
void SetUseBins()
Definition TKDE.cxx:396
Double_t GetFixedWeight() const
Definition TKDE.cxx:981
void AssureOptions()
Definition TKDE.cxx:272
TF1 * GetFunction(UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
Definition TKDE.cxx:691
void SetBinCountData()
Definition TKDE.cxx:830
TF1 * GetUpperFunction(Double_t confidenceLevel=0.95, UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
Definition TKDE.cxx:700
void InitFromNewData()
Definition TKDE.cxx:502
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)
Definition TKDE.cxx:93
void SetDrawOptions(const Option_t *option, TString &plotOpt, TString &drawOpt)
Definition TKDE.cxx:154
EMirror
Data "mirroring" option to address the probability "spill out" boundary effect They can be set using ...
Definition TKDE.h:57
@ kMirrorRightAsymLeft
Definition TKDE.h:63
@ kMirrorLeft
Definition TKDE.h:59
@ kMirrorAsymRight
Definition TKDE.h:64
@ kMirrorAsymBoth
Definition TKDE.h:66
@ kNoMirror
Definition TKDE.h:58
@ kMirrorRight
Definition TKDE.h:60
@ kMirrorLeftAsymRight
Definition TKDE.h:65
@ kMirrorBoth
Definition TKDE.h:61
@ kMirrorAsymLeft
Definition TKDE.h:62
TGraphErrors * GetDrawnGraph()
Definition TKDE.h:150
TKDE(TKDE &kde)
TGraphErrors * fGraph
Output Kernel Density Estimation approximate bias.
Definition TKDE.h:191
void SetCanonicalBandwidths()
Definition TKDE.cxx:674
TKDE()
default constructor used only by I/O
Definition TKDE.cxx:63
void SetBinCentreData(Double_t xmin, Double_t xmax)
Definition TKDE.cxx:821
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.
Definition TKDE.h:102
void SetTuneFactor(Double_t rho)
Definition TKDE.cxx:372
void Fill(Double_t data)
Definition TKDE.cxx:715
TF1 * fUpperPDF
Output Kernel Density Estimation PDF function.
Definition TKDE.h:188
Bool_t fMirrorRight
Definition TKDE.h:199
UInt_t fNBins
Definition TKDE.h:204
Double_t ComputeKernelMu() const
Definition TKDE.cxx:1144
EKernelType
Types of Kernel functions They can be set using the function SetKernelType()
Definition TKDE.h:40
@ kGaussian
Definition TKDE.h:41
@ kEpanechnikov
Definition TKDE.h:42
@ kCosineArch
Definition TKDE.h:44
@ kBiweight
Definition TKDE.h:43
@ kTotalKernels
Definition TKDE.h:46
@ kUserDefined
Definition TKDE.h:45
Double_t fMean
Definition TKDE.h:209
void DrawErrors(TString &drawOpt)
Draws a TGraphErrors wih KDE values and errors.
Definition TKDE.cxx:933
void SetNBins(UInt_t nbins)
Definition TKDE.cxx:348
void CheckOptions(Bool_t isUserDefinedKernel=kFALSE)
Definition TKDE.cxx:288
Double_t EpanechnikovKernel(Double_t x) const
Definition TKDE.h:237
Double_t BiweightKernel(Double_t x) const
Definition TKDE.h:240
void SetKernelSigmas2()
Definition TKDE.cxx:683
std::unique_ptr< TKernel > fKernel
! internal kernel class. Transient because it is recreated after reading from a file
Definition TKDE.h:181
Bool_t fUseMinMaxFromData
Definition TKDE.h:202
Double_t GetSigma() const
Definition TKDE.cxx:759
EKernelType fKernelType
Graph with the errors.
Definition TKDE.h:193
TF1 * fApproximateBias
Output Kernel Density Estimation lower confidence interval PDF function.
Definition TKDE.h:190
TKDE operator=(TKDE &kde)
void SetSigma(Double_t R)
Definition TKDE.cxx:592
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.
Definition TKDE.h:89
std::vector< Double_t > fEventWeights
Definition TKDE.h:185
TF1 * GetApproximateBias(UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
Definition TKDE.cxx:710
TF1 * GetLowerFunction(Double_t confidenceLevel=0.95, UInt_t npx=100, Double_t xMin=1.0, Double_t xMax=0.0)
Definition TKDE.cxx:705
Bool_t fUseBins
Definition TKDE.h:200
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.
Definition TKDE.h:95
KernelFunction_Ptr fKernelFunction
! pointer to kernel function
Definition TKDE.h:179
friend struct KernelIntegrand
Definition TKDE.h:227
EBinning
Data binning option.
Definition TKDE.h:71
@ kUnbinned
Definition TKDE.h:72
@ kRelaxedBinning
Definition TKDE.h:73
@ kForcedBinning
Definition TKDE.h:74
void SetHistogram()
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Basic string class.
Definition TString.h:136
Double_t x[n]
Definition legend1.C:17
th1 Draw()