English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Sensitivity: URANIE::Sensitivity::THSIC Class Reference
Uranie / Sensitivity v4.9.0
/* @license-end */
URANIE::Sensitivity::THSIC Class Reference

Description of the class THSIC. More...

#include <THSIC.h>

Inheritance diagram for URANIE::Sensitivity::THSIC:
Collaboration diagram for URANIE::Sensitivity::THSIC:

Public Types

enum  EEstimatedVariance { kUnknown , kStdEmpirical , kMedianeDelta }
 
- Public Types inherited from URANIE::Sensitivity::TSensitivity
enum  ELauncher {
  kCode , kCodeRemote , kFunction , kRun ,
  kUnknown
}
 

Public Member Functions

Constructor and Destructor
 THSIC ()
 Default constructor.
 
 THSIC (URANIE::DataServer::TDataServer *tds, const char *sInputs, const char *sOutputs, Option_t *option="")
 THSIC constructor with data contined in the TDS and the inputs and outputs attributes.
 
virtual ~THSIC ()
 Default destructor.
 
Overload Methods
virtual void generateSample (Option_t *option="")
 The generate Sample method.
 
void computeIndexes (Option_t *option="")
 computeIndexes
 
void evaluateIndexes (Option_t *option="")
 evaluateIndexes
 
void drawIndexes (TString sTitle, const char *select="", Option_t *option="")
 Draw the indexes computed by the method.
 
Setting and Getting attributs

EEstimatedVariance getEstimatedVariance ()
 Which method used to estimate the variance of the gaussian kernel ( kUnknown | kStdEmpirical | kMedianeDelta )
 
void setEstimatedVariance (EEstimatedVariance nMethod)
 Set the method used to estimate the variance of the gaussian kernel ( kUnknown | kStdEmpirical | kMedianeDelta )
 
Int_t getNPermutationSample ()
 getNPermutationSample
 
void setNPermutationSample (Int_t ns)
 Set the Permutation sample permutation Size (default NDefaultPermutation)
 
void setThresholdPermutation (Int_t n)
 
Int_t getThresholdPermutation ()
 Get the Threshold (nS/nX) to use the permutation permutation test to cumpute the p-value (default NDefaultThresholdPermutation)
 
void setThresholdGamma (Int_t n)
 Set the Threshold (nS/nX) to use the Gamma approximation to cumpute the p-value (default NDefaultThresholdGamma)
 
Int_t getThresholdGamma ()
 Get the Threshold (nS/nX) to use the Gamma approximation to cumpute the p-value (default NDefaultThresholdGamma)
 
General methods
void generateHMatrix (Option_t *option="")
 generate the $ H $ matrix
 
Double_t computeTrace (TMatrixD mat, TMatrixD crtMatHLH)
 compute the trace of the product $ \frac{1}{nS^2} \, K_{X} \times H \, K_{Y} \, H $ matrix
 
TMatrixDSym doubleCentering (const TMatrixDSym &mat)
 compute the matrix $  H \, K \, H $ matrix
 
TMatrixDSym getMatrixKGaussian (const char *sAtt, Double_t dvariance)
 getMatrixKGaussian
 
Double_t getSumOfMatrixBk (TMatrixD matHLkH, TMatrixD matHLH)
 getSumOfMatrixBk
 
Double_t estimateSigma (const char *sAtt, Option_t *option="")
 estimateSigma
 
Double_t unBiasedHSIC (TMatrixD matKx, TMatrixD matKy)
 Use the unbiased formula to compute $ HSIC(X, Y) $.
 
void permutedPermMatrix (TMatrixDSym &theMatK, TList *tlstIndex, TList *tlstMatrix)
 Create the list of permuted Permutation sample.
 
Parse the option

The options treated by the THSIC object were :

  • "empiri" : Choose the Standard deviation of each attributes to compute the $ \sigma$ parameter
  • "median" : Choose the median distance between points of each attributes to compute the $ \sigma$ parameter
See also
TSensitivity::parseOption()
virtual void parseOption (Option_t *option="")
 Parse the option given by the user.
 
Printing Log
virtual void printLog (Option_t *option="")
 Print the Log.
 
