Logo ROOT  
Reference Guide
KDEKernel.h
Go to the documentation of this file.
1// @(#)root/tmva $Id$
2// Author: Asen Christov
3
4/**********************************************************************************
5 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6 * Package: TMVA *
7 * Class : KDEKernel *
8 * Web : http://tmva.sourceforge.net *
9 * *
10 * Description: *
11 * The Probability Density Functions (PDFs) used for the Likelihood analysis *
12 * can suffer from low statistics of the training samples. This can cause *
13 * the PDFs to fluctuate instead to be smooth. Nonparamatric Kernel Density *
14 * Estimation is one of the methods to produce "smooth" PDFs. *
15 * *
16 * Authors (alphabetical): *
17 * Asen Christov <christov@physik.uni-freiburg.de> - Freiburg U., Germany *
18 * *
19 * Copyright (c) 2007: *
20 * CERN, Switzerland *
21 * MPI-K Heidelberg, Germany *
22 * Freiburg U., Germany *
23 * *
24 * Redistribution and use in source and binary forms, with or without *
25 * modification, are permitted according to the terms listed in LICENSE *
26 * (http://tmva.sourceforge.net/LICENSE) *
27 **********************************************************************************/
28
29#ifndef ROOT_TMVA_KDEKernel
30#define ROOT_TMVA_KDEKernel
31
32//////////////////////////////////////////////////////////////////////////
33// //
34// KDEKernel //
35// //
36// KDE Kernel for "smoothing" the PDFs //
37// //
38//////////////////////////////////////////////////////////////////////////
39
40#include "Rtypes.h"
41
42class TH1;
43class TH1F;
44class TF1;
45
46namespace TMVA {
47
48 class MsgLogger;
49
50 class KDEKernel {
51
52 public:
53
54 enum EKernelType { kNone = 0, kGauss = 1 };
57
58 public:
59
60 KDEKernel( EKernelIter kiter = kNonadaptiveKDE, const TH1* hist = 0, Float_t lower_edge=0., Float_t upper_edge=1., EKernelBorder kborder = kNoTreatment, Float_t FineFactor = 1.);
61
62 virtual ~KDEKernel( void );
63
64 // calculates the integral of the Kernel function in the given bin.
65 Float_t GetBinKernelIntegral(Float_t lowr, Float_t highr, Float_t mean, Int_t binnum);
66
67 // sets the type of Kernel to be used (Default 1 mean Gaussian)
68 void SetKernelType( EKernelType ktype = kGauss );
69
70 // modified name (remove TMVA::)
71 const char* GetName() const { return "KDEKernel"; }
72
73 private:
74
75 Float_t fSigma; // Width of the Kernel function
76 EKernelIter fIter; // iteration number
77 Float_t fLowerEdge; // the lower edge of the PDF
78 Float_t fUpperEdge; // the upper edge of the PDF
79 Float_t fFineFactor; // fine tuning factor for Adaptive KDE: factor to multiply the "width" of the Kernel function
80 TF1 *fKernel_integ; // the integral of the Kernel function
81 EKernelBorder fKDEborder; // The method to take care about "border" effects
82 TH1F *fHist; // copy of input histogram
83 TH1F *fFirstIterHist; // histogram to be filled in the hidden iteration
84 TH1F *fSigmaHist; // contains the Sigmas Widths for adaptive KDE
85 Bool_t fHiddenIteration; // Defines if whats currently running is the
86 // (first) hidden iteration when doing adaptive KDE
87
88 mutable MsgLogger* fLogger; // message logger
89 MsgLogger& Log() const { return *fLogger; }
90
91 ClassDef(KDEKernel,0); // Kernel density estimator for PDF smoothing
92
93 };// namespace TMVA
94}
95#endif // KDEKernel_H
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
float Float_t
Definition: RtypesCore.h:53
#define ClassDef(name, id)
Definition: Rtypes.h:326
1-Dim function class
Definition: TF1.h:211
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:571
The TH1 histogram class.
Definition: TH1.h:56
KDE Kernel for "smoothing" the PDFs.
Definition: KDEKernel.h:50
KDEKernel(EKernelIter kiter=kNonadaptiveKDE, const TH1 *hist=0, Float_t lower_edge=0., Float_t upper_edge=1., EKernelBorder kborder=kNoTreatment, Float_t FineFactor=1.)
constructor sanity check
Definition: KDEKernel.cxx:49
TH1F * fHist
Definition: KDEKernel.h:82
virtual ~KDEKernel(void)
destructor
Definition: KDEKernel.cxx:76
TH1F * fSigmaHist
Definition: KDEKernel.h:84
TH1F * fFirstIterHist
Definition: KDEKernel.h:83
EKernelIter fIter
Definition: KDEKernel.h:76
Float_t fFineFactor
Definition: KDEKernel.h:79
EKernelBorder fKDEborder
Definition: KDEKernel.h:81
Float_t fSigma
Definition: KDEKernel.h:75
MsgLogger * fLogger
Definition: KDEKernel.h:88
const char * GetName() const
Definition: KDEKernel.h:71
void SetKernelType(EKernelType ktype=kGauss)
fIter == 1 —> nonadaptive KDE fIter == 2 —> adaptive KDE
Definition: KDEKernel.cxx:112
Float_t fUpperEdge
Definition: KDEKernel.h:78
MsgLogger & Log() const
Definition: KDEKernel.h:89
TF1 * fKernel_integ
Definition: KDEKernel.h:80
Bool_t fHiddenIteration
Definition: KDEKernel.h:85
Float_t fLowerEdge
Definition: KDEKernel.h:77
Float_t GetBinKernelIntegral(Float_t lowr, Float_t highr, Float_t mean, Int_t binnum)
calculates the integral of the Kernel
Definition: KDEKernel.cxx:217
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
create variable transformations