queso-0.51.1
MetropolisHastingsSGOptions.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_MH_SG_OPTIONS_H
26 #define UQ_MH_SG_OPTIONS_H
27 
28 #include <queso/Environment.h>
29 #include <queso/MLSamplingLevelOptions.h>
30 #include <queso/SequenceStatisticalOptions.h>
31 
32 #undef UQ_MH_SG_REQUIRES_INVERTED_COV_MATRICES
33 #define UQ_NOTHING_JUST_FOR_TEST_OF_SVN_ID 1
34 
35 #define UQ_MH_SG_FILENAME_FOR_NO_FILE "."
36 
37 // _ODV = option default value
38 #define UQ_MH_SG_DATA_OUTPUT_FILE_NAME_ODV UQ_MH_SG_FILENAME_FOR_NO_FILE
39 #define UQ_MH_SG_DATA_OUTPUT_ALLOW_ALL_ODV 0
40 #define UQ_MH_SG_DATA_OUTPUT_ALLOWED_SET_ODV ""
41 
42 #define UQ_MH_SG_TOTALLY_MUTE_ODV 0
43 #define UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV UQ_MH_SG_FILENAME_FOR_NO_FILE
44 #define UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
45 #define UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV UQ_MH_SG_FILENAME_FOR_NO_FILE
46 #define UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
47 #define UQ_MH_SG_LIST_OF_DISABLED_PARAMETERS_ODV ""
48 #define UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV UQ_MH_SG_FILENAME_FOR_NO_FILE
49 #define UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
50 #define UQ_MH_SG_RAW_CHAIN_SIZE_ODV 100
51 #define UQ_MH_SG_RAW_CHAIN_GENERATE_EXTRA_ODV 0
52 #define UQ_MH_SG_RAW_CHAIN_DISPLAY_PERIOD_ODV 500
53 #define UQ_MH_SG_RAW_CHAIN_MEASURE_RUN_TIMES_ODV 1
54 #define UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV 0
55 #define UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV UQ_MH_SG_FILENAME_FOR_NO_FILE
56 #define UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
57 #define UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV 0
58 #define UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV ""
59 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
60 #define UQ_MH_SG_RAW_CHAIN_COMPUTE_STATS_ODV 0
61 #endif
62 #define UQ_MH_SG_FILTERED_CHAIN_GENERATE_ODV 0
63 #define UQ_MH_SG_FILTERED_CHAIN_DISCARDED_PORTION_ODV 0.
64 #define UQ_MH_SG_FILTERED_CHAIN_LAG_ODV 1
65 #define UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV UQ_MH_SG_FILENAME_FOR_NO_FILE
66 #define UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
67 #define UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV 0
68 #define UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV ""
69 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
70 #define UQ_MH_SG_FILTERED_CHAIN_COMPUTE_STATS_ODV 0
71 #endif
72 #define UQ_MH_SG_DISPLAY_CANDIDATES_ODV 0
73 #define UQ_MH_SG_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV 1
74 #define UQ_MH_SG_TK_USE_LOCAL_HESSIAN_ODV 0
75 #define UQ_MH_SG_TK_USE_NEWTON_COMPONENT_ODV 1
76 #define UQ_MH_SG_DR_MAX_NUM_EXTRA_STAGES_ODV 0
77 #define UQ_MH_SG_DR_LIST_OF_SCALES_FOR_EXTRA_STAGES_ODV ""
78 #define UQ_MH_SG_DR_DURING_AM_NON_ADAPTIVE_INT_ODV 1
79 #define UQ_MH_SG_AM_KEEP_INITIAL_MATRIX_ODV 0
80 #define UQ_MH_SG_AM_INIT_NON_ADAPT_INT_ODV 0
81 #define UQ_MH_SG_AM_ADAPT_INTERVAL_ODV 0
82 #define UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV 0
83 #define UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV UQ_MH_SG_FILENAME_FOR_NO_FILE
84 #define UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
85 #define UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV 0
86 #define UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOWED_SET_ODV ""
87 #define UQ_MH_SG_AM_ETA_ODV 1.
88 #define UQ_MH_SG_AM_EPSILON_ODV 1.e-5
89 #define UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR 0
90 #define UQ_MH_SG_BROOKS_GELMAN_LAG 100
91 #define UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD 1
92 #define UQ_MH_SG_OUTPUT_LOG_TARGET 1
93 #define UQ_MH_SG_DO_LOGIT_TRANSFORM 1
94 
95 namespace QUESO {
96 
111 {
112 public:
113 
115 
116 
117 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
118  MhOptionsValues (const SsOptionsValues* alternativeRawSsOptionsValues,
119  const SsOptionsValues* alternativeFilteredSsOptionsValues);
120 #else
121 
123 
124  MhOptionsValues ();
125 #endif
126 
128 
129  MhOptionsValues (const MhOptionsValues& src);
130 
132  ~MhOptionsValues ();
134 
136 
140 
141  std::string m_dataOutputFileName;
143  std::set<unsigned int> m_dataOutputAllowedSet;
144 
150  std::set<unsigned int> m_parameterDisabledSet; // gpmsa2
153  unsigned int m_rawChainSize;
161  std::set<unsigned int> m_rawChainDataOutputAllowedSet;
162 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
163  bool m_rawChainComputeStats;
164 #endif
165 
167  double m_filteredChainDiscardedPortion; // input or set during run time
168  unsigned int m_filteredChainLag; // input or set during run time
172  std::set<unsigned int> m_filteredChainDataOutputAllowedSet;
173 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
174  bool m_filteredChainComputeStats;
175 #endif
176 
181  unsigned int m_drMaxNumExtraStages;
182  std::vector<double> m_drScalesForExtraStages;
186  unsigned int m_amAdaptInterval;
192 
202  double m_amEta;
203 
212  double m_amEpsilon;
213 
215  unsigned int m_BrooksGelmanLag;
216 
219 
222 
225 
226 private:
228  void copy(const MhOptionsValues& src);
229 
230 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
231  friend class MetropolisHastingsSGOptions;
232  SsOptionsValues m_alternativeRawSsOptionsValues;
233  SsOptionsValues m_alternativeFilteredSsOptionsValues;
234 #endif
235 };
236 
252 {
253 public:
255 
256  MetropolisHastingsSGOptions(const BaseEnvironment& env, const char* prefix);
258 
260 
261  MetropolisHastingsSGOptions(const BaseEnvironment& env, const char* prefix, const MhOptionsValues& alternativeOptionsValues);
262 
265 
269 
271 
272  void scanOptionsValues();
274 
276  void print (std::ostream& os) const;
278 
281 
282 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
283  SequenceStatisticalOptions* m_rawChainStatisticalOptionsObj;
284  bool m_rawChainStatOptsInstantiated;
285  SequenceStatisticalOptions* m_filteredChainStatisticalOptionsObj;
286  bool m_filteredChainStatOptsInstantiated;
287 #endif
288  std::string m_prefix;
289 
290 private:
292  void defineMyOptions (po::options_description& optionsDesc) const;
293 
295  void getMyOptionValues(po::options_description& optionsDesc);
296 
298  po::options_description* m_optionsDesc;
299 
300  std::string m_option_help;
301 
305 
306  std::string m_option_totallyMute;
311  std::string m_option_listOfDisabledParameters; // gpmsa2
323 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
324  std::string m_option_rawChain_computeStats;
325 #endif
333 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
334  std::string m_option_filteredChain_computeStats;
335 #endif
351 
353  std::string m_option_am_eta;
355  std::string m_option_am_epsilon;
356 
359 
363 };
364 
365 std::ostream& operator<<(std::ostream& os, const MetropolisHastingsSGOptions& obj);
366 
367 } // End namespace QUESO
368 
369 #endif // UQ_MH_SG_OPTIONS_H
std::string m_option_am_eta
See MhOptionsValues::m_amEta.
MhOptionsValues & operator=(const MhOptionsValues &rhs)
Assignment operator; it copies rhs to this.
void defineMyOptions(po::options_description &optionsDesc) const
Defines the options for the Metropolis-Hastings generator of samples as the default options...
This class reads the options for the Metropolis-Hastings generator of samples from an input file...
bool m_doLogitTransform
Flag for deciding whether or not to do logit transform of bounded domains.
MhOptionsValues()
Default constructor.
void getMyOptionValues(po::options_description &optionsDesc)
Gets the sequence options defined to the Metropolis-Hastings algorithm.
bool m_outputLogTarget
Flag for deciding whether or not to dump log target values in output.
std::set< unsigned int > m_dataOutputAllowedSet
double m_amEta
Proposal covariance scaling factor, usually 2.4 * 2.4 / d.
std::set< unsigned int > m_filteredChainDataOutputAllowedSet
void scanOptionsValues()
It scans the option values from the options input file.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:187
void print(std::ostream &os) const
It prints the option values.
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
double m_amEpsilon
Regularisation parameter for the DRAM covariance matrix.
MetropolisHastingsSGOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
void copy(const MhOptionsValues &src)
Copies the option values from src to this.
std::string m_option_am_epsilon
See MhOptionsValues::m_amEpsilon.
std::vector< double > m_drScalesForExtraStages
std::set< unsigned int > m_parameterDisabledSet
bool m_outputLogLikelihood
Flag for deciding whether or not to dump log likelihood values in output.
std::set< unsigned int > m_amAdaptedMatricesDataOutputAllowedSet
std::string m_initialProposalCovMatrixDataInputFileName
std::set< unsigned int > m_rawChainDataOutputAllowedSet
std::string m_initialProposalCovMatrixDataInputFileType
This class provides options for the Metropolis-Hastings generator of samples if no input file is avai...
MhOptionsValues m_ov
This class is where the actual options are stored.
This class provides options for each level of the Multilevel sequence generator if no input file is a...

Generated on Thu Apr 23 2015 19:26:15 for queso-0.51.1 by  doxygen 1.8.5