void printSummary (Option_t *option="")
 Print the summary of the HSIC method.
 
- Public Member Functions inherited from URANIE::Sensitivity::TSensitivityTest
 TSensitivityTest ()
 Default constructor.
 
 TSensitivityTest (URANIE::DataServer::TDataServer *tds, const char *varexpinput, const char *varexpoutput, Option_t *option="")
 Default constructor.
 
virtual ~TSensitivityTest ()
 Default destructor.
 
- Public Member Functions inherited from URANIE::Sensitivity::TSensitivity
 TSensitivity ()
 Default constructor.
 
 TSensitivity (URANIE::DataServer::TDataServer *tds, const char *fcn, Int_t ns, const char *varexpinput="", const char *varexpoutput="", Option_t *option="")
 Default constructor with the name of a function.
 
 TSensitivity (URANIE::DataServer::TDataServer *tds, void(*fcn)(Double_t *, Double_t *), const char *varexpinput, const char *varexpoutput, Int_t ns, Option_t *option="")
 
 TSensitivity (URANIE::DataServer::TDataServer *tds, const char *varexpinput, const char *varexpoutput, Option_t *option="")
 Default constructor.
 
 TSensitivity (URANIE::DataServer::TDataServer *tds, URANIE::Launcher::TCode *code, Int_t ns, Option_t *option="")
 Default constructor with TCode arg.
 
 TSensitivity (URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run, Int_t ns, Option_t *option="")
 Default constructor with TRun arg.
 
virtual ~TSensitivity ()
 Default destructor.
 
Int_t getID ()
 
virtual TTree * getResultTuple (bool commonresulttuple=true)
 Get the result ntuple (default parameter unused but for Morris method)
 
double getValue (const char *sorder="", const char *sinputname="", const char *sselect="")
 
vector< int > * getAttributeElements (string str)
 
void setFunction (void(*fct)(Double_t *, Double_t *), Int_t nx=-1, Int_t ny=1)
 
TString getFunctionName ()
 
void setSeed (UInt_t nval)
 
UInt_t getSeed ()
 
virtual void setMethodName (const char *str)
 Set the Method name.
 
const char * getMethodName ()
 Get the method name.
 
Bool_t getNoIntermediateSaved ()
 Get the noIntermediateSaved flag.
 
const char * getIteratorName ()
 Get the name of the iterator attribut of the method.
 
void setSensitivityIteratorName (const char *str)
 Set the iterator name devoted to compute sensitivity indexes.
 
void setTimeName (TString sname)
 Set the name of the time attribute (only one)
 
TString getTimeName ()
 Get the name of the time attribute.
 
virtual void setDrawProgressBar (Bool_t bbool=kTRUE)
 Set the "draw progress bar" flag.
 
void setUsingErrors (bool thebool)
 Set the "using error results anyway" option.
 
Bool_t getDrawProgressBar ()
 Get the clean flag.
 
Bool_t isInputCorrelated ()
 
TMatrixD getMatrixInputCorrelation ()
 
Int_t getNInput ()
 Get the number of input attributes.
 
Int_t getNOutput ()
 Get the number of output attributes.
 
void setInputCorrelationMatrix (TMatrixD Corr)
 
void checkOutputRequested (string attlist, bool fromoption=false)
 Check the output list requested by the user.
 
void computeIndexes (Option_t *option="")
 Compute the Sensitivity Indexes.
 
void fillIndex (const char *sinputname, const char *sorder, Double_t dval, const char *algo="", Double_t dvalCILower=-1.0, Double_t dvalCIUpper=-1.0)
 Method to fill in the tree the value of Sensitivity indexes for an input attribute.
 
virtual void createTuple (Option_t *option="")
 
virtual void setLog ()
 
void unsetLog ()
 
void changeLog ()
 
Bool_t getLog ()
 
void setNLauncher (ELauncher codeLauncher)
 

Private Attributes

Private and Public attributes
EEstimatedVariance _nEstimatedVariance
 < The H matrix defined by H := ( Kronecker(i,j) - 1/nS)
 
Int_t _nPermutationSample
 the method to compute the variance for the gaussian kernel
 
