queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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-2017 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 
33 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
34 #include <queso/BoostInputOptionsParser.h>
35 #else
36 #include <queso/getpot.h>
37 #endif
38 
39 #define UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE "."
40 
41 // _ODV = option default value
42 #define UQ_ML_SAMPLING_L_HELP ""
43 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
44 #else
45 #define UQ_ML_SAMPLING_L_CHECKPOINT_OUTPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
46 #endif
47 #define UQ_ML_SAMPLING_L_STOP_AT_END_ODV 0
48 #define UQ_ML_SAMPLING_L_DATA_OUTPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
49 #define UQ_ML_SAMPLING_L_DATA_OUTPUT_ALLOW_ALL_ODV 0
50 #define UQ_ML_SAMPLING_L_DATA_OUTPUT_ALLOWED_SET_ODV ""
51 #define UQ_ML_SAMPLING_L_LOAD_BALANCE_ALGORITHM_ID_ODV 2
52 #define UQ_ML_SAMPLING_L_LOAD_BALANCE_TRESHOLD_ODV 1.
53 #define UQ_ML_SAMPLING_L_MIN_EFFECTIVE_SIZE_RATIO_ODV 0.85
54 #define UQ_ML_SAMPLING_L_MAX_EFFECTIVE_SIZE_RATIO_ODV 0.91
55 #define UQ_ML_SAMPLING_L_SCALE_COV_MATRIX_ODV 1
56 #define UQ_ML_SAMPLING_L_MIN_REJECTION_RATE_ODV 0.50
57 #define UQ_ML_SAMPLING_L_MAX_REJECTION_RATE_ODV 0.75
58 #define UQ_ML_SAMPLING_L_COV_REJECTION_RATE_ODV 0.25
59 #define UQ_ML_SAMPLING_L_MIN_ACCEPTABLE_ETA_ODV 0.
60 #define UQ_ML_SAMPLING_L_TOTALLY_MUTE_ODV 1
61 #define UQ_ML_SAMPLING_L_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
62 #define UQ_ML_SAMPLING_L_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
63 #define UQ_ML_SAMPLING_L_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
64 #define UQ_ML_SAMPLING_L_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
65 #define UQ_ML_SAMPLING_L_INITIAL_POSITION_USE_PREVIOUS_LEVEL_LIKELIHOOD_ODV 0
66 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
67 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
68 #define UQ_ML_SAMPLING_L_LIST_OF_DISABLED_PARAMETERS_ODV ""
69 #define UQ_ML_SAMPLING_L_INITIAL_VALUES_OF_DISABLED_PARAMETERS_ODV ""
70 #define UQ_ML_SAMPLING_L_RAW_CHAIN_SIZE_ODV 100
71 #define UQ_ML_SAMPLING_L_RAW_CHAIN_GENERATE_EXTRA_ODV 0
72 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DISPLAY_PERIOD_ODV 500
73 #define UQ_ML_SAMPLING_L_RAW_CHAIN_MEASURE_RUN_TIMES_ODV 1
74 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV 0
75 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
76 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
77 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV 0
78 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV ""
79 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
80 #define UQ_ML_SAMPLING_L_RAW_CHAIN_COMPUTE_STATS_ODV 0
81 #endif
82 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_GENERATE_ODV 0
83 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DISCARDED_PORTION_ODV 0.
84 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_LAG_ODV 1
85 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
86 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
87 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV 0
88 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV ""
89 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
90 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_COMPUTE_STATS_ODV 0
91 #endif
92 #define UQ_ML_SAMPLING_L_DISPLAY_CANDIDATES_ODV 0
93 #define UQ_ML_SAMPLING_L_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV 1
94 #define UQ_ML_SAMPLING_L_TK_USE_LOCAL_HESSIAN_ODV 0
95 #define UQ_ML_SAMPLING_L_TK_USE_NEWTON_COMPONENT_ODV 1
96 #define UQ_ML_SAMPLING_L_DR_MAX_NUM_EXTRA_STAGES_ODV 0
97 #define UQ_ML_SAMPLING_L_DR_LIST_OF_SCALES_FOR_EXTRA_STAGES_ODV "1."
98 #define UQ_ML_SAMPLING_L_DR_DURING_AM_NON_ADAPTIVE_INT_ODV 1
99 #define UQ_ML_SAMPLING_L_AM_KEEP_INITIAL_MATRIX_ODV 0
100 #define UQ_ML_SAMPLING_L_AM_INIT_NON_ADAPT_INT_ODV 0
101 #define UQ_ML_SAMPLING_L_AM_ADAPT_INTERVAL_ODV 0
102 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV 0
103 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE
104 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
105 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV 0
106 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOWED_SET_ODV ""
107 #define UQ_ML_SAMPLING_L_AM_ETA_ODV 1.
108 #define UQ_ML_SAMPLING_L_AM_EPSILON_ODV 1.e-5
109 #define UQ_ML_SAMPLING_L_DO_LOGIT_TRANSFORM 0
110 #define UQ_ML_SAMPLING_L_ALGORITHM "random_walk"
111 #define UQ_ML_SAMPLING_L_TK "random_walk"
112 #define UQ_ML_SAMPLING_L_UPDATE_INTERVAL 1
113 
114 namespace QUESO {
115 
127 {
128 public:
130 
131  MLSamplingLevelOptions(const BaseEnvironment& env, const char* prefix);
133 
134  //MLSamplingLevelOptions(const MLSamplingLevelOptions& inputOptions);
135 
137  virtual ~MLSamplingLevelOptions();
139 
141 
142  const BaseEnvironment& env() const;
144 
145  //void changePrefix (const char* prefix);
147 
149 
150  void scanOptionsValues(const MLSamplingLevelOptions* defaultOptions);
153 
154  void print (std::ostream& os) const;
156  std::string m_prefix;
157 
159  std::string m_help;
160 
161 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
162 #else
163  std::string m_checkpointOutputFileName;
165 #endif
166  bool m_stopAtEnd;
168 
170  std::string m_dataOutputFileName;
171 
174 
176  std::set<unsigned int> m_dataOutputAllowedSet;
177 
179  std::string m_str1;
180 
183 
186 
189 
192 
195 
198 
201 
204 
206 
207  double m_minAcceptableEta; // gpmsa1
208 
211 
214 
217 
220 
223 
225  bool m_initialPositionUsePreviousLevelLikelihood; // ml_likelihood_caching
226 
227 
228  std::set<unsigned int> m_parameterDisabledSet; // gpmsa2
229  std::string m_str2; // gpmsa2
230  std::vector<double> m_initialValuesOfDisabledParameters; // gpmsa2
231  std::string m_str3; // gpmsa2
232 
235 
236 
239 
241  unsigned int m_rawChainSize;
242 
245 
248 
251 
254 
257 
259 
263 
266 
268  std::set<unsigned int> m_rawChainDataOutputAllowedSet;
269 
270  std::string m_str4;
271 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
276 #endif
279 
281  double m_filteredChainDiscardedPortion; // input or set during run time
282 
284  unsigned int m_filteredChainLag; // input or set during run time
285 
288 
291 
294 
296  std::set<unsigned int> m_filteredChainDataOutputAllowedSet;
297  std::string m_str5;
298 
299 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
304 #endif
305  bool m_displayCandidates;
307 
310 
313 
316 
318  unsigned int m_drMaxNumExtraStages;
319 
321  std::vector<double> m_drScalesForExtraStages;
322  std::string m_str6;
323 
326 
329 
332 
334  unsigned int m_amAdaptInterval;
335 
338 
341 
344 
347 
350 
351 
352  std::string m_str7;
353 
355  double m_amEta;
356 
358  double m_amEpsilon;
359 
362 
364  std::string m_algorithm;
365 
367  std::string m_tk;
368 
370  unsigned int m_updateInterval;
371 
372 private:
374  void copyOptionsValues(const MLSamplingLevelOptions& srcOptions);
375  void getAllOptions();
376  void defineAllOptions();
377 
379 
380 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
382 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
383 
384  std::string m_option_help;
385 
386 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
387 #else
389 #endif
390  std::string m_option_stopAtEnd;
402  std::string m_option_minAcceptableEta; // gpmsa1
403  std::string m_option_totallyMute;
408  std::string m_option_initialPositionUsePreviousLevelLikelihood; // ml_likelihood_caching
409  std::string m_option_listOfDisabledParameters; // gpmsa2
419 
422 
425 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
427 #endif
428 
436 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
438 #endif
439 
455  std::string m_option_am_eta;
456  std::string m_option_am_epsilon;
458  std::string m_option_algorithm;
459  std::string m_option_tk;
461 
462  void checkOptions(const BaseEnvironment * env);
463 
464  friend std::ostream & operator<<(std::ostream & os,
465  const MLSamplingLevelOptions & obj);
466 };
467 
468 
469 } // End namespace QUESO
470 
471 #endif // UQ_MULTI_LEVEL_SAMPLING_LEVEL_OPTIONS_H
unsigned int m_rawChainDataOutputPeriod
Period of message display during raw chain generation.
SequenceStatisticalOptions * m_filteredChainStatisticalOptionsObj
std::string m_amAdaptedMatricesDataOutputFileName
Name of output file for &#39;am&#39; adapted matrices.
bool m_rawChainComputeStats
Compute statistics on raw chain.
void checkOptions(const BaseEnvironment *env)
bool m_filteredChainGenerate
Whether or not to generate filtered chain.
unsigned int m_drMaxNumExtraStages
&#39;dr&#39; maximum number of extra stages.
bool m_rawChainDataOutputAllowAll
Whether or not subEnvs will write to output file for raw chain.
std::string m_algorithm
Which algorithm to use for sampling.
double m_minAcceptableEta
minimum acceptable eta,
std::set< unsigned int > m_amAdaptedMatricesDataOutputAllowedSet
subEnvs that will write to output file for &#39;am&#39; adapted matrices.
std::string m_option_initialPositionUsePreviousLevelLikelihood
bool m_totallyMute
Whether or not to be totally mute (no printout message).
std::string m_option_initialProposalCovMatrix_dataInputFileName
std::vector< double > m_initialValuesOfDisabledParameters
std::string m_rawChainDataInputFileName
Name of input file for raw chain.
bool m_displayCandidates
Display candidates generated in the core MH algorithm.
bool m_amAdaptedMatricesDataOutputAllowAll
Whether or not subEnvs will write to output file for &#39;am&#39; adapted matrices.
std::string m_str1
subEnvs that will write to generic output file.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:198
A templated class that stores statistical options (optionally read from an input file) ...
std::string m_initialPositionDataInputFileName
Name of input file for initial position.
std::string m_initialProposalCovMatrixDataInputFileName
Name of input file for initial proposal covariance matrix.
void scanOptionsValues(const MLSamplingLevelOptions *defaultOptions)
unsigned int m_loadBalanceAlgorithmId
Perform load balancing with chosen algorithm (0 = no balancing).
bool m_scaleCovMatrix
Whether or not scale proposal covariance matrix.
unsigned int m_rawChainSize
Size of raw chain.
double m_maxEffectiveSizeRatio
Maximum allowed effective size ratio wrt previous level.
std::string m_rawChainDataOutputFileType
Type of output file for raw chain.
double m_amEta
&#39;am&#39; eta.
bool m_rawChainGenerateExtra
Generate extra information about raw chain.
std::string m_initialPositionDataInputFileType
Type of input file for initial position.
bool m_doLogitTransform
Whether or not a logit transform will be done for bounded domains.
std::string m_option_am_adaptedMatrices_dataOutputFileType
std::string m_option_initialProposalCovMatrix_dataInputFileType
std::string m_option_am_adaptedMatrices_dataOutputAllowedSet
double m_minEffectiveSizeRatio
Minimum allowed effective size ratio wrt previous level.
bool m_putOutOfBoundsInChain
Put &#39;out of bound&#39; candidates in chain as well.
unsigned int m_amInitialNonAdaptInterval
&#39;am&#39; initial non adaptation interval
double m_minRejectionRate
minimum allowed attempted rejection rate at current level
std::string m_option_am_adaptedMatrices_dataOutputFileName
unsigned int m_filteredChainLag
Spacing for chain filtering.
unsigned int m_amAdaptInterval
&#39;am&#39; adaptation interval.
void copyOptionsValues(const MLSamplingLevelOptions &srcOptions)
Copies the option values from srcOptions to this.
std::string m_option_rawChain_dataOutputFileType
Option name for MLSamplingLevelOptions::m_rawChainDataOutputFileType. Option name is m_prefix + &quot;ml_r...
std::string m_filteredChainDataOutputFileName
Name of output file for filtered chain.
void print(std::ostream &os) const
std::string m_rawChainDataOutputFileName
Name of output file for raw chain.
std::string m_tk
Which transition kernel to use for sampling.
double m_maxRejectionRate
maximum allowed attempted rejection rate at current level.
double m_loadBalanceTreshold
Perform load balancing if load unbalancing ratio &gt; threshold.
std::set< unsigned int > m_dataOutputAllowedSet
subEnvs that will write to generic output file.
std::string m_dataOutputFileName
Name of generic output file.
unsigned int m_updateInterval
How often to call the TK&#39;s updateTK method.
unsigned int m_rawChainDisplayPeriod
Period of message display during raw chain generation.
BoostInputOptionsParser * m_parser
bool m_stopAtEnd
Stop at end of such level.
bool m_dataOutputAllowAll
subEnvs that will write to generic output file.
bool m_tkUseNewtonComponent
Whether or not &#39;proposal&#39; uses Newton component.
SequenceStatisticalOptions * m_rawChainStatisticalOptionsObj
const BaseEnvironment & env() const
Access to the environment.
This class provides options for each level of the Multilevel sequence generator if no input file is a...
std::string m_initialProposalCovMatrixDataInputFileType
Type of input file for initial proposal covariance matrix.
std::string m_option_am_adaptedMatrices_dataOutputAllowAll
bool m_filteredChainComputeStats
Compute statistics on filtered chain.
bool m_tkUseLocalHessian
Whether or not &#39;proposal&#39; uses local Hessian.
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.
MLSamplingLevelOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
bool m_filteredChainDataOutputAllowAll
Whether or not subEnvs 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::string m_rawChainDataInputFileType
Type of input file for raw chain.
std::string m_checkpointOutputFileName
Name of checkpoint output file.
bool m_drDuringAmNonAdaptiveInt
Whether or not &#39;dr&#39; is used during &#39;am&#39; non adaptive interval.
bool m_amKeepInitialMatrix
Whether or not &#39;am&#39; will keep initial (given) matrix.
std::string m_help
If non-empty string, print options and values to output file.
virtual ~MLSamplingLevelOptions()
Destructor.
double m_filteredChainDiscardedPortion
Initial discarded portion for chain filtering.
std::vector< double > m_drScalesForExtraStages
&#39;dr&#39; list of scales for proposal covariance matrices from 2nd stage on.
std::set< unsigned int > m_parameterDisabledSet
std::set< unsigned int > m_filteredChainDataOutputAllowedSet
subEnvs that will write to output file for filtered chain.
std::string m_filteredChainDataOutputFileType
Type of output file for filtered chain.
double m_amEpsilon
&#39;am&#39; epsilon.
bool m_initialPositionUsePreviousLevelLikelihood
Use previous level likelihood for initial chain position instead of re-computing it from target pdf...
friend std::ostream & operator<<(std::ostream &os, const MLSamplingLevelOptions &obj)
bool m_rawChainMeasureRunTimes
Whether or not to measure run times.
unsigned int m_amAdaptedMatricesDataOutputPeriod
Period for outputing &#39;am&#39; adapted matrices.

Generated on Tue Jun 5 2018 19:48:55 for queso-0.57.1 by  doxygen 1.8.5