Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 * *
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 * (see tmva/doc/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 "RtypesCore.h"
36#include "TMatrixFfwd.h"
37
38typedef std::vector<std::vector<Float_t> > LDAEvents;
39
40namespace 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
std::vector< std::vector< Float_t > > LDAEvents
Definition LDA.h:38
float Float_t
Definition RtypesCore.h:57
MsgLogger * fLogger
message logging service
Definition LDA.h:78
std::map< Int_t, Float_t > fEventFraction
documentation!
Definition LDA.h:75
Float_t fTolerence
documentation!
Definition LDA.h:70
std::map< Int_t, std::vector< Float_t > > fMu
documentation!
Definition LDA.h:72
UInt_t fNumParams
documentation!
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:66
Float_t GetLogLikelihood(const std::vector< Float_t > &x, Int_t k)
Log likelihood function with Gaussian approximation.
Definition LDA.cxx:250
Bool_t fDebug
documentation!
Definition LDA.h:76
~LDA()
destructor
Definition LDA.cxx:58
Float_t GetProb(const std::vector< Float_t > &x, Int_t k)
Signal probability with Gaussian approximation.
Definition LDA.cxx:237
TMatrixF * fSigma
documentation!
Definition LDA.h:73
MsgLogger & Log() const
Definition LDA.h:65
Float_t FSub(const std::vector< Float_t > &x, Int_t k)
Probability value using Gaussian approximation.
Definition LDA.cxx:209
TMatrixF * fSigmaInverse
documentation!
Definition LDA.h:74
ostringstream derivative to redirect and format output
Definition MsgLogger.h:57
TMatrixT.
Definition TMatrixT.h:39
Double_t x[n]
Definition legend1.C:17
create variable transformations