Int_t _nThresholdPermutation
 The number of permutation sample ( permutation ) (default NDefaultPermutation)
 
Int_t _nThresholdGamma
 The Threshold (nS/nX) to use the permutation permutation test to cumpute the p-value (default 5)
 

Additional Inherited Members

- Public Attributes inherited from URANIE::Sensitivity::TSensitivity
URANIE::DataServer::TDataServer * _tds
 Pointeur vers un TDS.
 
TList * _listOfInputAttributes
 List of the input branches.
 
TList * _listOfOutputAttributes
 List of the input branches.
 
TString _sTimeAttribute
 The name of the Time attribute.
 
Int_t _nS
 The number of simulation or other information depend on the used method.
 
Int_t _nX
 Dimension of the input.
 
UInt_t _nY
 Dimension of the target.
 
UInt_t _nElY
 Number of element for one selected output.
 
Int_t _nbOut
 Total number of Output to be considered.
 
Int_t _iOut
 counter for output
 
unsigned int _iy
 iterator over number of element
 
unsigned int _iely
 iterator over number of element
 
ELauncher _nLauncher
 The type of launcher.
 
TString _sFunctionName
 The Name of the evaluatuor.
 
URANIE::Launcher::TCode * _code
 The tcode.
 
URANIE::Relauncher::TRun * _run
 
TObjArray * _drawingGarbageCollector
 Garbage collector for prints.
 
Int_t _nSeed
 The seed of the random generator.
 
Bool_t _bChosenOutputs
 Fact that the input list is provided or not.
 
Bool_t _blog
 Boolean for edit the log.
 
Bool_t _bdrawProgressBar
 Boolean to know if the progress bar has to be drawn.
 
Bool_t _bnoIntermediateSaved
 Boolean to know if the progress bar has to be drawn.
 
TString _sIteratorName
 The specific iterator attribute for the method.
 
TString _sMethodName
 The method name.
 
TString _sSelectedOutput
 The output.
 
TString _sSelectedInput
 The input.
 
map< string, unsigned int > _mAttributeSize
 Map of size of element for attribute;.
 
map< string, vector< int > > _mAttributeElements
 Map of Elements number to run (if vector subselection is requested)
 
vector< string > _vOutputNames
 Name of the output.
 
TCanvas * _canvas
 Canvas object to deal with.
 
void(* _pFunction )(double *, double *)
 
TTree * _ntresult
 The TTree of results.
 
- Protected Member Functions inherited from URANIE::Sensitivity::TSensitivity
void checkCanvasCreation (bool newcan)
 Create a canvas if needed.
 
void drawIndexesHistogram (TString sTitre, const char *select="", Option_t *option="")
 Draws indexes with an histogram.
 
void drawIndexesPie (TString sTitre, const char *select="", Option_t *option="")
 Draws indexes with an pie chart.
 
virtual void preTreatment ()
 PreTreatment for every output.
 
virtual void postTreatment ()
 PostTreatment for every output.
 
void setNoIntermediateSaved (Bool_t bbool=kTRUE)
 Set the "only final file" flag.
 
- Protected Attributes inherited from URANIE::Sensitivity::TSensitivity
Char_t _sOutputAttribute [MAXLENGTHSTRING]
 The name of the output attribute.
 
Char_t _sInputAttribute [MAXLENGTHSTRING]
 The name of the input attribute.
 
Char_t _sOrder [MAXLENGTHSTRING]
 The order of sensitivity indexes.
 
Char_t _sMethod [MAXLENGTHSTRING]
 The name of the method.
 
Char_t _sAlgorithm [MAXLENGTHSTRING]
 The name of the algorithm to compute the index.
 
Double_t _valSobolCrt
 The value of sensitivity indexes.
 
Double_t _valSobolCILower
 The value of lower Condidence Interval (95)
 
Double_t _valSobolCIUpper
 The value of upper Condidence Interval (95)
 
TMatrixD _minputCorr
 Input correlation matrix if sample needs to be correlated.
 
Bool_t _bisInputCorrelated
 State whether the input correlation matrix is set.
 
