English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Calibration: TMetropHasting.h Source File
Uranie / Calibration v4.9.0
/* @license-end */
TMetropHasting.h
Go to the documentation of this file.
1
2// Copyright (C) 2013-2024 CEA/DES
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Lesser General Public License as published
6// by the Free Software Foundation, either version 3 of the License, or any
7// later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef TMetropHasting_H
18#define TMetropHasting_H
19
20// Uranie
21#include "TCalibration.h"
22
23namespace URANIE
24{
25namespace Calibration
26{
27
29{
30
31public:
32
33 // Attributes
34 vector<double> _values;
35 vector<double> _vstd;
36
37 int _burnin;
38 int _lag;
39 int _nbDump;
40 double _lowAccRange;
41 double _higAccRange;
44
45 //---------------------------------------------
49
56 TMetropHasting(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run, int nS=100, Option_t *option = "lhs");
57
67 TMetropHasting(URANIE::DataServer::TDataServer *tds, void (*fcn)(Double_t*,Double_t*), const char *varexpinput, const char *varexpoutput, int ns = 100, Option_t *option = "");
68
77 TMetropHasting(URANIE::DataServer::TDataServer *tds, const char *fcn, const char *varexpinput, const char *varexpoutput, int ns = 100, Option_t *option = "");
78
85 TMetropHasting(URANIE::DataServer::TDataServer *tds, URANIE::Launcher::TCode *fcode, int ns = 100, Option_t *option = "");
86
88 virtual ~TMetropHasting();
90
91 //---------------------------------------------
95
102 void computeParameters(Option_t *option = "");
103
109
110
111 //---------------------------------------------
115
116 void setBurnin( int burn ){ _burnin = burn; }
117 void setLag( int lag ){ _lag = lag; }
118 void setNbDump( int nbDump ){ _nbDump = nbDump; }
119
120 void setAcceptationRatioRange( double lower, double higher);
121
123 string cut = "";
124 if( _burnin != -1 )
125 cut += string(Form("%s > %d",_tdsPar->getIteratorName(), _burnin));
126 if( _lag != -1 )
127 cut += ((cut=="")? "": " && " ) + string(Form("%s %% %d",_tdsPar->getIteratorName(), _lag));
128
129 if(cut!="")
130 cout<<"TMetropHasting drawing method apply default cut ["<<cut<<"]"<<endl;
131 return cut;
132 }
133
134 void clearDefaultCut(){ setBurnin(-1); setLag(-1); }
135
142 void setInitialisation(int n, double *values, double *standDev);
143
149 void setInitialisation(vector<double> values, vector<double> standDev);
150
164 void setDistanceAndReference(const char *funcName, URANIE::DataServer::TDataServer *tdsRef, const char *input, const char *output, const char *weight="");
165
174 void setDistanceAndReference(URANIE::Calibration::TDistanceFunction *distFunc, URANIE::DataServer::TDataServer *tdsRef, const char *input, const char *output, const char *weight="");
175
177
178 //---------------------------------------------
182
191 void drawTrace(TString sTitre, const char *variable="*", const char *select="1>0", Option_t *option="");
192
201 void drawAcceptationRatio(TString sTitre, const char *variable="*", const char *select="1>0", Option_t *option="");
202
213 void drawParameters(TString sTitre, const char *variable = "*", const char *select = "1>0", Option_t * option = "");
214
221 void getAutoCorrelation(vector<int> l, vector<double> *out, int cut=0);
223
224 //---------------------------------------------
228
229 virtual void printLog(Option_t *option = "");
231
232protected:
233 //---------------------------------------------
237
241 void logPriorPdf(double &ret);
242
244
250 void parseOption(Option_t *option = "");
252
253
254 ClassDef(URANIE::Calibration::TMetropHasting, ID_CALIBRATION)
255 //Classe
256};
257}
258}
259
260
261#endif
Interface of class URANIE::Calibration::TCalibration.
Description of the class TCalibration.
Definition TCalibration.h:64
URANIE::DataServer::TDataServer * _tdsPar
TDS containing parameters properties (parameters that should be calibrated)
Definition TCalibration.h:79
Description of the class TDistanceFunction.
Definition TDistanceFunction.h:68
Definition TMetropHasting.h:29
void setDistanceAndReference(URANIE::Calibration::TDistanceFunction *distFunc, URANIE::DataServer::TDataServer *tdsRef, const char *input, const char *output, const char *weight="")
Set the distance function and some needed informations.
bool _mbGDVersion
Use the Guillaume Damblin.
Definition TMetropHasting.h:42
double _higAccRange
higheracceptation ratio bound to decrease _vstd
Definition TMetropHasting.h:41
TMetropHasting(URANIE::DataServer::TDataServer *tds, const char *fcn, const char *varexpinput, const char *varexpoutput, int ns=100, Option_t *option="")
Default Calibration constructor with the function argument: it contains the assessor to be used.
void clearDefaultCut()
Definition TMetropHasting.h:134
void logPriorPdf(double &ret)
Logarithm of the prior.
virtual ~TMetropHasting()
Default destructor.
int _nbDump
Frequency to which the algo dump a line.
Definition TMetropHasting.h:39
void setDistanceAndReference(const char *funcName, URANIE::DataServer::TDataServer *tdsRef, const char *input, const char *output, const char *weight="")
Set the distance function and some needed informations.
void setInitialisation(int n, double *values, double *standDev)
Initialise the parameters.
void setAcceptationRatioRange(double lower, double higher)
void parseOption(Option_t *option="")
Read the possible options.
void drawParameters(TString sTitre, const char *variable="*", const char *select="1>0", Option_t *option="")
Draws the parameters as distributions The estimateParamters method has computed the parameters,...
void setBurnin(int burn)
Definition TMetropHasting.h:116
int _burnin
The warm-up or burn-in.
Definition TMetropHasting.h:37
void getAutoCorrelation(vector< int > l, vector< double > *out, int cut=0)
Compute the autocorrelation.
void computeParameters(Option_t *option="")
Generate the sample.
bool _bcleaningAtt
Do not store the underlying att.
Definition TMetropHasting.h:43
void setNbDump(int nbDump)
Definition TMetropHasting.h:118
void drawAcceptationRatio(TString sTitre, const char *variable="*", const char *select="1>0", Option_t *option="")
Draws the evolution of acceptation ratio as a function of the iterator.
TMetropHasting(URANIE::DataServer::TDataServer *tds, URANIE::Launcher::TCode *fcode, int ns=100, Option_t *option="")
Default Calibration constructor with the code argument: it contains the assessor to be used.
virtual void printLog(Option_t *option="")
Prints the log.
TMetropHasting(URANIE::DataServer::TDataServer *tds, void(*fcn)(Double_t *, Double_t *), const char *varexpinput, const char *varexpoutput, int ns=100, Option_t *option="")
Default Calibration constructor with the function argument: it contains the assessor to be used.
string getDefaultCut()
Definition TMetropHasting.h:122
TMetropHasting(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run, int nS=100, Option_t *option="lhs")
vector< double > _vstd
Vector of standard deviation.
Definition TMetropHasting.h:35
void setInitialisation(vector< double > values, vector< double > standDev)
Initialise the parameters.
int _lag
The lag value.
Definition TMetropHasting.h:38
void drawTrace(TString sTitre, const char *variable="*", const char *select="1>0", Option_t *option="")
Draws the evolution of parameters as a function of the iterator.
vector< double > _values
Vector of values to be tested.
Definition TMetropHasting.h:34
void setLag(int lag)
Definition TMetropHasting.h:117
double _lowAccRange
loweracceptation ratio bound to increase _vstd
Definition TMetropHasting.h:40
Definition TABC.cxx:46