queso-0.50.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 
92 namespace QUESO {
93 
105 {
106 public:
107 
109 
110 
111 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
112  MhOptionsValues (const SsOptionsValues* alternativeRawSsOptionsValues,
113  const SsOptionsValues* alternativeFilteredSsOptionsValues);
114 #else
115 
117 
118  MhOptionsValues ();
119 #endif
120 
122 
123  MhOptionsValues (const MhOptionsValues& src);
124 
126  ~MhOptionsValues ();
128 
130 
134 
135  std::string m_dataOutputFileName;
137  std::set<unsigned int> m_dataOutputAllowedSet;
138 
144  std::set<unsigned int> m_parameterDisabledSet; // gpmsa2
147  unsigned int m_rawChainSize;
155  std::set<unsigned int> m_rawChainDataOutputAllowedSet;
156 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
157  bool m_rawChainComputeStats;
158 #endif
159 
161  double m_filteredChainDiscardedPortion; // input or set during run time
162  unsigned int m_filteredChainLag; // input or set during run time
166  std::set<unsigned int> m_filteredChainDataOutputAllowedSet;
167 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
168  bool m_filteredChainComputeStats;
169 #endif
170 
175  unsigned int m_drMaxNumExtraStages;
176  std::vector<double> m_drScalesForExtraStages;
180  unsigned int m_amAdaptInterval;
186 
196  double m_amEta;
197 
206  double m_amEpsilon;
207 
209  unsigned int m_BrooksGelmanLag;
210 
211 private:
213  void copy(const MhOptionsValues& src);
214 
215 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
216  friend class MetropolisHastingsSGOptions;
217  SsOptionsValues m_alternativeRawSsOptionsValues;
218  SsOptionsValues m_alternativeFilteredSsOptionsValues;
219 #endif
220 };
221 
237 {
238 public:
240 
241  MetropolisHastingsSGOptions(const BaseEnvironment& env, const char* prefix);
243 
245 
246  MetropolisHastingsSGOptions(const BaseEnvironment& env, const char* prefix, const MhOptionsValues& alternativeOptionsValues);
247 
250 
254 
256 
257  void scanOptionsValues();
259 
261  void print (std::ostream& os) const;
263 
266 
267 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
268  SequenceStatisticalOptions* m_rawChainStatisticalOptionsObj;
269  bool m_rawChainStatOptsInstantiated;
270  SequenceStatisticalOptions* m_filteredChainStatisticalOptionsObj;
271  bool m_filteredChainStatOptsInstantiated;
272 #endif
273  std::string m_prefix;
274 
275 private:
277  void defineMyOptions (po::options_description& optionsDesc) const;
278 
280  void getMyOptionValues(po::options_description& optionsDesc);
281 
283  po::options_description* m_optionsDesc;
284 
285  std::string m_option_help;
286 
290 
291  std::string m_option_totallyMute;
296  std::string m_option_listOfDisabledParameters; // gpmsa2
308 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
309  std::string m_option_rawChain_computeStats;
310 #endif
318 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
319  std::string m_option_filteredChain_computeStats;
320 #endif
336 
338  std::string m_option_am_eta;
340  std::string m_option_am_epsilon;
341 
344 };
345 
346 std::ostream& operator<<(std::ostream& os, const MetropolisHastingsSGOptions& obj);
347 
348 } // End namespace QUESO
349 
350 #endif // UQ_MH_SG_OPTIONS_H
std::set< unsigned int > m_parameterDisabledSet
void scanOptionsValues()
It scans the option values from the options input file.
std::string m_initialProposalCovMatrixDataInputFileName
void print(std::ostream &os) const
It prints the option values.
void defineMyOptions(po::options_description &optionsDesc) const
Defines the options for the Metropolis-Hastings generator of samples as the default options...
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:187
void getMyOptionValues(po::options_description &optionsDesc)
Gets the sequence options defined to the Metropolis-Hastings algorithm.
double m_amEta
Proposal covariance scaling factor, usually 2.4 * 2.4 / d.
std::set< unsigned int > m_rawChainDataOutputAllowedSet
std::string m_option_am_epsilon
See MhOptionsValues::m_amEpsilon.
std::string m_initialProposalCovMatrixDataInputFileType
std::set< unsigned int > m_filteredChainDataOutputAllowedSet
MetropolisHastingsSGOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
std::vector< double > m_drScalesForExtraStages
MhOptionsValues & operator=(const MhOptionsValues &rhs)
Assignment operator; it copies rhs to this.
MhOptionsValues()
Default constructor.
void copy(const MhOptionsValues &src)
Copies the option values from src to this.
This class provides options for each level of the Multilevel sequence generator if no input file is a...
std::set< unsigned int > m_dataOutputAllowedSet
This class provides options for the Metropolis-Hastings generator of samples if no input file is avai...
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
double m_amEpsilon
Regularisation parameter for the DRAM covariance matrix.
MhOptionsValues m_ov
This class is where the actual options are stored.
std::set< unsigned int > m_amAdaptedMatricesDataOutputAllowedSet
std::string m_option_am_eta
See MhOptionsValues::m_amEta.
This class reads the options for the Metropolis-Hastings generator of samples from an input file...

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