Bool_t _bgoingThroughError
 State whether the error must not block the computation.
 

Detailed Description

Description of the class THSIC.

Description of the class THSIC.

Introduction

The goal of this class is to find the list of input attributes which are dependent with the output attributes using the "HSIC" values (for "Hilbert-Schmidt Independence Criterion"). This approach was introduced by Gretton (2005, 2007).

Moreover, in the same time, we compute the $ R^{2}_{HSIC} $ proposed by Da Veiga (2015) given by the formula

\[
 R^{2}_{HSIC}  ( X, Y) \; = \; \frac{ HSIC ( X, Y) }{\sqrt{ HSIC ( X, X) \, \times \, HSIC ( Y, Y)}}
\]

Draw Indexes

We use a "Pareto chart" to draw the "p-Values" and the $ R^{2}_{HSIC} $.

Bibliography

  • Da Veiga, S. " Global Sensitivity Analysis with Dependence Measures ", https://arxiv.org/abs/1311.2483, 2013
  • Zhang, Q., Filippi, S., Gretton, A., Sejdinovic, D., "Large-Scale Kernel Methods for Independence Testing", 2016
  • Gretton, A., Fukumizu, K., Teo, C.H., Song, L., Schoelkopf, B., et Smola, A., "A Kernel Statistical Test of Independence,", NIPS 2007
  • Gretton, A., Herbrich, R., Smola, A., Bousquet, O., et Schoelkopf, B., "Kernel Methods for Measuring Independence", Journal of Machine Learning Research, 6 , pp.2075–2129, 2005
  • The Pareto chart, https://en.wikipedia.org/wiki/Pareto_chart

Member Enumeration Documentation

◆ EEstimatedVariance

Enumerator
kUnknown 
kStdEmpirical 
kMedianeDelta 

Constructor & Destructor Documentation

◆ THSIC() [1/2]

URANIE::Sensitivity::THSIC::THSIC ( )

Default constructor.

Referenced by ClassImp().

◆ THSIC() [2/2]

URANIE::Sensitivity::THSIC::THSIC ( URANIE::DataServer::TDataServer *  tds,
const char *  sInputs,
const char *  sOutputs,
Option_t *  option = "" 
)

THSIC constructor with data contined in the TDS and the inputs and outputs attributes.

Parameters
tds
sInputs
sOutputs
option(Option_t *) option to pass [""]

◆ ~THSIC()

virtual URANIE::Sensitivity::THSIC::~THSIC ( )
virtual

Default destructor.

Referenced by ClassImp().

Member Function Documentation

◆ computeIndexes()

void URANIE::Sensitivity::THSIC::computeIndexes ( Option_t *  option = "")

computeIndexes

Parameters
option(Option_t *) option to pass [""]

Referenced by ClassImp().

◆ computeTrace()

Double_t URANIE::Sensitivity::THSIC::computeTrace ( TMatrixD  mat,
TMatrixD  crtMatHLH 
)

compute the trace of the product $ \frac{1}{nS^2} \, K_{X} \times H \, K_{Y} \, H $ matrix

Parameters
mat(TMatrixD) the $ K_{X} $ matrix
crtMatHLH(TMatrixD) the $ H \, K_{Y} \, H $ matrix
Returns
(Double_t) the trace od the product matrix

Referenced by ClassImp().

◆ doubleCentering()

TMatrixDSym URANIE::Sensitivity::THSIC::doubleCentering ( const TMatrixDSym &  mat)

compute the matrix $  H \, K \, H $ matrix

Parameters
mat(TMatrixD) the $ K $ matrix
Returns
(TMatrixD) the $ H \, K \, H $ matrix

Referenced by ClassImp().

◆ drawIndexes()

void URANIE::Sensitivity::THSIC::drawIndexes ( TString  sTitle,
const char *  select = "",
Option_t *  option = "" 
)
virtual

Draw the indexes computed by the method.

Parameters
sTitle(TString) the title of the graph
select(const char*) the select argument
option(Option_t *) option to pass [""]

Reimplemented from URANIE::Sensitivity::TSensitivity.

Referenced by ClassImp().

◆ estimateSigma()

