Logo ROOT   6.10/09
Reference Guide
LDA.h
Go to the documentation of this file.
1 // $Id$
2 /**********************************************************************************
3  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
4  * Package: TMVA *
5  * Class : LDA *
6  * Web : http://tmva.sourceforge.net *
7  * *
8  * Description: *
9  * Local LDA method used by MethodKNN to compute MVA value. *
10  * This is experimental code under development. This class computes *
11  * parameters of signal and background PDFs using Gaussian approximation. *
12  * *
13  * Author: *
14  * John Alison John.Alison@cern.ch - University of Pennsylvania, USA *
15  * *
16  * Copyright (c) 2007: *
17  * CERN, Switzerland *
18  * MPI-K Heidelberg, Germany *
19  * University of Pennsylvania, USA *
20  * *
21  * Redistribution and use in source and binary forms, with or without *
22  * modification, are permitted according to the terms listed in LICENSE *
23  * (http://tmva.sourceforge.net/LICENSE) *
24  **********************************************************************************/
25 
26 #ifndef ROOT_TMVA_LDA
27 #define ROOT_TMVA_LDA
28 
29 
30 // C/C++
31 #include <map>
32 #include <vector>
33 
34 // ROOT
35 #include "Rtypes.h"
36 #include "TMatrixFfwd.h"
37 
38 typedef std::vector<std::vector<Float_t> > LDAEvents;
39 
40 namespace TMVA {
41 
42  class MsgLogger;
43 
44  class LDA {
45 
46  public:
47 
48  LDA(Float_t tolerence = 1.0e-5, Bool_t debug = false);
49  ~LDA();
50 
51  // Signal probability with Gaussian approximation
52  Float_t GetProb(const std::vector<Float_t>& x, Int_t k);
53 
54  // Log likelihood function with Gaussian approximation
55  Float_t GetLogLikelihood(const std::vector<Float_t>& x, Int_t k);
56 
57  // Create LDA matrix using local events found by knn method
58  void Initialize(const LDAEvents& inputSignal, const LDAEvents& inputBackground);
59 
60  private:
61 
62  // Probability value using Gaussian approximation
63  Float_t FSub(const std::vector<Float_t>& x, Int_t k);
64 
65  MsgLogger& Log() const { return *fLogger; }
66 
67  private:
68 
69  // data members
70  Float_t fTolerence; // documentation!
71  UInt_t fNumParams; // documentation!
72  std::map<Int_t, std::vector<Float_t> > fMu; // documentation!
73  TMatrixF* fSigma; // documentation!
74  TMatrixF* fSigmaInverse; // documentation!
75  std::map<Int_t, Float_t> fEventFraction; // documentation!
76  Bool_t fDebug; // documentation!
77 
78  mutable MsgLogger *fLogger; // message logging service
79  };
80 }
81 #endif
LDA(Float_t tolerence=1.0e-5, Bool_t debug=false)
constructor
Definition: LDA.cxx:47
Float_t FSub(const std::vector< Float_t > &x, Int_t k)
Probability value using Gaussian approximation.
Definition: LDA.cxx:211
TMatrixF * fSigmaInverse
Definition: LDA.h:74
Definition: LDA.h:44
~LDA()
destructor
Definition: LDA.cxx:60
float Float_t
Definition: RtypesCore.h:53
MsgLogger * fLogger
Definition: LDA.h:78
std::map< Int_t, std::vector< Float_t > > fMu
Definition: LDA.h:72
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Float_t fTolerence
Definition: LDA.h:70
TMatrixT.
Definition: TMatrixDfwd.h:22
Double_t x[n]
Definition: legend1.C:17
Float_t GetProb(const std::vector< Float_t > &x, Int_t k)
Signal probability with Gaussian approximation.
Definition: LDA.cxx:239
std::map< Int_t, Float_t > fEventFraction
Definition: LDA.h:75
Float_t GetLogLikelihood(const std::vector< Float_t > &x, Int_t k)
Log likelihood function with Gaussian approximation.
Definition: LDA.cxx:252
unsigned int UInt_t
Definition: RtypesCore.h:42
UInt_t fNumParams
Definition: LDA.h:71
void Initialize(const LDAEvents &inputSignal, const LDAEvents &inputBackground)
Create LDA matrix using local events found by knn method.
Definition: LDA.cxx:68
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
MsgLogger & Log() const
Definition: LDA.h:65
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
Bool_t fDebug
Definition: LDA.h:76
Abstract ClassifierFactory template that handles arbitrary types.
std::vector< std::vector< Float_t > > LDAEvents
Definition: LDA.h:38
bool debug
TMatrixF * fSigma
Definition: LDA.h:73