queso-0.50.1
MLSamplingLevelOptions.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_MULTI_LEVEL_SAMPLING_LEVEL_OPTIONS_H
26 #define UQ_MULTI_LEVEL_SAMPLING_LEVEL_OPTIONS_H
27 
28 #define LEVEL_REF_ID 0
29 
30 #include <queso/Environment.h>
31 #include <queso/SequenceStatisticalOptions.h>
32 #define UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE "."
33 
34 // _ODV = option default value
35 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
36 #else
37 #define UQ_ML_SAMPLING_L_CHECKPOINT_OUTPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
38 #endif
39 #define UQ_ML_SAMPLING_L_STOP_AT_END_ODV 0
40 #define UQ_ML_SAMPLING_L_DATA_OUTPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
41 #define UQ_ML_SAMPLING_L_DATA_OUTPUT_ALLOW_ALL_ODV 0
42 #define UQ_ML_SAMPLING_L_DATA_OUTPUT_ALLOWED_SET_ODV ""
43 #define UQ_ML_SAMPLING_L_LOAD_BALANCE_ALGORITHM_ID_ODV 2
44 #define UQ_ML_SAMPLING_L_LOAD_BALANCE_TRESHOLD_ODV 1.
45 #define UQ_ML_SAMPLING_L_MIN_EFFECTIVE_SIZE_RATIO_ODV 0.85
46 #define UQ_ML_SAMPLING_L_MAX_EFFECTIVE_SIZE_RATIO_ODV 0.91
47 #define UQ_ML_SAMPLING_L_SCALE_COV_MATRIX_ODV 1
48 #define UQ_ML_SAMPLING_L_MIN_REJECTION_RATE_ODV 0.50
49 #define UQ_ML_SAMPLING_L_MAX_REJECTION_RATE_ODV 0.75
50 #define UQ_ML_SAMPLING_L_COV_REJECTION_RATE_ODV 0.25
51 #define UQ_ML_SAMPLING_L_MIN_ACCEPTABLE_ETA_ODV 0.
52 #define UQ_ML_SAMPLING_L_TOTALLY_MUTE_ODV 1
53 #define UQ_ML_SAMPLING_L_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
54 #define UQ_ML_SAMPLING_L_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
55 #define UQ_ML_SAMPLING_L_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
56 #define UQ_ML_SAMPLING_L_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
57 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
58 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
59 #define UQ_ML_SAMPLING_L_LIST_OF_DISABLED_PARAMETERS_ODV ""
60 #define UQ_ML_SAMPLING_L_INITIAL_VALUES_OF_DISABLED_PARAMETERS_ODV ""
61 #define UQ_ML_SAMPLING_L_RAW_CHAIN_SIZE_ODV 100
62 #define UQ_ML_SAMPLING_L_RAW_CHAIN_GENERATE_EXTRA_ODV 0
63 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DISPLAY_PERIOD_ODV 500
64 #define UQ_ML_SAMPLING_L_RAW_CHAIN_MEASURE_RUN_TIMES_ODV 1
65 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV 0
66 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
67 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
68 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV 0
69 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV ""
70 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
71 #define UQ_ML_SAMPLING_L_RAW_CHAIN_COMPUTE_STATS_ODV 0
72 #endif
73 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_GENERATE_ODV 0
74 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DISCARDED_PORTION_ODV 0.
75 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_LAG_ODV 1
76 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
77 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
78 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV 0
79 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV ""
80 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
81 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_COMPUTE_STATS_ODV 0
82 #endif
83 #define UQ_ML_SAMPLING_L_DISPLAY_CANDIDATES_ODV 0
84 #define UQ_ML_SAMPLING_L_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV 1
85 #define UQ_ML_SAMPLING_L_TK_USE_LOCAL_HESSIAN_ODV 0
86 #define UQ_ML_SAMPLING_L_TK_USE_NEWTON_COMPONENT_ODV 1
87 #define UQ_ML_SAMPLING_L_DR_MAX_NUM_EXTRA_STAGES_ODV 0
88 #define UQ_ML_SAMPLING_L_DR_LIST_OF_SCALES_FOR_EXTRA_STAGES_ODV "1."
89 #define UQ_ML_SAMPLING_L_DR_DURING_AM_NON_ADAPTIVE_INT_ODV 1
90 #define UQ_ML_SAMPLING_L_AM_KEEP_INITIAL_MATRIX_ODV 0
91 #define UQ_ML_SAMPLING_L_AM_INIT_NON_ADAPT_INT_ODV 0
92 #define UQ_ML_SAMPLING_L_AM_ADAPT_INTERVAL_ODV 0
93 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV 0
94 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
95 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
96 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV 0
97 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOWED_SET_ODV ""
98 #define UQ_ML_SAMPLING_L_AM_ETA_ODV 1.
99 #define UQ_ML_SAMPLING_L_AM_EPSILON_ODV 1.e-5
100 
101 namespace QUESO {
102 
114 {
115 public:
117 
118  MLSamplingLevelOptions(const BaseEnvironment& env, const char* prefix);
120 
121  //MLSamplingLevelOptions(const MLSamplingLevelOptions& inputOptions);
122 
126 
128 
129  const BaseEnvironment& env() const;
131 
132  //void changePrefix (const char* prefix);
134 
136 
137  void scanOptionsValues(const MLSamplingLevelOptions* defaultOptions);
139 
141  void print (std::ostream& os) const;
143  std::string m_prefix;
144 
145 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
146 #else
147  std::string m_checkpointOutputFileName;
149 #endif
150  bool m_stopAtEnd;
152 
154  std::string m_dataOutputFileName;
155 
158 
160  std::set<unsigned int> m_dataOutputAllowedSet;
161 
163  std::string m_str1;
164 
167 
170 
173 
176 
179 
182 
185 
188 
190 
191  double m_minAcceptableEta; // gpmsa1
192 
195 
198 
201 
204 
207 
208 
209  std::set<unsigned int> m_parameterDisabledSet; // gpmsa2
210  std::string m_str2; // gpmsa2
211  std::vector<double> m_initialValuesOfDisabledParameters; // gpmsa2
212  std::string m_str3; // gpmsa2
213 
216 
217 
220 
222  unsigned int m_rawChainSize;
223 
226 
229 
232 
235 
238 
241 
244 
246  std::set<unsigned int> m_rawChainDataOutputAllowedSet;
247 
248  std::string m_str4;
249 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
250  bool m_rawChainComputeStats;
252  SequenceStatisticalOptions* m_rawChainStatisticalOptionsObj;
253  bool m_rawChainStatOptsInstantiated;
254 #endif
257 
259  double m_filteredChainDiscardedPortion; // input or set during run time
260 
262  unsigned int m_filteredChainLag; // input or set during run time
263 
266 
269 
272 
274  std::set<unsigned int> m_filteredChainDataOutputAllowedSet;
275  std::string m_str5;
276 
277 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
278  bool m_filteredChainComputeStats;
280  SequenceStatisticalOptions* m_filteredChainStatisticalOptionsObj;
281  bool m_filteredChainStatOptsInstantiated;
282 #endif
283  bool m_displayCandidates;
285 
288 
291 
294 
296  unsigned int m_drMaxNumExtraStages;
297 
299  std::vector<double> m_drScalesForExtraStages;
300  std::string m_str6;
301 
304 
307 
310 
312  unsigned int m_amAdaptInterval;
313 
316 
319 
322 
325 
328 
329 
330  std::string m_str7;
331 
333  double m_amEta;
334 
336  double m_amEpsilon;
337 
338 private:
340  void copyOptionsValues(const MLSamplingLevelOptions& srcOptions);
341 
343  void defineMyOptions (po::options_description& optionsDesc) const;
344 
346  void getMyOptionValues(po::options_description& optionsDesc);
347 
349  po::options_description* m_optionsDesc;
350 
351  std::string m_option_help;
352 
353 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
354 #else
356 #endif
357  std::string m_option_stopAtEnd;
369  std::string m_option_minAcceptableEta; // gpmsa1
370  std::string m_option_totallyMute;
375  std::string m_option_listOfDisabledParameters; // gpmsa2
388 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
389  std::string m_option_rawChain_computeStats;
390 #endif
391 
399 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
400  std::string m_option_filteredChain_computeStats;
401 #endif
402 
418  std::string m_option_am_eta;
419  std::string m_option_am_epsilon;
420 };
421 
422 std::ostream& operator<<(std::ostream& os, const MLSamplingLevelOptions& obj);
423 
424 } // End namespace QUESO
425 
426 #endif // UQ_MULTI_LEVEL_SAMPLING_LEVEL_OPTIONS_H
bool m_scaleCovMatrix
Whether or not scale proposal covariance matrix.
std::string m_rawChainDataOutputFileType
Type of output file for raw chain.
std::string m_amAdaptedMatricesDataOutputFileName
Name of output file for &#39;am&#39; adapted matrices.
std::string m_initialProposalCovMatrixDataInputFileType
Type of input file for initial proposal covariance matrix.
bool m_filteredChainGenerate
Whether or not to generate filtered chain.
void scanOptionsValues(const MLSamplingLevelOptions *defaultOptions)
It scans the option values from the options input file.
std::string m_option_am_adaptedMatrices_dataOutputFileType
void copyOptionsValues(const MLSamplingLevelOptions &srcOptions)
Copies the option values from srcOptions to this.
std::string m_option_initialProposalCovMatrix_dataInputFileType
unsigned int m_amAdaptInterval
&#39;am&#39; adaptation interval.
std::vector< double > m_initialValuesOfDisabledParameters
bool m_putOutOfBoundsInChain
Put &#39;out of bound&#39; candidates in chain as well.
unsigned int m_rawChainSize
Size of raw chain.
bool m_amAdaptedMatricesDataOutputAllowAll
Whether or not subEnvs will write to output file for &#39;am&#39; adapted matrices.
double m_filteredChainDiscardedPortion
Initial discarded portion for chain filtering.
double m_covRejectionRate
c.o.v. for judging attempted rejection rate at current level.
std::string m_amAdaptedMatricesDataOutputFileType
Type of output file for &#39;am&#39; adapted matrices.
const BaseEnvironment & env() const
Access to the environment.
unsigned int m_amInitialNonAdaptInterval
&#39;am&#39; initial non adaptation interval
unsigned int m_filteredChainLag
Spacing for chain filtering.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:187
double m_minRejectionRate
minimum allowed attempted rejection rate at current level
bool m_dataOutputAllowAll
subEnvs that will write to generic output file.
std::string m_option_am_adaptedMatrices_dataOutputAllowedSet
bool m_tkUseLocalHessian
Whether or not &#39;proposal&#39; uses local Hessian.
std::string m_checkpointOutputFileName
Name of checkpoint output file.
double m_minEffectiveSizeRatio
Minimum allowed effective size ratio wrt previous level.
unsigned int m_drMaxNumExtraStages
&#39;dr&#39; maximum number of extra stages.
std::string m_dataOutputFileName
Name of generic output file.
unsigned int m_rawChainDataOutputPeriod
Period of message display during raw chain generation.
po::options_description * m_optionsDesc
std::string m_rawChainDataInputFileType
Type of input file for raw chain.
std::set< unsigned int > m_filteredChainDataOutputAllowedSet
subEnvs that will write to output file for filtered chain.
std::set< unsigned int > m_rawChainDataOutputAllowedSet
subEnvs that will write to output file for raw chain.
std::set< unsigned int > m_parameterDisabledSet
bool m_stopAtEnd
Stop at end of such level.
std::string m_option_am_adaptedMatrices_dataOutputFileName
std::string m_option_initialProposalCovMatrix_dataInputFileName
std::set< unsigned int > m_amAdaptedMatricesDataOutputAllowedSet
subEnvs that will write to output file for &#39;am&#39; adapted matrices.
unsigned int m_rawChainDisplayPeriod
Period of message display during raw chain generation.
std::string m_filteredChainDataOutputFileType
Type of output file for filtered chain.
double m_minAcceptableEta
minimum acceptable eta,
unsigned int m_amAdaptedMatricesDataOutputPeriod
Period for outputing &#39;am&#39; adapted matrices.
std::vector< double > m_drScalesForExtraStages
&#39;dr&#39; list of scales for proposal covariance matrices from 2nd stage on.
std::string m_initialPositionDataInputFileName
Name of input file for initial position.
void print(std::ostream &os) const
It prints the option values.
std::string m_initialPositionDataInputFileType
Type of input file for initial position.
unsigned int m_loadBalanceAlgorithmId
Perform load balancing with chosen algorithm (0 = no balancing).
bool m_amKeepInitialMatrix
Whether or not &#39;am&#39; will keep initial (given) matrix.
bool m_tkUseNewtonComponent
Whether or not &#39;proposal&#39; uses Newton component.
bool m_rawChainMeasureRunTimes
Whether or not to measure run times.
std::string m_option_am_adaptedMatrices_dataOutputAllowAll
bool m_displayCandidates
Display candidates generated in the core MH algorithm.
void getMyOptionValues(po::options_description &optionsDesc)
Gets the sequence options defined to the Multilevel algorithm.
double m_maxRejectionRate
maximum allowed attempted rejection rate at current level.
double m_maxEffectiveSizeRatio
Maximum allowed effective size ratio wrt previous level.
This class provides options for each level of the Multilevel sequence generator if no input file is a...
bool m_drDuringAmNonAdaptiveInt
Whether or not &#39;dr&#39; is used during &#39;am&#39; non adaptive interval.
double m_loadBalanceTreshold
Perform load balancing if load unbalancing ratio &gt; threshold.
void defineMyOptions(po::options_description &optionsDesc) const
Defines the options for the Multilevel generator of samples as the default options.
bool m_totallyMute
Whether or not to be totally mute (no printout message).
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
std::string m_initialProposalCovMatrixDataInputFileName
Name of input file for initial proposal covariance matrix.
bool m_filteredChainDataOutputAllowAll
Whether or not subEnvs will write to output file for filtered chain.
MLSamplingLevelOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
std::string m_rawChainDataInputFileName
Name of input file for raw chain.
std::string m_rawChainDataOutputFileName
Name of output file for raw chain.
bool m_rawChainDataOutputAllowAll
Whether or not subEnvs will write to output file for raw chain.
double m_amEta
&#39;am&#39; eta.
double m_amEpsilon
&#39;am&#39; epsilon.
bool m_rawChainGenerateExtra
Generate extra information about raw chain.
std::string m_filteredChainDataOutputFileName
Name of output file for filtered chain.
std::set< unsigned int > m_dataOutputAllowedSet
subEnvs that will write to generic output file.
std::string m_str1
subEnvs that will write to generic output file.

Generated on Thu Apr 23 2015 19:18:34 for queso-0.50.1 by  doxygen 1.8.5