Double_t URANIE::Sensitivity::THSIC::estimateSigma ( const char *  sAtt,
Option_t *  option = "" 
)

estimateSigma

Parameters
sAtt
option(Option_t *) option to pass [""]
Returns

Referenced by ClassImp().

◆ evaluateIndexes()

void URANIE::Sensitivity::THSIC::evaluateIndexes ( Option_t *  option = "")
virtual

evaluateIndexes

Parameters
option(Option_t *) option to pass [""]

Implements URANIE::Sensitivity::TSensitivity.

Referenced by ClassImp().

◆ generateHMatrix()

void URANIE::Sensitivity::THSIC::generateHMatrix ( Option_t *  option = "")

generate the $ H $ matrix

The $ H $ matrix is defined by the formula

\[ H (i, j) \, = \,  1\!\!I_{nS, nS} \: - \: \frac{1}{nS} \: \delta_{i=j} \]

Parameters
option(Option_t *) option to pass [""]

Referenced by ClassImp().

◆ generateSample()

virtual void URANIE::Sensitivity::THSIC::generateSample ( Option_t *  option = "")
virtual

The generate Sample method.

Nothing to do. Only the case where the TDS contains the data

Parameters
option(Option_t *) option to pass [""]

Implements URANIE::Sensitivity::TSensitivity.

Referenced by ClassImp().

◆ getEstimatedVariance()

EEstimatedVariance URANIE::Sensitivity::THSIC::getEstimatedVariance ( )
inline

Which method used to estimate the variance of the gaussian kernel ( kUnknown | kStdEmpirical | kMedianeDelta )

  • kStdEmpirical : the $ \sigma $ parameters is estimated by the emperical standatd deviation of the attributes
  • kMedianeDelta : use the median distance between points
    Returns
    the method used to estimated the variance of the gaussian kernel ( kStdEmpirical | kMedianeDelta )

References _nEstimatedVariance.

◆ getMatrixKGaussian()

TMatrixDSym URANIE::Sensitivity::THSIC::getMatrixKGaussian ( const char *  sAtt,
Double_t  dvariance 
)

getMatrixKGaussian

Parameters
sAtt
dvariance
Returns

Referenced by ClassImp().

◆ getNPermutationSample()

Int_t URANIE::Sensitivity::THSIC::getNPermutationSample ( )
inline

getNPermutationSample

Returns
The number of Permutation sample (permutation zize) to estimate the pValues

References _nPermutationSample.

◆ getSumOfMatrixBk()

Double_t URANIE::Sensitivity::THSIC::getSumOfMatrixBk ( TMatrixD  matHLkH,
TMatrixD  matHLH 
)

getSumOfMatrixBk

Parameters
matHLkH
matHLH
Returns

Referenced by ClassImp().

◆ getThresholdGamma()

Int_t URANIE::Sensitivity::THSIC::getThresholdGamma ( )
inline

Get the Threshold (nS/nX) to use the Gamma approximation to cumpute the p-value (default NDefaultThresholdGamma)

Returns
The current Threshold (nS/nX) for using the Gamma approximation

References _nThresholdGamma.

◆ getThresholdPermutation()

Int_t URANIE::Sensitivity::THSIC::getThresholdPermutation ( )
inline

Get the Threshold (nS/nX) to use the permutation permutation test to cumpute the p-value (default NDefaultThresholdPermutation)

Returns
The current Threshold (nS/nX) for using the permutation permutation test

References _nThresholdPermutation.

◆ parseOption()

virtual void URANIE::Sensitivity::THSIC::parseOption ( Option_t *  option = "")
virtual

Parse the option given by the user.

Parameters
option(Option_t) the string of option

Reimplemented from URANIE::Sensitivity::TSensitivity.

Referenced by ClassImp().

◆ permutedPermMatrix()

void URANIE::Sensitivity::THSIC::permutedPermMatrix ( TMatrixDSym &  theMatK,
TList *  tlstIndex,
TList *  tlstMatrix 
)

Create the list of permuted Permutation sample.

Parameters
theMatK
tlstIndex
tlstMatrix

Referenced by ClassImp().

◆ printLog()

virtual void URANIE::Sensitivity::THSIC::printLog ( Option_t *  option = "")
virtual

Print the Log.

Parameters
option(Option_t *) option to pass [""]

Reimplemented from URANIE::Sensitivity::TSensitivityTest.

Referenced by ClassImp().

◆ printSummary()

void URANIE::Sensitivity::THSIC::printSummary ( Option_t *  option = "")

Print the summary of the HSIC method.

Print just the results of the method NOT THE LOG Just a test to generalize

Parameters
option(Option_t *) option to pass [""]

Referenced by ClassImp().

◆ setEstimatedVariance()

void URANIE::Sensitivity::THSIC::setEstimatedVariance ( EEstimatedVariance  nMethod)

Set the method used to estimate the variance of the gaussian kernel ( kUnknown | kStdEmpirical | kMedianeDelta )

Parameters
nMethod(EEstimatedVariance) One of the ( kStdEmpirical | kMedianeDelta ) choice
Exceptions
UErrorExceptionsfor the case (kUnknown)

Referenced by ClassImp().

◆ setNPermutationSample()

void URANIE::Sensitivity::THSIC::setNPermutationSample ( Int_t  ns)

Set the Permutation sample permutation Size (default NDefaultPermutation)

Parameters
nssize of the permutation permutation size

Referenced by ClassImp().

◆ setThresholdGamma()

void URANIE::Sensitivity::THSIC::setThresholdGamma ( Int_t  n)

Set the Threshold (nS/nX) to use the Gamma approximation to cumpute the p-value (default NDefaultThresholdGamma)

Parameters
n(Int_t) the Threshold (nS/nX) for using the Gamma approximation

Referenced by ClassImp().

◆ setThresholdPermutation()

void URANIE::Sensitivity::THSIC::setThresholdPermutation ( Int_t  n)

Set the Threshold (nS/nX) to use the permutation permutation test to cumpute the p-value (default NDefaultThresholdPermutation)

Referenced by ClassImp().

◆ unBiasedHSIC()

Double_t URANIE::Sensitivity::THSIC::unBiasedHSIC ( TMatrixD  matKx,
TMatrixD  matKy 
)

Use the unbiased formula to compute $ HSIC(X, Y) $.

The unbiased formula can be found in the article of Zhang (2016) (eq. 6 - page 8)

\[ HSIC(X, Y) \, = \, \frac{1}{nS-3} \, \left[ tr(\tilde{K_{X}} \tilde{K_{Y}})  + \frac{1^T \tilde{K_{X}} 1 \times 1^T \tilde{K_{Y}} 1 }{(nS-1)(nS-2)} - \frac{2}{nS-2} 1^T \tilde{K_{X}} \tilde{K_{Y}} 1 \right] \]

where $ \tilde{K_{X}} := K_{X} - diag(K_{X}) $ ( i.e. the kernel matrix with diagonal elements set to zero) and similarly for $ \tilde{K_{Y}} $. $ 1 $ is a vector of 1s of relevant dimension.

Parameters
matKx
matKy
Returns

Referenced by ClassImp().

Member Data Documentation

◆ _nEstimatedVariance

EEstimatedVariance URANIE::Sensitivity::THSIC::_nEstimatedVariance
private

< The H matrix defined by H := ( Kronecker(i,j) - 1/nS)

Referenced by ClassImp(), and getEstimatedVariance().

◆ _nPermutationSample

Int_t URANIE::Sensitivity::THSIC::_nPermutationSample
private

the method to compute the variance for the gaussian kernel

Referenced by ClassImp(), and getNPermutationSample().

◆ _nThresholdGamma

Int_t URANIE::Sensitivity::THSIC::_nThresholdGamma
private

The Threshold (nS/nX) to use the permutation permutation test to cumpute the p-value (default 5)

Referenced by ClassImp(), and getThresholdGamma().

◆ _nThresholdPermutation

Int_t URANIE::Sensitivity::THSIC::_nThresholdPermutation
private

The number of permutation sample ( permutation ) (default NDefaultPermutation)

Referenced by ClassImp(), and getThresholdPermutation().