queso-0.56.1
MetropolisHastingsSGOptions.C
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-2015 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 DISABLE_BOOST_PROGRAM_OPTIONS
26 #include <boost/program_options.hpp>
27 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
28 
29 #include <queso/Environment.h>
30 #include <queso/MetropolisHastingsSGOptions.h>
31 #include <queso/Miscellaneous.h>
32 
33 // -------------------------------------------------
34 // MhOptionsValues --------------------------
35 // -------------------------------------------------
36 
37 namespace QUESO {
38 
39 // Default constructor -----------------------------
41 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
42  const SsOptionsValues* alternativeRawSsOptionsValues,
43  const SsOptionsValues* alternativeFilteredSsOptionsValues
44 #endif
45  )
46  :
47  m_prefix ("mh_"),
48  m_help(UQ_MH_SG_HELP),
49  m_dataOutputFileName (UQ_MH_SG_DATA_OUTPUT_FILE_NAME_ODV),
50  m_dataOutputAllowAll (UQ_MH_SG_DATA_OUTPUT_ALLOW_ALL_ODV),
51  //m_dataOutputAllowedSet (),
52  m_totallyMute (UQ_MH_SG_TOTALLY_MUTE_ODV),
53  m_initialPositionDataInputFileName (UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV),
54  m_initialPositionDataInputFileType (UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV),
55  m_initialProposalCovMatrixDataInputFileName(UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV),
56  m_initialProposalCovMatrixDataInputFileType(UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV),
57  //m_parameterDisabledSet (),
58  m_rawChainDataInputFileName (UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV),
59  m_rawChainDataInputFileType (UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV),
60  m_rawChainSize (UQ_MH_SG_RAW_CHAIN_SIZE_ODV),
61  m_rawChainGenerateExtra (UQ_MH_SG_RAW_CHAIN_GENERATE_EXTRA_ODV),
62  m_rawChainDisplayPeriod (UQ_MH_SG_RAW_CHAIN_DISPLAY_PERIOD_ODV),
63  m_rawChainMeasureRunTimes (UQ_MH_SG_RAW_CHAIN_MEASURE_RUN_TIMES_ODV),
64  m_rawChainDataOutputPeriod (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV),
65  m_rawChainDataOutputFileName (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV),
66  m_rawChainDataOutputFileType (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV),
67  m_rawChainDataOutputAllowAll (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV),
68  //m_rawChainDataOutputAllowedSet (),
69 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
70  m_rawChainComputeStats (UQ_MH_SG_RAW_CHAIN_COMPUTE_STATS_ODV),
71 #endif
72  m_filteredChainGenerate (UQ_MH_SG_FILTERED_CHAIN_GENERATE_ODV),
73  m_filteredChainDiscardedPortion (UQ_MH_SG_FILTERED_CHAIN_DISCARDED_PORTION_ODV),
74  m_filteredChainLag (UQ_MH_SG_FILTERED_CHAIN_LAG_ODV),
75  m_filteredChainDataOutputFileName (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV),
76  m_filteredChainDataOutputFileType (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV),
77  m_filteredChainDataOutputAllowAll (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV),
78  //m_filteredChainDataOutputAllowedSet (),
79 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
80  m_filteredChainComputeStats (UQ_MH_SG_FILTERED_CHAIN_COMPUTE_STATS_ODV),
81 #endif
82  m_displayCandidates (UQ_MH_SG_DISPLAY_CANDIDATES_ODV),
83  m_putOutOfBoundsInChain (UQ_MH_SG_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV),
84  m_tkUseLocalHessian (UQ_MH_SG_TK_USE_LOCAL_HESSIAN_ODV),
85  m_tkUseNewtonComponent (UQ_MH_SG_TK_USE_NEWTON_COMPONENT_ODV),
86  m_drMaxNumExtraStages (UQ_MH_SG_DR_MAX_NUM_EXTRA_STAGES_ODV),
87  m_drScalesForExtraStages (0),
88  m_drDuringAmNonAdaptiveInt (UQ_MH_SG_DR_DURING_AM_NON_ADAPTIVE_INT_ODV),
89  m_amKeepInitialMatrix (UQ_MH_SG_AM_KEEP_INITIAL_MATRIX_ODV),
90  m_amInitialNonAdaptInterval (UQ_MH_SG_AM_INIT_NON_ADAPT_INT_ODV),
91  m_amAdaptInterval (UQ_MH_SG_AM_ADAPT_INTERVAL_ODV),
92  m_amAdaptedMatricesDataOutputPeriod (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV),
93  m_amAdaptedMatricesDataOutputFileName (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV),
94  m_amAdaptedMatricesDataOutputFileType (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV),
95  m_amAdaptedMatricesDataOutputAllowAll (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV),
96  //m_amAdaptedMatricesDataOutputAllowedSet (),
97  m_amEta (UQ_MH_SG_AM_ETA_ODV),
98  m_amEpsilon (UQ_MH_SG_AM_EPSILON_ODV),
99  m_enableBrooksGelmanConvMonitor (UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR),
100  m_BrooksGelmanLag (UQ_MH_SG_BROOKS_GELMAN_LAG),
101  m_outputLogLikelihood (UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD),
102  m_outputLogTarget (UQ_MH_SG_OUTPUT_LOG_TARGET),
103  m_doLogitTransform (UQ_MH_SG_DO_LOGIT_TRANSFORM),
104  m_algorithm (UQ_MH_SG_ALGORITHM),
105  m_tk (UQ_MH_SG_TK),
106 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
107  m_alternativeRawSsOptionsValues (),
108  m_alternativeFilteredSsOptionsValues (),
109 #endif
110  m_env(NULL),
111 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
112  m_parser(NULL),
113 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
114  m_option_help (m_prefix + "help" ),
115  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
116  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
117  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
118  m_option_totallyMute (m_prefix + "totallyMute" ),
119  m_option_initialPosition_dataInputFileName (m_prefix + "initialPosition_dataInputFileName" ),
120  m_option_initialPosition_dataInputFileType (m_prefix + "initialPosition_dataInputFileType" ),
121  m_option_initialProposalCovMatrix_dataInputFileName(m_prefix + "initialProposalCovMatrix_dataInputFileName"),
122  m_option_initialProposalCovMatrix_dataInputFileType(m_prefix + "initialProposalCovMatrix_dataInputFileType"),
123  m_option_listOfDisabledParameters (m_prefix + "listOfDisabledParameters" ),
124  m_option_rawChain_dataInputFileName (m_prefix + "rawChain_dataInputFileName" ),
125  m_option_rawChain_dataInputFileType (m_prefix + "rawChain_dataInputFileType" ),
126  m_option_rawChain_size (m_prefix + "rawChain_size" ),
127  m_option_rawChain_generateExtra (m_prefix + "rawChain_generateExtra" ),
128  m_option_rawChain_displayPeriod (m_prefix + "rawChain_displayPeriod" ),
129  m_option_rawChain_measureRunTimes (m_prefix + "rawChain_measureRunTimes" ),
130  m_option_rawChain_dataOutputPeriod (m_prefix + "rawChain_dataOutputPeriod" ),
131  m_option_rawChain_dataOutputFileName (m_prefix + "rawChain_dataOutputFileName" ),
132  m_option_rawChain_dataOutputFileType (m_prefix + "rawChain_dataOutputFileType" ),
133  m_option_rawChain_dataOutputAllowAll (m_prefix + "rawChain_dataOutputAllowAll" ),
134  m_option_rawChain_dataOutputAllowedSet (m_prefix + "rawChain_dataOutputAllowedSet" ),
135 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
136  m_option_rawChain_computeStats (m_prefix + "rawChain_computeStats" ),
137 #endif
138  m_option_filteredChain_generate (m_prefix + "filteredChain_generate" ),
139  m_option_filteredChain_discardedPortion (m_prefix + "filteredChain_discardedPortion" ),
140  m_option_filteredChain_lag (m_prefix + "filteredChain_lag" ),
141  m_option_filteredChain_dataOutputFileName (m_prefix + "filteredChain_dataOutputFileName" ),
142  m_option_filteredChain_dataOutputFileType (m_prefix + "filteredChain_dataOutputFileType" ),
143  m_option_filteredChain_dataOutputAllowAll (m_prefix + "filteredChain_dataOutputAllowAll" ),
144  m_option_filteredChain_dataOutputAllowedSet (m_prefix + "filteredChain_dataOutputAllowedSet" ),
145 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
146  m_option_filteredChain_computeStats (m_prefix + "filteredChain_computeStats" ),
147 #endif
148  m_option_displayCandidates (m_prefix + "displayCandidates" ),
149  m_option_putOutOfBoundsInChain (m_prefix + "putOutOfBoundsInChain" ),
150  m_option_tk_useLocalHessian (m_prefix + "tk_useLocalHessian" ),
151  m_option_tk_useNewtonComponent (m_prefix + "tk_useNewtonComponent" ),
152  m_option_dr_maxNumExtraStages (m_prefix + "dr_maxNumExtraStages" ),
153  m_option_dr_listOfScalesForExtraStages (m_prefix + "dr_listOfScalesForExtraStages" ),
154  m_option_dr_duringAmNonAdaptiveInt (m_prefix + "dr_duringAmNonAdaptiveInt" ),
155  m_option_am_keepInitialMatrix (m_prefix + "am_keepInitialMatrix" ),
156  m_option_am_initialNonAdaptInterval (m_prefix + "am_initialNonAdaptInterval" ),
157  m_option_am_adaptInterval (m_prefix + "am_adaptInterval" ),
158  m_option_am_adaptedMatrices_dataOutputPeriod (m_prefix + "am_adaptedMatrices_dataOutputPeriod" ),
159  m_option_am_adaptedMatrices_dataOutputFileName (m_prefix + "am_adaptedMatrices_dataOutputFileName" ),
160  m_option_am_adaptedMatrices_dataOutputFileType (m_prefix + "am_adaptedMatrices_dataOutputFileType" ),
161  m_option_am_adaptedMatrices_dataOutputAllowAll (m_prefix + "am_adaptedMatrices_dataOutputAllowAll" ),
162  m_option_am_adaptedMatrices_dataOutputAllowedSet (m_prefix + "am_adaptedMatrices_dataOutputAllowedSet" ),
163  m_option_am_eta (m_prefix + "am_eta" ),
164  m_option_am_epsilon (m_prefix + "am_epsilon" ),
165  m_option_enableBrooksGelmanConvMonitor (m_prefix + "enableBrooksGelmanConvMonitor" ),
166  m_option_BrooksGelmanLag (m_prefix + "BrooksGelmanLag" ),
167  m_option_outputLogLikelihood (m_prefix + "outputLogLikelihood" ),
168  m_option_outputLogTarget (m_prefix + "outputLogTarget" ),
169  m_option_doLogitTransform (m_prefix + "doLogitTransform" ),
170  m_option_algorithm (m_prefix + "algorithm" ),
171  m_option_tk (m_prefix + "tk" )
172 {
173 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
174  if (alternativeRawSsOptionsValues ) m_alternativeRawSsOptionsValues = *alternativeRawSsOptionsValues;
175  if (alternativeFilteredSsOptionsValues) m_alternativeFilteredSsOptionsValues = *alternativeFilteredSsOptionsValues;
176 #endif
177 }
178 
180 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
181  const SsOptionsValues* alternativeRawSsOptionsValues,
182  const SsOptionsValues* alternativeFilteredSsOptionsValues,
183 #endif
184  const BaseEnvironment * env,
185  const char * prefix
186  )
187  :
188  m_prefix ((std::string)(prefix) + "mh_"),
189  m_help(UQ_MH_SG_HELP),
190  m_dataOutputFileName (UQ_MH_SG_DATA_OUTPUT_FILE_NAME_ODV),
191  m_dataOutputAllowAll (UQ_MH_SG_DATA_OUTPUT_ALLOW_ALL_ODV),
192  //m_dataOutputAllowedSet (),
193  m_totallyMute (UQ_MH_SG_TOTALLY_MUTE_ODV),
194  m_initialPositionDataInputFileName (UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV),
195  m_initialPositionDataInputFileType (UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV),
196  m_initialProposalCovMatrixDataInputFileName(UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV),
197  m_initialProposalCovMatrixDataInputFileType(UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV),
198  //m_parameterDisabledSet (),
199  m_rawChainDataInputFileName (UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV),
200  m_rawChainDataInputFileType (UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV),
201  m_rawChainSize (UQ_MH_SG_RAW_CHAIN_SIZE_ODV),
202  m_rawChainGenerateExtra (UQ_MH_SG_RAW_CHAIN_GENERATE_EXTRA_ODV),
203  m_rawChainDisplayPeriod (UQ_MH_SG_RAW_CHAIN_DISPLAY_PERIOD_ODV),
204  m_rawChainMeasureRunTimes (UQ_MH_SG_RAW_CHAIN_MEASURE_RUN_TIMES_ODV),
205  m_rawChainDataOutputPeriod (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV),
206  m_rawChainDataOutputFileName (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV),
207  m_rawChainDataOutputFileType (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV),
208  m_rawChainDataOutputAllowAll (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV),
209  //m_rawChainDataOutputAllowedSet (),
210 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
211  m_rawChainComputeStats (UQ_MH_SG_RAW_CHAIN_COMPUTE_STATS_ODV),
212 #endif
213  m_filteredChainGenerate (UQ_MH_SG_FILTERED_CHAIN_GENERATE_ODV),
214  m_filteredChainDiscardedPortion (UQ_MH_SG_FILTERED_CHAIN_DISCARDED_PORTION_ODV),
215  m_filteredChainLag (UQ_MH_SG_FILTERED_CHAIN_LAG_ODV),
216  m_filteredChainDataOutputFileName (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV),
217  m_filteredChainDataOutputFileType (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV),
218  m_filteredChainDataOutputAllowAll (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV),
219  //m_filteredChainDataOutputAllowedSet (),
220 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
221  m_filteredChainComputeStats (UQ_MH_SG_FILTERED_CHAIN_COMPUTE_STATS_ODV),
222 #endif
223  m_displayCandidates (UQ_MH_SG_DISPLAY_CANDIDATES_ODV),
224  m_putOutOfBoundsInChain (UQ_MH_SG_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV),
225  m_tkUseLocalHessian (UQ_MH_SG_TK_USE_LOCAL_HESSIAN_ODV),
226  m_tkUseNewtonComponent (UQ_MH_SG_TK_USE_NEWTON_COMPONENT_ODV),
227  m_drMaxNumExtraStages (UQ_MH_SG_DR_MAX_NUM_EXTRA_STAGES_ODV),
228  m_drScalesForExtraStages (0),
229  m_drDuringAmNonAdaptiveInt (UQ_MH_SG_DR_DURING_AM_NON_ADAPTIVE_INT_ODV),
230  m_amKeepInitialMatrix (UQ_MH_SG_AM_KEEP_INITIAL_MATRIX_ODV),
231  m_amInitialNonAdaptInterval (UQ_MH_SG_AM_INIT_NON_ADAPT_INT_ODV),
232  m_amAdaptInterval (UQ_MH_SG_AM_ADAPT_INTERVAL_ODV),
233  m_amAdaptedMatricesDataOutputPeriod (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV),
234  m_amAdaptedMatricesDataOutputFileName (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV),
235  m_amAdaptedMatricesDataOutputFileType (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV),
236  m_amAdaptedMatricesDataOutputAllowAll (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV),
237  //m_amAdaptedMatricesDataOutputAllowedSet (),
238  m_amEta (UQ_MH_SG_AM_ETA_ODV),
239  m_amEpsilon (UQ_MH_SG_AM_EPSILON_ODV),
240  m_enableBrooksGelmanConvMonitor (UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR),
241  m_BrooksGelmanLag (UQ_MH_SG_BROOKS_GELMAN_LAG),
242  m_outputLogLikelihood (UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD),
243  m_outputLogTarget (UQ_MH_SG_OUTPUT_LOG_TARGET),
244  m_doLogitTransform (UQ_MH_SG_DO_LOGIT_TRANSFORM),
245  m_algorithm (UQ_MH_SG_ALGORITHM),
246  m_tk (UQ_MH_SG_TK),
247 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
248  m_alternativeRawSsOptionsValues (),
249  m_alternativeFilteredSsOptionsValues (),
250 #endif
251  m_env(env),
252 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
253  m_parser(new BoostInputOptionsParser(env->optionsInputFileName())),
254 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
255  m_option_help (m_prefix + "help" ),
256  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
257  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
258  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
259  m_option_totallyMute (m_prefix + "totallyMute" ),
260  m_option_initialPosition_dataInputFileName (m_prefix + "initialPosition_dataInputFileName" ),
261  m_option_initialPosition_dataInputFileType (m_prefix + "initialPosition_dataInputFileType" ),
262  m_option_initialProposalCovMatrix_dataInputFileName(m_prefix + "initialProposalCovMatrix_dataInputFileName"),
263  m_option_initialProposalCovMatrix_dataInputFileType(m_prefix + "initialProposalCovMatrix_dataInputFileType"),
264  m_option_listOfDisabledParameters (m_prefix + "listOfDisabledParameters" ),
265  m_option_rawChain_dataInputFileName (m_prefix + "rawChain_dataInputFileName" ),
266  m_option_rawChain_dataInputFileType (m_prefix + "rawChain_dataInputFileType" ),
267  m_option_rawChain_size (m_prefix + "rawChain_size" ),
268  m_option_rawChain_generateExtra (m_prefix + "rawChain_generateExtra" ),
269  m_option_rawChain_displayPeriod (m_prefix + "rawChain_displayPeriod" ),
270  m_option_rawChain_measureRunTimes (m_prefix + "rawChain_measureRunTimes" ),
271  m_option_rawChain_dataOutputPeriod (m_prefix + "rawChain_dataOutputPeriod" ),
272  m_option_rawChain_dataOutputFileName (m_prefix + "rawChain_dataOutputFileName" ),
273  m_option_rawChain_dataOutputFileType (m_prefix + "rawChain_dataOutputFileType" ),
274  m_option_rawChain_dataOutputAllowAll (m_prefix + "rawChain_dataOutputAllowAll" ),
275  m_option_rawChain_dataOutputAllowedSet (m_prefix + "rawChain_dataOutputAllowedSet" ),
276 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
277  m_option_rawChain_computeStats (m_prefix + "rawChain_computeStats" ),
278 #endif
279  m_option_filteredChain_generate (m_prefix + "filteredChain_generate" ),
280  m_option_filteredChain_discardedPortion (m_prefix + "filteredChain_discardedPortion" ),
281  m_option_filteredChain_lag (m_prefix + "filteredChain_lag" ),
282  m_option_filteredChain_dataOutputFileName (m_prefix + "filteredChain_dataOutputFileName" ),
283  m_option_filteredChain_dataOutputFileType (m_prefix + "filteredChain_dataOutputFileType" ),
284  m_option_filteredChain_dataOutputAllowAll (m_prefix + "filteredChain_dataOutputAllowAll" ),
285  m_option_filteredChain_dataOutputAllowedSet (m_prefix + "filteredChain_dataOutputAllowedSet" ),
286 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
287  m_option_filteredChain_computeStats (m_prefix + "filteredChain_computeStats" ),
288 #endif
289  m_option_displayCandidates (m_prefix + "displayCandidates" ),
290  m_option_putOutOfBoundsInChain (m_prefix + "putOutOfBoundsInChain" ),
291  m_option_tk_useLocalHessian (m_prefix + "tk_useLocalHessian" ),
292  m_option_tk_useNewtonComponent (m_prefix + "tk_useNewtonComponent" ),
293  m_option_dr_maxNumExtraStages (m_prefix + "dr_maxNumExtraStages" ),
294  m_option_dr_listOfScalesForExtraStages (m_prefix + "dr_listOfScalesForExtraStages" ),
295  m_option_dr_duringAmNonAdaptiveInt (m_prefix + "dr_duringAmNonAdaptiveInt" ),
296  m_option_am_keepInitialMatrix (m_prefix + "am_keepInitialMatrix" ),
297  m_option_am_initialNonAdaptInterval (m_prefix + "am_initialNonAdaptInterval" ),
298  m_option_am_adaptInterval (m_prefix + "am_adaptInterval" ),
299  m_option_am_adaptedMatrices_dataOutputPeriod (m_prefix + "am_adaptedMatrices_dataOutputPeriod" ),
300  m_option_am_adaptedMatrices_dataOutputFileName (m_prefix + "am_adaptedMatrices_dataOutputFileName" ),
301  m_option_am_adaptedMatrices_dataOutputFileType (m_prefix + "am_adaptedMatrices_dataOutputFileType" ),
302  m_option_am_adaptedMatrices_dataOutputAllowAll (m_prefix + "am_adaptedMatrices_dataOutputAllowAll" ),
303  m_option_am_adaptedMatrices_dataOutputAllowedSet (m_prefix + "am_adaptedMatrices_dataOutputAllowedSet" ),
304  m_option_am_eta (m_prefix + "am_eta" ),
305  m_option_am_epsilon (m_prefix + "am_epsilon" ),
306  m_option_enableBrooksGelmanConvMonitor (m_prefix + "enableBrooksGelmanConvMonitor" ),
307  m_option_BrooksGelmanLag (m_prefix + "BrooksGelmanLag" ),
308  m_option_outputLogLikelihood (m_prefix + "outputLogLikelihood" ),
309  m_option_outputLogTarget (m_prefix + "outputLogTarget" ),
310  m_option_doLogitTransform (m_prefix + "doLogitTransform" ),
311  m_option_algorithm (m_prefix + "algorithm" ),
312  m_option_tk (m_prefix + "tk" )
313 {
314 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
315  if (alternativeRawSsOptionsValues ) m_alternativeRawSsOptionsValues = *alternativeRawSsOptionsValues;
316  if (alternativeFilteredSsOptionsValues) m_alternativeFilteredSsOptionsValues = *alternativeFilteredSsOptionsValues;
317 #endif
318 
319 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
320  m_parser->registerOption<std::string >(m_option_help, UQ_MH_SG_HELP, "produce help msg for Bayesian Metropolis-Hastings" );
321  m_parser->registerOption<std::string >(m_option_dataOutputFileName, UQ_MH_SG_DATA_OUTPUT_FILE_NAME_ODV , "name of generic output file" );
322  m_parser->registerOption<bool >(m_option_dataOutputAllowAll, UQ_MH_SG_DATA_OUTPUT_ALLOW_ALL_ODV , "allow all subEnvs write to a generic output file" );
323  m_parser->registerOption<std::string >(m_option_dataOutputAllowedSet, UQ_MH_SG_DATA_OUTPUT_ALLOWED_SET_ODV , "subEnvs that will write to generic output file" );
324  m_parser->registerOption<bool >(m_option_totallyMute, UQ_MH_SG_TOTALLY_MUTE_ODV , "totally mute (no printout msg)" );
330  m_parser->registerOption<std::string >(m_option_rawChain_dataInputFileName, UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV , "name of input file for raw chain " );
331  m_parser->registerOption<std::string >(m_option_rawChain_dataInputFileType, UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV , "type of input file for raw chain " );
332  m_parser->registerOption<unsigned int>(m_option_rawChain_size, UQ_MH_SG_RAW_CHAIN_SIZE_ODV , "size of raw chain" );
333  m_parser->registerOption<bool >(m_option_rawChain_generateExtra, UQ_MH_SG_RAW_CHAIN_GENERATE_EXTRA_ODV , "generate extra information about raw chain" );
334  m_parser->registerOption<unsigned int>(m_option_rawChain_displayPeriod, UQ_MH_SG_RAW_CHAIN_DISPLAY_PERIOD_ODV , "period of msg display during raw chain generation" );
336  m_parser->registerOption<unsigned int>(m_option_rawChain_dataOutputPeriod, UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV , "period of msg display during raw chain generation" );
337  m_parser->registerOption<std::string >(m_option_rawChain_dataOutputFileName, UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV , "name of output file for raw chain " );
338  m_parser->registerOption<std::string >(m_option_rawChain_dataOutputFileType, UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV , "type of output file for raw chain " );
339  m_parser->registerOption<bool >(m_option_rawChain_dataOutputAllowAll, UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV , "allow all subEnvs to write raw chain to an output file" );
340  m_parser->registerOption<std::string >(m_option_rawChain_dataOutputAllowedSet, UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV , "subEnvs that will write raw chain to output file" );
341 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
342  m_parser->registerOption<bool >(m_option_rawChain_computeStats, UQ_MH_SG_RAW_CHAIN_COMPUTE_STATS_ODV , "compute statistics on raw chain" );
343 #endif
345  m_parser->registerOption<double >(m_option_filteredChain_discardedPortion, UQ_MH_SG_FILTERED_CHAIN_DISCARDED_PORTION_ODV , "initial discarded portion for chain filtering" );
346  m_parser->registerOption<unsigned int>(m_option_filteredChain_lag, UQ_MH_SG_FILTERED_CHAIN_LAG_ODV , "spacing for chain filtering" );
349  m_parser->registerOption<bool >(m_option_filteredChain_dataOutputAllowAll, UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV , "allow all subEnvs to write filt chain to an output file" );
350  m_parser->registerOption<std::string >(m_option_filteredChain_dataOutputAllowedSet, UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV , "subEnvs that will write filt chain to output file" );
351 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
352  m_parser->registerOption<bool >(m_option_filteredChain_computeStats, UQ_MH_SG_FILTERED_CHAIN_COMPUTE_STATS_ODV , "compute statistics on filtered chain" );
353 #endif
354  m_parser->registerOption<bool >(m_option_displayCandidates, UQ_MH_SG_DISPLAY_CANDIDATES_ODV , "display candidates in the core MH algorithm" );
355  m_parser->registerOption<bool >(m_option_putOutOfBoundsInChain, UQ_MH_SG_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV , "put 'out of bound' candidates in chain as well" );
356  m_parser->registerOption<bool >(m_option_tk_useLocalHessian, UQ_MH_SG_TK_USE_LOCAL_HESSIAN_ODV , "'proposal' use local Hessian" );
358  m_parser->registerOption<unsigned int>(m_option_dr_maxNumExtraStages, UQ_MH_SG_DR_MAX_NUM_EXTRA_STAGES_ODV , "'dr' maximum number of extra stages" );
359  m_parser->registerOption<std::string >(m_option_dr_listOfScalesForExtraStages, UQ_MH_SG_DR_LIST_OF_SCALES_FOR_EXTRA_STAGES_ODV , "'dr' scales for prop cov matrices from 2nd stage on" );
360  m_parser->registerOption<bool >(m_option_dr_duringAmNonAdaptiveInt, UQ_MH_SG_DR_DURING_AM_NON_ADAPTIVE_INT_ODV , "'dr' used during 'am' non adaptive interval" );
361  m_parser->registerOption<bool >(m_option_am_keepInitialMatrix, UQ_MH_SG_AM_KEEP_INITIAL_MATRIX_ODV , "'am' keep initial (given) matrix" );
362  m_parser->registerOption<unsigned int>(m_option_am_initialNonAdaptInterval, UQ_MH_SG_AM_INIT_NON_ADAPT_INT_ODV , "'am' initial non adaptation interval" );
363  m_parser->registerOption<unsigned int>(m_option_am_adaptInterval, UQ_MH_SG_AM_ADAPT_INTERVAL_ODV , "'am' adaptation interval" );
371  m_parser->registerOption<unsigned int>(m_option_enableBrooksGelmanConvMonitor, UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR , "assess convergence using Brooks-Gelman metric" );
372  m_parser->registerOption<unsigned int>(m_option_BrooksGelmanLag, UQ_MH_SG_BROOKS_GELMAN_LAG , "number of chain positions before starting to compute metric");
373  m_parser->registerOption<bool >(m_option_outputLogLikelihood, UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD , "flag to toggle output of log likelihood values" );
374  m_parser->registerOption<bool >(m_option_outputLogTarget, UQ_MH_SG_OUTPUT_LOG_TARGET , "flag to toggle output of log target values" );
375  m_parser->registerOption<bool >(m_option_doLogitTransform, UQ_MH_SG_DO_LOGIT_TRANSFORM , "flag to toggle logit transform for bounded domains" );
376  m_parser->registerOption<std::string >(m_option_algorithm, UQ_MH_SG_ALGORITHM , "which MCMC algorithm to use" );
377  m_parser->registerOption<std::string >(m_option_tk, UQ_MH_SG_TK , "which MCMC transition kernel to use" );
378 
380 
381  m_parser->getOption<std::string >(m_option_help, m_help);
402 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
403  m_parser->getOption<bool >(m_option_rawChain_computeStats, m_rawChain_computeStats);
404 #endif
412 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
413  m_parser->getOption<bool >(m_option_filteredChain_computeStats, m_filteredChain_computeStats);
414 #endif
438  m_parser->getOption<std::string >(m_option_tk, m_tk);
439 #else
443 
444  // UQ_MH_SG_DATA_OUTPUT_ALLOWED_SET_ODV is the empty set (string) by default
445  unsigned int size = m_env->input().vector_variable_size(m_option_dataOutputAllowedSet);
446  for (unsigned int i = 0; i < size; i++) {
447  // We default to empty set, so the default values are actually never used
448  // here
449  unsigned int allowed = m_env->input()(m_option_dataOutputAllowedSet, i, i);
450  m_dataOutputAllowedSet.insert(allowed);
451  }
452 
458 
459  // UQ_MH_SG_LIST_OF_DISABLED_PARAMETERS_ODV is the empty set (string) by
460  // default
461  size = m_env->input().vector_variable_size(m_option_listOfDisabledParameters);
462  for (unsigned int i = 0; i < size; i++) {
463  // We default to empty set, so the default values are actually never used
464  // here
465  unsigned int disabled = m_env->input()(m_option_listOfDisabledParameters, i, i);
466  m_parameterDisabledSet.insert(disabled);
467  }
468 
479 
480  // UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV is the empty set (string) by default
481  size = m_env->input().vector_variable_size(m_option_rawChain_dataOutputAllowedSet);
482  for (unsigned int i = 0; i < size; i++) {
483  // We default to empty set, so the default values are actually never used
484  // here
485  unsigned int allowed = m_env->input()(m_option_rawChain_dataOutputAllowedSet, i, i);
486  m_rawChainDataOutputAllowedSet.insert(allowed);
487  }
488 
489 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
490  m_rawChain_computeStats = m_env->input()(m_option_rawChain_computeStats, UQ_MH_SG_RAW_CHAIN_COMPUTE_STATS_ODV);
491 #endif
498 
499  // UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV is the empty set (string) by default
500  size = m_env->input().vector_variable_size(m_option_filteredChain_dataOutputAllowedSet);
501  for (unsigned int i = 0; i < size; i++) {
502  // We default to empty set, so the default values are actually never used
503  // here
504  unsigned int allowed = m_env->input()(m_option_filteredChain_dataOutputAllowedSet, i, i);
505  m_filteredChainDataOutputAllowedSet.insert(allowed);
506  }
507 
508 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
509  m_filteredChain_computeStats = m_env->input()(m_option_filteredChain_computeStats, UQ_MH_SG_FILTERED_CHAIN_COMPUTE_STATS_ODV);
510 #endif
516 
517  // UQ_MH_SG_DR_LIST_OF_SCALES_FOR_EXTRA_STAGES_ODV is the empty set (string) by default
518  size = m_env->input().vector_variable_size(m_option_dr_listOfScalesForExtraStages);
519  for (unsigned int i = 0; i < size; i++) {
520  // We default to empty set, so the default values are actually never used
521  // here
522  unsigned int allowed = m_env->input()(m_option_dr_listOfScalesForExtraStages, i, i);
523  m_drScalesForExtraStages.push_back(allowed);
524  }
525 
534 
535  // UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOWED_SET_ODV is the empty set (string) by default
536  size = m_env->input().vector_variable_size(m_option_am_adaptedMatrices_dataOutputAllowedSet);
537  for (unsigned int i = 0; i < size; i++) {
538  // We default to empty set, so the default values are actually never used
539  // here
540  unsigned int allowed = m_env->input()(m_option_am_adaptedMatrices_dataOutputAllowedSet, i, i);
542  }
543 
553 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
554 
555  checkOptions(env);
556 }
557 // Copy constructor----------------------------------
559 {
560  this->copy(src);
561 }
562 // Destructor ---------------------------------------
564 {
565 }
566 // Set methods --------------------------------------
569 {
570  this->copy(rhs);
571  return *this;
572 }
573 // Private methods-----------------------------------
574 void
576 {
577  if (m_dataOutputAllowAll) {
578  // So, ignore the 'set' option
579  m_dataOutputAllowedSet.clear();
580  m_dataOutputAllowedSet.insert(env->subId());
581  }
582 
584  // Again, ignore the set
586  m_rawChainDataOutputAllowedSet.insert(env->subId());
587  }
588 
589  if (m_filteredChainGenerate == true) {
590  queso_require_greater_equal_msg(m_filteredChainLag, 2, "option `" << m_option_filteredChain_lag << "` must be at least 2");
591  }
592 
596  }
597 
598  // If max is bigger than the list provided, then pad with ones
599  if (m_drMaxNumExtraStages > 0) {
600  unsigned int size = m_drScalesForExtraStages.size();
601  if (m_drMaxNumExtraStages > size) {
602  for (unsigned int i = size; i < m_drMaxNumExtraStages; i++) {
603  double scale = 1.0;
604  m_drScalesForExtraStages.push_back(scale);
605  }
606  }
607  }
608  else {
609  m_drScalesForExtraStages.clear();
610  }
611 
615  }
616 
617  if ((m_tk == "random_walk") && (m_algorithm == "logit_random_walk")) {
618  queso_error_msg("random_walk transition kernel and logit_random_walk algorithm are incompatible options");
619  }
620 
621  if ((m_tk == "logit_random_walk") && (m_algorithm == "random_walk")) {
622  queso_error_msg("logit_random_walk transition kernel and random_walk algorithm are incompatible options");
623  }
624 
625  if (m_tk == "random_walk") {
628  0,
629  "logit transform must be off to use random_walk");
632  0,
633  "local Hessian must be off to use random_walk");
634  }
635 
636  if (m_tk == "logit_random_walk") {
639  1,
640  "logit transform must be on to use logit_random_walk");
643  0,
644  "local Hessian must be off to use logit_random_walk");
645  }
646 
647  if (m_tk == "stochastic_newton") {
650  0,
651  "logit transform must be off to use stochastic_newton");
654  1,
655  "local Hessian must be on to use stochastic_newton");
656  }
657 
658 }
659 
660 void
662 {
683 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
684  m_rawChainComputeStats = src.m_rawChainComputeStats;
685 #endif
686 //m_rawChainStatisticalOptionsObj = src.m_rawChainStatisticalOptionsObj; // dakota
687 //m_rawChainStatOptsInstantiated = src.m_rawChainStatOptsInstantiated; // dakota
695 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
696  m_filteredChainComputeStats = src.m_filteredChainComputeStats;
697 #endif
698 //m_filteredChainStatisticalOptionsObj = src.m_filteredChainStatisticalOptionsObj; // dakota
699 //m_filteredChainStatOptsInstantiated = src.m_filteredChainStatOptsInstantiated; // dakota
715  m_amEta = src.m_amEta;
716  m_amEpsilon = src.m_amEpsilon;
722  m_algorithm = src.m_algorithm;
723  m_tk = src.m_tk;
724 
725 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
726  m_alternativeRawSsOptionsValues = src.m_alternativeRawSsOptionsValues;
727  m_alternativeFilteredSsOptionsValues = src.m_alternativeFilteredSsOptionsValues;
728 #endif
729  return;
730 }
731 
732 std::ostream & operator<<(std::ostream & os, const MhOptionsValues & obj)
733 {
734 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
735  os << (*(obj.m_parser)) << std::endl;
736 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
737 
738  os << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName
739  << "\n" << obj.m_option_dataOutputAllowAll << " = " << obj.m_dataOutputAllowAll
740  << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
741  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
742  os << *setIt << " ";
743  }
744  os << "\n" << obj.m_option_totallyMute << " = " << obj.m_totallyMute
749  << "\n" << obj.m_option_listOfDisabledParameters << " = ";
750  for (std::set<unsigned int>::iterator setIt = obj.m_parameterDisabledSet.begin(); setIt != obj.m_parameterDisabledSet.end(); ++setIt) {
751  os << *setIt << " ";
752  }
753  os << "\n" << obj.m_option_rawChain_dataInputFileName << " = " << obj.m_rawChainDataInputFileName
755  << "\n" << obj.m_option_rawChain_size << " = " << obj.m_rawChainSize
756  << "\n" << obj.m_option_rawChain_generateExtra << " = " << obj.m_rawChainGenerateExtra
757  << "\n" << obj.m_option_rawChain_displayPeriod << " = " << obj.m_rawChainDisplayPeriod
758  << "\n" << obj.m_option_rawChain_measureRunTimes << " = " << obj.m_rawChainMeasureRunTimes
763  << "\n" << obj.m_option_rawChain_dataOutputAllowedSet << " = ";
764  for (std::set<unsigned int>::iterator setIt = obj.m_rawChainDataOutputAllowedSet.begin(); setIt != obj.m_rawChainDataOutputAllowedSet.end(); ++setIt) {
765  os << *setIt << " ";
766  }
767  os
768 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
769  << "\n" << obj.m_option_rawChain_computeStats << " = " << obj.m_rawChainComputeStats
770 #endif
771  << "\n" << obj.m_option_filteredChain_generate << " = " << obj.m_filteredChainGenerate
773  << "\n" << obj.m_option_filteredChain_lag << " = " << obj.m_filteredChainLag
777  << "\n" << obj.m_option_filteredChain_dataOutputAllowedSet << " = ";
778  for (std::set<unsigned int>::iterator setIt = obj.m_filteredChainDataOutputAllowedSet.begin(); setIt != obj.m_filteredChainDataOutputAllowedSet.end(); ++setIt) {
779  os << *setIt << " ";
780  }
781  os
782 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
783  << "\n" << obj.m_option_filteredChain_computeStats << " = " << obj.m_filteredChainComputeStats
784 #endif
785  << "\n" << obj.m_option_displayCandidates << " = " << obj.m_displayCandidates
786  << "\n" << obj.m_option_putOutOfBoundsInChain << " = " << obj.m_putOutOfBoundsInChain
787  << "\n" << obj.m_option_tk_useLocalHessian << " = " << obj.m_tkUseLocalHessian
788  << "\n" << obj.m_option_tk_useNewtonComponent << " = " << obj.m_tkUseNewtonComponent
789  << "\n" << obj.m_option_dr_maxNumExtraStages << " = " << obj.m_drMaxNumExtraStages
790  << "\n" << obj.m_option_dr_listOfScalesForExtraStages << " = ";
791  for (unsigned int i = 0; i < obj.m_drScalesForExtraStages.size(); ++i) {
792  os << obj.m_drScalesForExtraStages[i] << " ";
793  }
794  os << "\n" << obj.m_option_dr_duringAmNonAdaptiveInt << " = " << obj.m_drDuringAmNonAdaptiveInt
795  << "\n" << obj.m_option_am_keepInitialMatrix << " = " << obj.m_amKeepInitialMatrix
797  << "\n" << obj.m_option_am_adaptInterval << " = " << obj.m_amAdaptInterval
802  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputAllowedSet << " = ";
803  for (std::set<unsigned int>::iterator setIt = obj.m_amAdaptedMatricesDataOutputAllowedSet.begin(); setIt != obj.m_amAdaptedMatricesDataOutputAllowedSet.end(); ++setIt) {
804  os << *setIt << " ";
805  }
806  os << "\n" << obj.m_option_am_eta << " = " << obj.m_amEta
807  << "\n" << obj.m_option_am_epsilon << " = " << obj.m_amEpsilon
809  << "\n" << obj.m_option_BrooksGelmanLag << " = " << obj.m_BrooksGelmanLag
810  << "\n" << obj.m_option_outputLogLikelihood << " = " << obj.m_outputLogLikelihood
811  << "\n" << obj.m_option_outputLogTarget << " = " << obj.m_outputLogTarget
812  << "\n" << obj.m_option_doLogitTransform << " = " << obj.m_doLogitTransform
813  << "\n" << obj.m_option_algorithm << " = " << obj.m_algorithm
814  << "\n" << obj.m_option_tk << " = " << obj.m_tk
815  << std::endl;
816 
817  return os;
818 }
819 
820 //---------------------------------------------------
821 // MetropolisHastingsSGOptions ---------------
822 //---------------------------------------------------
823 
824 // Default constructor -----------------------------
826  const BaseEnvironment& env,
827  const char* prefix)
828  :
829 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
830  m_ov (NULL,NULL), // dakota
831  m_rawChainStatisticalOptionsObj (NULL),
832  m_rawChainStatOptsInstantiated (false),
833  m_filteredChainStatisticalOptionsObj (NULL),
834  m_filteredChainStatOptsInstantiated (false),
835 #else
836  m_ov (),
837 #endif
838  m_prefix ((std::string)(prefix) + "mh_"),
839  m_env (env),
840 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
841  m_optionsDesc (new boost::program_options::options_description("Bayesian Metropolis-Hastings options")),
842 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
843  m_option_help (m_prefix + "help" ),
844  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
845  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
846  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
847  m_option_totallyMute (m_prefix + "totallyMute" ),
848  m_option_initialPosition_dataInputFileName (m_prefix + "initialPosition_dataInputFileName" ),
849  m_option_initialPosition_dataInputFileType (m_prefix + "initialPosition_dataInputFileType" ),
850  m_option_initialProposalCovMatrix_dataInputFileName(m_prefix + "initialProposalCovMatrix_dataInputFileName"),
851  m_option_initialProposalCovMatrix_dataInputFileType(m_prefix + "initialProposalCovMatrix_dataInputFileType"),
852  m_option_listOfDisabledParameters (m_prefix + "listOfDisabledParameters" ),
853  m_option_rawChain_dataInputFileName (m_prefix + "rawChain_dataInputFileName" ),
854  m_option_rawChain_dataInputFileType (m_prefix + "rawChain_dataInputFileType" ),
855  m_option_rawChain_size (m_prefix + "rawChain_size" ),
856  m_option_rawChain_generateExtra (m_prefix + "rawChain_generateExtra" ),
857  m_option_rawChain_displayPeriod (m_prefix + "rawChain_displayPeriod" ),
858  m_option_rawChain_measureRunTimes (m_prefix + "rawChain_measureRunTimes" ),
859  m_option_rawChain_dataOutputPeriod (m_prefix + "rawChain_dataOutputPeriod" ),
860  m_option_rawChain_dataOutputFileName (m_prefix + "rawChain_dataOutputFileName" ),
861  m_option_rawChain_dataOutputFileType (m_prefix + "rawChain_dataOutputFileType" ),
862  m_option_rawChain_dataOutputAllowAll (m_prefix + "rawChain_dataOutputAllowAll" ),
863  m_option_rawChain_dataOutputAllowedSet (m_prefix + "rawChain_dataOutputAllowedSet" ),
864 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
865  m_option_rawChain_computeStats (m_prefix + "rawChain_computeStats" ),
866 #endif
867  m_option_filteredChain_generate (m_prefix + "filteredChain_generate" ),
868  m_option_filteredChain_discardedPortion (m_prefix + "filteredChain_discardedPortion" ),
869  m_option_filteredChain_lag (m_prefix + "filteredChain_lag" ),
870  m_option_filteredChain_dataOutputFileName (m_prefix + "filteredChain_dataOutputFileName" ),
871  m_option_filteredChain_dataOutputFileType (m_prefix + "filteredChain_dataOutputFileType" ),
872  m_option_filteredChain_dataOutputAllowAll (m_prefix + "filteredChain_dataOutputAllowAll" ),
873  m_option_filteredChain_dataOutputAllowedSet (m_prefix + "filteredChain_dataOutputAllowedSet" ),
874 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
875  m_option_filteredChain_computeStats (m_prefix + "filteredChain_computeStats" ),
876 #endif
877  m_option_displayCandidates (m_prefix + "displayCandidates" ),
878  m_option_putOutOfBoundsInChain (m_prefix + "putOutOfBoundsInChain" ),
879  m_option_tk_useLocalHessian (m_prefix + "tk_useLocalHessian" ),
880  m_option_tk_useNewtonComponent (m_prefix + "tk_useNewtonComponent" ),
881  m_option_dr_maxNumExtraStages (m_prefix + "dr_maxNumExtraStages" ),
882  m_option_dr_listOfScalesForExtraStages (m_prefix + "dr_listOfScalesForExtraStages" ),
883  m_option_dr_duringAmNonAdaptiveInt (m_prefix + "dr_duringAmNonAdaptiveInt" ),
884  m_option_am_keepInitialMatrix (m_prefix + "am_keepInitialMatrix" ),
885  m_option_am_initialNonAdaptInterval (m_prefix + "am_initialNonAdaptInterval" ),
886  m_option_am_adaptInterval (m_prefix + "am_adaptInterval" ),
887  m_option_am_adaptedMatrices_dataOutputPeriod (m_prefix + "am_adaptedMatrices_dataOutputPeriod" ),
888  m_option_am_adaptedMatrices_dataOutputFileName (m_prefix + "am_adaptedMatrices_dataOutputFileName" ),
889  m_option_am_adaptedMatrices_dataOutputFileType (m_prefix + "am_adaptedMatrices_dataOutputFileType" ),
890  m_option_am_adaptedMatrices_dataOutputAllowAll (m_prefix + "am_adaptedMatrices_dataOutputAllowAll" ),
891  m_option_am_adaptedMatrices_dataOutputAllowedSet (m_prefix + "am_adaptedMatrices_dataOutputAllowedSet" ),
892  m_option_am_eta (m_prefix + "am_eta" ),
893  m_option_am_epsilon (m_prefix + "am_epsilon" ),
894  m_option_enableBrooksGelmanConvMonitor (m_prefix + "enableBrooksGelmanConvMonitor" ),
895  m_option_BrooksGelmanLag (m_prefix + "BrooksGelmanLag" ),
896  m_option_outputLogLikelihood (m_prefix + "outputLogLikelihood" ),
897  m_option_outputLogTarget (m_prefix + "outputLogTarget" ),
898  m_option_doLogitTransform (m_prefix + "doLogitTransform" ),
899  m_option_algorithm (m_prefix + "algorithm" ),
900  m_option_tk (m_prefix + "tk" )
901 {
903 
904  queso_require_not_equal_to_msg(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the absence of an options input file"));
905 }
906 // Constructor 2------------------------------------
908  const BaseEnvironment& env,
909  const char* prefix,
910  const MhOptionsValues& alternativeOptionsValues)
911  :
912  m_ov (alternativeOptionsValues),
913 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
914  m_rawChainStatisticalOptionsObj (NULL),
915  m_rawChainStatOptsInstantiated (false),
916  m_filteredChainStatisticalOptionsObj (NULL),
917  m_filteredChainStatOptsInstantiated (false),
918 #endif
919  m_prefix ((std::string)(prefix) + "mh_"),
920  m_env (env),
921 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
922  m_optionsDesc (NULL),
923 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
924  m_option_help (m_prefix + "help" ),
925  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
926  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
927  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
928  m_option_totallyMute (m_prefix + "totallyMute" ),
929  m_option_initialPosition_dataInputFileName (m_prefix + "initialPosition_dataInputFileName" ),
930  m_option_initialPosition_dataInputFileType (m_prefix + "initialPosition_dataInputFileType" ),
931  m_option_initialProposalCovMatrix_dataInputFileName(m_prefix + "initialProposalCovMatrix_dataInputFileName"),
932  m_option_initialProposalCovMatrix_dataInputFileType(m_prefix + "initialProposalCovMatrix_dataInputFileType"),
933  m_option_listOfDisabledParameters (m_prefix + "listOfDisabledParameters" ),
934  m_option_rawChain_dataInputFileName (m_prefix + "rawChain_dataInputFileName" ),
935  m_option_rawChain_dataInputFileType (m_prefix + "rawChain_dataInputFileType" ),
936  m_option_rawChain_size (m_prefix + "rawChain_size" ),
937  m_option_rawChain_generateExtra (m_prefix + "rawChain_generateExtra" ),
938  m_option_rawChain_displayPeriod (m_prefix + "rawChain_displayPeriod" ),
939  m_option_rawChain_measureRunTimes (m_prefix + "rawChain_measureRunTimes" ),
940  m_option_rawChain_dataOutputPeriod (m_prefix + "rawChain_dataOutputPeriod" ),
941  m_option_rawChain_dataOutputFileName (m_prefix + "rawChain_dataOutputFileName" ),
942  m_option_rawChain_dataOutputFileType (m_prefix + "rawChain_dataOutputFileType" ),
943  m_option_rawChain_dataOutputAllowAll (m_prefix + "rawChain_dataOutputAllowAll" ),
944  m_option_rawChain_dataOutputAllowedSet (m_prefix + "rawChain_dataOutputAllowedSet" ),
945 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
946  m_option_rawChain_computeStats (m_prefix + "rawChain_computeStats" ),
947 #endif
948  m_option_filteredChain_generate (m_prefix + "filteredChain_generate" ),
949  m_option_filteredChain_discardedPortion (m_prefix + "filteredChain_discardedPortion" ),
950  m_option_filteredChain_lag (m_prefix + "filteredChain_lag" ),
951  m_option_filteredChain_dataOutputFileName (m_prefix + "filteredChain_dataOutputFileName" ),
952  m_option_filteredChain_dataOutputFileType (m_prefix + "filteredChain_dataOutputFileType" ),
953  m_option_filteredChain_dataOutputAllowAll (m_prefix + "filteredChain_dataOutputAllowAll" ),
954  m_option_filteredChain_dataOutputAllowedSet (m_prefix + "filteredChain_dataOutputAllowedSet" ),
955 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
956  m_option_filteredChain_computeStats (m_prefix + "filteredChain_computeStats" ),
957 #endif
958  m_option_displayCandidates (m_prefix + "displayCandidates" ),
959  m_option_putOutOfBoundsInChain (m_prefix + "putOutOfBoundsInChain" ),
960  m_option_tk_useLocalHessian (m_prefix + "tk_useLocalHessian" ),
961  m_option_tk_useNewtonComponent (m_prefix + "tk_useNewtonComponent" ),
962  m_option_dr_maxNumExtraStages (m_prefix + "dr_maxNumExtraStages" ),
963  m_option_dr_listOfScalesForExtraStages (m_prefix + "dr_listOfScalesForExtraStages" ),
964  m_option_dr_duringAmNonAdaptiveInt (m_prefix + "dr_duringAmNonAdaptiveInt" ),
965  m_option_am_keepInitialMatrix (m_prefix + "am_keepInitialMatrix" ),
966  m_option_am_initialNonAdaptInterval (m_prefix + "am_initialNonAdaptInterval" ),
967  m_option_am_adaptInterval (m_prefix + "am_adaptInterval" ),
968  m_option_am_adaptedMatrices_dataOutputPeriod (m_prefix + "am_adaptedMatrices_dataOutputPeriod" ),
969  m_option_am_adaptedMatrices_dataOutputFileName (m_prefix + "am_adaptedMatrices_dataOutputFileName" ),
970  m_option_am_adaptedMatrices_dataOutputFileType (m_prefix + "am_adaptedMatrices_dataOutputFileType" ),
971  m_option_am_adaptedMatrices_dataOutputAllowAll (m_prefix + "am_adaptedMatrices_dataOutputAllowAll" ),
972  m_option_am_adaptedMatrices_dataOutputAllowedSet (m_prefix + "am_adaptedMatrices_dataOutputAllowedSet" ),
973  m_option_am_eta (m_prefix + "am_eta" ),
974  m_option_am_epsilon (m_prefix + "am_epsilon" ),
975  m_option_enableBrooksGelmanConvMonitor (m_prefix + "enableBrooksGelmanConvMonitor" ),
976  m_option_BrooksGelmanLag (m_prefix + "BrooksGelmanLag" ),
977  m_option_outputLogLikelihood (m_prefix + "outputLogLikelihood" ),
978  m_option_outputLogTarget (m_prefix + "outputLogTarget" ),
979  m_option_doLogitTransform (m_prefix + "doLogitTransform" ),
980  m_option_algorithm (m_prefix + "algorithm" ),
981  m_option_tk (m_prefix + "tk" )
982 {
984 
985  queso_require_equal_to_msg(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the existence of an options input file"));
986 
987  if ((m_env.subDisplayFile() != NULL ) &&
988  (m_ov.m_totallyMute == false)) {
989  *m_env.subDisplayFile() << "In MetropolisHastingsSGOptions::constructor(2)"
990  << ": after setting values of options with prefix '" << m_prefix
991  << "', state of object is:"
992  << "\n" << *this
993  << std::endl;
994  }
995 
996 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
997  if (m_ov.m_rawChainComputeStats) {
998  m_rawChainStatisticalOptionsObj = new SequenceStatisticalOptions(m_env,m_prefix + "rawChain_",m_ov.m_alternativeRawSsOptionsValues);
999  m_rawChainStatOptsInstantiated = true;
1000  }
1001  if (m_ov.m_filteredChainComputeStats) {
1002  m_filteredChainStatisticalOptionsObj = new SequenceStatisticalOptions(m_env,m_prefix + "filteredChain_",m_ov.m_alternativeFilteredSsOptionsValues);
1003  m_filteredChainStatOptsInstantiated = true;
1004  }
1005 #endif
1006 }
1007 // Copy constructor---------------------------------
1009  const MLSamplingLevelOptions& mlOptions)
1010  :
1011 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1012  m_ov (NULL,NULL), // dakota
1013  m_rawChainStatisticalOptionsObj (NULL),
1014  m_rawChainStatOptsInstantiated (false),
1015  m_filteredChainStatisticalOptionsObj (NULL),
1016  m_filteredChainStatOptsInstantiated (false),
1017 #else
1018  m_ov (),
1019 #endif
1020  m_prefix (mlOptions.m_prefix),
1021  m_env (mlOptions.env()),
1022 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
1023  m_optionsDesc (NULL),
1024 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
1025  m_option_help (m_prefix + "help" ),
1026  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
1027  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
1028  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
1029  m_option_totallyMute (m_prefix + "totallyMute" ),
1030  m_option_initialPosition_dataInputFileName (m_prefix + "initialPosition_dataInputFileName" ),
1031  m_option_initialPosition_dataInputFileType (m_prefix + "initialPosition_dataInputFileType" ),
1032  m_option_initialProposalCovMatrix_dataInputFileName(m_prefix + "initialProposalCovMatrix_dataInputFileName"),
1033  m_option_initialProposalCovMatrix_dataInputFileType(m_prefix + "initialProposalCovMatrix_dataInputFileType"),
1034  m_option_listOfDisabledParameters (m_prefix + "listOfDisabledParameters" ),
1035  m_option_rawChain_dataInputFileName (m_prefix + "rawChain_dataInputFileName" ),
1036  m_option_rawChain_dataInputFileType (m_prefix + "rawChain_dataInputFileType" ),
1037  m_option_rawChain_size (m_prefix + "rawChain_size" ),
1038  m_option_rawChain_generateExtra (m_prefix + "rawChain_generateExtra" ),
1039  m_option_rawChain_displayPeriod (m_prefix + "rawChain_displayPeriod" ),
1040  m_option_rawChain_measureRunTimes (m_prefix + "rawChain_measureRunTimes" ),
1041  m_option_rawChain_dataOutputPeriod (m_prefix + "rawChain_dataOutputPeriod" ),
1042  m_option_rawChain_dataOutputFileName (m_prefix + "rawChain_dataOutputFileName" ),
1043  m_option_rawChain_dataOutputFileType (m_prefix + "rawChain_dataOutputFileType" ),
1044  m_option_rawChain_dataOutputAllowAll (m_prefix + "rawChain_dataOutputAllowAll" ),
1045  m_option_rawChain_dataOutputAllowedSet (m_prefix + "rawChain_dataOutputAllowedSet" ),
1046 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1047  m_option_rawChain_computeStats (m_prefix + "rawChain_computeStats" ),
1048 #endif
1049  m_option_filteredChain_generate (m_prefix + "filteredChain_generate" ),
1050  m_option_filteredChain_discardedPortion (m_prefix + "filteredChain_discardedPortion" ),
1051  m_option_filteredChain_lag (m_prefix + "filteredChain_lag" ),
1052  m_option_filteredChain_dataOutputFileName (m_prefix + "filteredChain_dataOutputFileName" ),
1053  m_option_filteredChain_dataOutputFileType (m_prefix + "filteredChain_dataOutputFileType" ),
1054  m_option_filteredChain_dataOutputAllowAll (m_prefix + "filteredChain_dataOutputAllowAll" ),
1055  m_option_filteredChain_dataOutputAllowedSet (m_prefix + "filteredChain_dataOutputAllowedSet" ),
1056 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1057  m_option_filteredChain_computeStats (m_prefix + "filteredChain_computeStats" ),
1058 #endif
1059  m_option_displayCandidates (m_prefix + "displayCandidates" ),
1060  m_option_putOutOfBoundsInChain (m_prefix + "putOutOfBoundsInChain" ),
1061  m_option_tk_useLocalHessian (m_prefix + "tk_useLocalHessian" ),
1062  m_option_tk_useNewtonComponent (m_prefix + "tk_useNewtonComponent" ),
1063  m_option_dr_maxNumExtraStages (m_prefix + "dr_maxNumExtraStages" ),
1064  m_option_dr_listOfScalesForExtraStages (m_prefix + "dr_listOfScalesForExtraStages" ),
1065  m_option_dr_duringAmNonAdaptiveInt (m_prefix + "dr_duringAmNonAdaptiveInt" ),
1066  m_option_am_keepInitialMatrix (m_prefix + "am_keepInitialMatrix" ),
1067  m_option_am_initialNonAdaptInterval (m_prefix + "am_initialNonAdaptInterval" ),
1068  m_option_am_adaptInterval (m_prefix + "am_adaptInterval" ),
1069  m_option_am_adaptedMatrices_dataOutputPeriod (m_prefix + "am_adaptedMatrices_dataOutputPeriod" ),
1070  m_option_am_adaptedMatrices_dataOutputFileName (m_prefix + "am_adaptedMatrices_dataOutputFileName" ),
1071  m_option_am_adaptedMatrices_dataOutputFileType (m_prefix + "am_adaptedMatrices_dataOutputFileType" ),
1072  m_option_am_adaptedMatrices_dataOutputAllowAll (m_prefix + "am_adaptedMatrices_dataOutputAllowAll" ),
1073  m_option_am_adaptedMatrices_dataOutputAllowedSet (m_prefix + "am_adaptedMatrices_dataOutputAllowedSet" ),
1074  m_option_am_eta (m_prefix + "am_eta" ),
1075  m_option_am_epsilon (m_prefix + "am_epsilon" ),
1076  m_option_enableBrooksGelmanConvMonitor (m_prefix + "enableBrooksGelmanConvMonitor" ),
1077  m_option_BrooksGelmanLag (m_prefix + "BrooksGelmanLag" ),
1078  m_option_outputLogLikelihood (m_prefix + "outputLogLikelihood" ),
1079  m_option_outputLogTarget (m_prefix + "outputLogTarget" ),
1080  m_option_doLogitTransform (m_prefix + "doLogitTransform" ),
1081  m_option_algorithm (m_prefix + "algorithm" ),
1082  m_option_tk (m_prefix + "tk" )
1083 {
1084  queso_deprecated();
1085 
1089  m_ov.m_totallyMute = mlOptions.m_totallyMute;
1097  m_ov.m_rawChainSize = mlOptions.m_rawChainSize;
1106 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1107  m_ov.m_rawChainComputeStats = mlOptions.m_rawChainComputeStats;
1108 #endif
1116 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1117  m_ov.m_filteredChainComputeStats = mlOptions.m_filteredChainComputeStats;
1118 #endif
1134  m_ov.m_amEta = mlOptions.m_amEta;
1135  m_ov.m_amEpsilon = mlOptions.m_amEpsilon;
1141  m_ov.m_algorithm = mlOptions.m_algorithm;
1142  m_ov.m_tk = mlOptions.m_tk;
1143 
1144 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1145 //m_ov.m_alternativeRawSsOptionsValues = mlOptions.; // dakota
1146 //m_ov.m_alternativeFilteredSsOptionsValues = mlOptions.; // dakota
1147 #endif
1148 
1149 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1150  m_rawChainStatisticalOptionsObj = mlOptions.m_rawChainStatisticalOptionsObj; // dakota
1151  m_rawChainStatOptsInstantiated = false;
1152  m_filteredChainStatisticalOptionsObj = mlOptions.m_filteredChainStatisticalOptionsObj; // dakota
1153  m_filteredChainStatOptsInstantiated = false;
1154 #endif
1155  if ((m_env.subDisplayFile() != NULL ) &&
1156  (m_ov.m_totallyMute == false)) {
1157  *m_env.subDisplayFile() << "In MetropolisHastingsSGOptions::constructor(3)"
1158  << ": after copying values of options with prefix '" << m_prefix
1159  << "', state of object is:"
1160  << "\n" << *this
1161  << std::endl;
1162  }
1163 }
1164 // Destructor --------------------------------------
1166 {
1167  queso_deprecated();
1168 
1169 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1170  if (m_filteredChainStatOptsInstantiated) delete m_filteredChainStatisticalOptionsObj;
1171  if (m_rawChainStatOptsInstantiated ) delete m_rawChainStatisticalOptionsObj;
1172 #endif
1173 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
1174  if (m_optionsDesc ) delete m_optionsDesc;
1175 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
1176 }
1177 
1178 // I/O methods -------------------------------------
1179 void
1181 {
1182  queso_deprecated();
1183 
1184 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
1185  queso_require_msg(m_optionsDesc, "m_optionsDesc variable is NULL");
1186 
1190 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
1191 
1192  if ((m_env.subDisplayFile() != NULL) &&
1193  (m_ov.m_totallyMute == false )) {
1194  *m_env.subDisplayFile() << "In MetropolisHastingsSGOptions::scanOptionsValues()"
1195  << ": after reading values of options with prefix '" << m_prefix
1196  << "', state of object is:"
1197  << "\n" << *this
1198  << std::endl;
1199  }
1200 
1201 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1202  if (m_ov.m_rawChainComputeStats) {
1203  m_rawChainStatisticalOptionsObj = new SequenceStatisticalOptions(m_env,m_prefix + "rawChain_");
1204  m_rawChainStatOptsInstantiated = true;
1205  }
1206  if (m_ov.m_filteredChainComputeStats) {
1207  m_filteredChainStatisticalOptionsObj = new SequenceStatisticalOptions(m_env,m_prefix + "filteredChain_");
1208  m_filteredChainStatOptsInstantiated = true;
1209  }
1210 #endif
1211 
1212  return;
1213 }
1214 // -------------------------------------------------
1215 void
1216 MetropolisHastingsSGOptions::print(std::ostream& os) const
1217 {
1218  queso_deprecated();
1219 
1222  << "\n" << m_option_dataOutputAllowedSet << " = ";
1223  for (std::set<unsigned int>::iterator setIt = m_ov.m_dataOutputAllowedSet.begin(); setIt != m_ov.m_dataOutputAllowedSet.end(); ++setIt) {
1224  os << *setIt << " ";
1225  }
1226  os << "\n" << m_option_totallyMute << " = " << m_ov.m_totallyMute
1231  << "\n" << m_option_listOfDisabledParameters << " = ";
1232  for (std::set<unsigned int>::iterator setIt = m_ov.m_parameterDisabledSet.begin(); setIt != m_ov.m_parameterDisabledSet.end(); ++setIt) {
1233  os << *setIt << " ";
1234  }
1237  << "\n" << m_option_rawChain_size << " = " << m_ov.m_rawChainSize
1245  << "\n" << m_option_rawChain_dataOutputAllowedSet << " = ";
1246  for (std::set<unsigned int>::iterator setIt = m_ov.m_rawChainDataOutputAllowedSet.begin(); setIt != m_ov.m_rawChainDataOutputAllowedSet.end(); ++setIt) {
1247  os << *setIt << " ";
1248  }
1249  os
1250 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1251  << "\n" << m_option_rawChain_computeStats << " = " << m_ov.m_rawChainComputeStats
1252 #endif
1255  << "\n" << m_option_filteredChain_lag << " = " << m_ov.m_filteredChainLag
1259  << "\n" << m_option_filteredChain_dataOutputAllowedSet << " = ";
1260  for (std::set<unsigned int>::iterator setIt = m_ov.m_filteredChainDataOutputAllowedSet.begin(); setIt != m_ov.m_filteredChainDataOutputAllowedSet.end(); ++setIt) {
1261  os << *setIt << " ";
1262  }
1263  os
1264 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1265  << "\n" << m_option_filteredChain_computeStats << " = " << m_ov.m_filteredChainComputeStats
1266 #endif
1267  << "\n" << m_option_displayCandidates << " = " << m_ov.m_displayCandidates
1272  << "\n" << m_option_dr_listOfScalesForExtraStages << " = ";
1273  for (unsigned int i = 0; i < m_ov.m_drScalesForExtraStages.size(); ++i) {
1274  os << m_ov.m_drScalesForExtraStages[i] << " ";
1275  }
1279  << "\n" << m_option_am_adaptInterval << " = " << m_ov.m_amAdaptInterval
1285  for (std::set<unsigned int>::iterator setIt = m_ov.m_amAdaptedMatricesDataOutputAllowedSet.begin(); setIt != m_ov.m_amAdaptedMatricesDataOutputAllowedSet.end(); ++setIt) {
1286  os << *setIt << " ";
1287  }
1288  os << "\n" << m_option_am_eta << " = " << m_ov.m_amEta
1289  << "\n" << m_option_am_epsilon << " = " << m_ov.m_amEpsilon
1291  << "\n" << m_option_BrooksGelmanLag << " = " << m_ov.m_BrooksGelmanLag
1293  << "\n" << m_option_outputLogTarget << " = " << m_ov.m_outputLogTarget
1294  << "\n" << m_option_doLogitTransform << " = " << m_ov.m_doLogitTransform
1295  << "\n" << m_option_algorithm << " = " << m_ov.m_algorithm
1296  << "\n" << m_option_tk << " = " << m_ov.m_tk
1297  << std::endl;
1298 
1299  return;
1300 }
1301 
1302 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
1303 // Private methods----------------------------------
1304 void
1305 MetropolisHastingsSGOptions::defineMyOptions(boost::program_options::options_description& optionsDesc) const
1306 {
1307  queso_deprecated();
1308 
1309  optionsDesc.add_options()
1310  (m_option_help.c_str(), "produce help msg for Bayesian Metropolis-Hastings" )
1311  (m_option_dataOutputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_DATA_OUTPUT_FILE_NAME_ODV ), "name of generic output file" )
1312  (m_option_dataOutputAllowAll.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_DATA_OUTPUT_ALLOW_ALL_ODV ), "allow all subEnvs write to a generic output file" )
1313  (m_option_dataOutputAllowedSet.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_DATA_OUTPUT_ALLOWED_SET_ODV ), "subEnvs that will write to generic output file" )
1314  (m_option_totallyMute.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_TOTALLY_MUTE_ODV ), "totally mute (no printout msg)" )
1315  (m_option_initialPosition_dataInputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV ), "name of input file for raw chain " )
1316  (m_option_initialPosition_dataInputFileType.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV ), "type of input file for raw chain " )
1317  (m_option_initialProposalCovMatrix_dataInputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV), "name of input file for raw chain " )
1318  (m_option_initialProposalCovMatrix_dataInputFileType.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV), "type of input file for raw chain " )
1319  (m_option_listOfDisabledParameters.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_LIST_OF_DISABLED_PARAMETERS_ODV ), "list of disabled parameters" )
1320  (m_option_rawChain_dataInputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV ), "name of input file for raw chain " )
1321  (m_option_rawChain_dataInputFileType.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV ), "type of input file for raw chain " )
1322  (m_option_rawChain_size.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_RAW_CHAIN_SIZE_ODV ), "size of raw chain" )
1323  (m_option_rawChain_generateExtra.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_RAW_CHAIN_GENERATE_EXTRA_ODV ), "generate extra information about raw chain" )
1324  (m_option_rawChain_displayPeriod.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_RAW_CHAIN_DISPLAY_PERIOD_ODV ), "period of msg display during raw chain generation" )
1325  (m_option_rawChain_measureRunTimes.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_RAW_CHAIN_MEASURE_RUN_TIMES_ODV ), "measure run times" )
1326  (m_option_rawChain_dataOutputPeriod.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV ), "period of msg display during raw chain generation" )
1327  (m_option_rawChain_dataOutputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV ), "name of output file for raw chain " )
1328  (m_option_rawChain_dataOutputFileType.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV ), "type of output file for raw chain " )
1329  (m_option_rawChain_dataOutputAllowAll.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV ), "allow all subEnvs to write raw chain to an output file" )
1330  (m_option_rawChain_dataOutputAllowedSet.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV ), "subEnvs that will write raw chain to output file" )
1331 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1332  (m_option_rawChain_computeStats.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_RAW_CHAIN_COMPUTE_STATS_ODV ), "compute statistics on raw chain" )
1333 #endif
1334  (m_option_filteredChain_generate.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_FILTERED_CHAIN_GENERATE_ODV ), "generate filtered chain" )
1335  (m_option_filteredChain_discardedPortion.c_str(), boost::program_options::value<double >()->default_value(UQ_MH_SG_FILTERED_CHAIN_DISCARDED_PORTION_ODV ), "initial discarded portion for chain filtering" )
1336  (m_option_filteredChain_lag.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_FILTERED_CHAIN_LAG_ODV ), "spacing for chain filtering" )
1337  (m_option_filteredChain_dataOutputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV ), "name of output file for filtered chain" )
1338  (m_option_filteredChain_dataOutputFileType.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV ), "type of output file for filtered chain" )
1339  (m_option_filteredChain_dataOutputAllowAll.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV ), "allow all subEnvs to write filt chain to an output file" )
1340  (m_option_filteredChain_dataOutputAllowedSet.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV ), "subEnvs that will write filt chain to output file" )
1341 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1342  (m_option_filteredChain_computeStats.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_FILTERED_CHAIN_COMPUTE_STATS_ODV ), "compute statistics on filtered chain" )
1343 #endif
1344  (m_option_displayCandidates.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_DISPLAY_CANDIDATES_ODV ), "display candidates in the core MH algorithm" )
1345  (m_option_putOutOfBoundsInChain.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV ), "put 'out of bound' candidates in chain as well" )
1346  (m_option_tk_useLocalHessian.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_TK_USE_LOCAL_HESSIAN_ODV ), "'proposal' use local Hessian" )
1347  (m_option_tk_useNewtonComponent.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_TK_USE_NEWTON_COMPONENT_ODV ), "'proposal' use Newton component" )
1348  (m_option_dr_maxNumExtraStages.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_DR_MAX_NUM_EXTRA_STAGES_ODV ), "'dr' maximum number of extra stages" )
1349  (m_option_dr_listOfScalesForExtraStages.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_DR_LIST_OF_SCALES_FOR_EXTRA_STAGES_ODV ), "'dr' scales for prop cov matrices from 2nd stage on" )
1350  (m_option_dr_duringAmNonAdaptiveInt.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_DR_DURING_AM_NON_ADAPTIVE_INT_ODV ), "'dr' used during 'am' non adaptive interval" )
1351  (m_option_am_keepInitialMatrix.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_AM_KEEP_INITIAL_MATRIX_ODV ), "'am' keep initial (given) matrix" )
1352  (m_option_am_initialNonAdaptInterval.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_AM_INIT_NON_ADAPT_INT_ODV ), "'am' initial non adaptation interval" )
1353  (m_option_am_adaptInterval.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_AM_ADAPT_INTERVAL_ODV ), "'am' adaptation interval" )
1354  (m_option_am_adaptedMatrices_dataOutputPeriod.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV ), "period for outputting 'am' adapted matrices" )
1355  (m_option_am_adaptedMatrices_dataOutputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV ), "name of output file for 'am' adapted matrices" )
1356  (m_option_am_adaptedMatrices_dataOutputFileType.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV ), "type of output file for 'am' adapted matrices" )
1357  (m_option_am_adaptedMatrices_dataOutputAllowAll.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV ), "type of output file for 'am' adapted matrices" )
1358  (m_option_am_adaptedMatrices_dataOutputAllowedSet.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOWED_SET_ODV ), "type of output file for 'am' adapted matrices" )
1359  (m_option_am_eta.c_str(), boost::program_options::value<double >()->default_value(UQ_MH_SG_AM_ETA_ODV ), "'am' eta" )
1360  (m_option_am_epsilon.c_str(), boost::program_options::value<double >()->default_value(UQ_MH_SG_AM_EPSILON_ODV ), "'am' epsilon" )
1361  (m_option_enableBrooksGelmanConvMonitor.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR ), "assess convergence using Brooks-Gelman metric" )
1362  (m_option_BrooksGelmanLag.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_BROOKS_GELMAN_LAG ), "number of chain positions before starting to compute metric")
1363  (m_option_outputLogLikelihood.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD ), "flag to toggle output of log likelihood values" )
1364  (m_option_outputLogTarget.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_OUTPUT_LOG_TARGET ), "flag to toggle output of log target values" )
1365  (m_option_doLogitTransform.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_DO_LOGIT_TRANSFORM ), "flag to toggle logit transform for bounded domains" )
1366  (m_option_algorithm.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_ALGORITHM ), "which mcmc algorithm to use" )
1367  (m_option_tk.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_TK ), "which mcmc tk to use" )
1368  ;
1369 
1370  return;
1371 }
1372 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
1373 
1374 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
1375 // -------------------------------------------------
1376 void
1377 MetropolisHastingsSGOptions::getMyOptionValues(boost::program_options::options_description& optionsDesc)
1378 {
1379  queso_deprecated();
1380 
1381  if (m_env.allOptionsMap().count(m_option_help)) {
1382  if ((m_env.subDisplayFile()) &&
1383  (m_ov.m_totallyMute == false)) {
1384  *m_env.subDisplayFile() << optionsDesc
1385  << std::endl;
1386  }
1387  }
1388 
1390  m_ov.m_dataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dataOutputFileName]).as<std::string>();
1391  }
1392 
1393  if (m_env.allOptionsMap().count(m_option_dataOutputAllowAll.c_str())) {
1395  }
1396 
1397  if (m_ov.m_dataOutputAllowAll) {
1399  }
1401  m_ov.m_dataOutputAllowedSet.clear();
1402  std::vector<double> tmpAllow(0,0.);
1403  std::string inputString = m_env.allOptionsMap()[m_option_dataOutputAllowedSet].as<std::string>();
1404  MiscReadDoublesFromString(inputString,tmpAllow);
1405 
1406  if (tmpAllow.size() > 0) {
1407  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
1408  m_ov.m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
1409  }
1410  }
1411  }
1412 
1413  if (m_env.allOptionsMap().count(m_option_totallyMute)) {
1414  m_ov.m_totallyMute = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_totallyMute]).as<bool>();
1415  }
1416 
1418  m_ov.m_initialPositionDataInputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_initialPosition_dataInputFileName]).as<std::string>();
1419  }
1420 
1422  m_ov.m_initialPositionDataInputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_initialPosition_dataInputFileType]).as<std::string>();
1423  }
1424 
1426  m_ov.m_initialProposalCovMatrixDataInputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_initialProposalCovMatrix_dataInputFileName]).as<std::string>();
1427  }
1428 
1430  m_ov.m_initialProposalCovMatrixDataInputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_initialProposalCovMatrix_dataInputFileType]).as<std::string>();
1431  }
1432 
1434  m_ov.m_parameterDisabledSet.clear();
1435  std::vector<double> tmpAllow(0,0.);
1436  std::string inputString = m_env.allOptionsMap()[m_option_listOfDisabledParameters].as<std::string>();
1437  MiscReadDoublesFromString(inputString,tmpAllow);
1438  if (tmpAllow.size() > 0) {
1439  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
1440  m_ov.m_parameterDisabledSet.insert((unsigned int) tmpAllow[i]);
1441  }
1442  }
1443  }
1444 
1446  m_ov.m_rawChainDataInputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_dataInputFileName]).as<std::string>();
1447  }
1448 
1450  m_ov.m_rawChainDataInputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_dataInputFileType]).as<std::string>();
1451  }
1452 
1454  m_ov.m_rawChainSize = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_size]).as<unsigned int>();
1455  }
1456 
1458  m_ov.m_rawChainDisplayPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_displayPeriod]).as<unsigned int>();
1459  }
1460 
1462  m_ov.m_rawChainMeasureRunTimes = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_measureRunTimes]).as<bool>();
1463  }
1464 
1466  m_ov.m_rawChainDataOutputPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_dataOutputPeriod]).as<unsigned int>();
1467  }
1468 
1470  m_ov.m_rawChainDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_dataOutputFileName]).as<std::string>();
1471  }
1472 
1474  m_ov.m_rawChainDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_dataOutputFileType]).as<std::string>();
1475  }
1476 
1479  }
1480 
1483  }
1486  std::vector<double> tmpAllow(0,0.);
1487  std::string inputString = m_env.allOptionsMap()[m_option_rawChain_dataOutputAllowedSet].as<std::string>();
1488  MiscReadDoublesFromString(inputString,tmpAllow);
1489 
1490  if (tmpAllow.size() > 0) {
1491  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
1492  m_ov.m_rawChainDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
1493  }
1494  }
1495  }
1496 
1497 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1498  if (m_env.allOptionsMap().count(m_option_rawChain_computeStats)) {
1499  m_ov.m_rawChainComputeStats = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_computeStats]).as<bool>();
1500  }
1501 #endif
1503  m_ov.m_rawChainGenerateExtra = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_generateExtra]).as<bool>();
1504  }
1505 
1507  m_ov.m_filteredChainGenerate = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_generate]).as<bool>();
1508  }
1509 
1511  m_ov.m_filteredChainDiscardedPortion = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_discardedPortion]).as<double>();
1512  }
1513 
1515  m_ov.m_filteredChainLag = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_lag]).as<unsigned int>();
1516  }
1517  if ((m_ov.m_filteredChainGenerate == true) &&
1518  (m_ov.m_filteredChainLag < 2 )) {
1519  std::cerr << "WARNING In MetropolisHastingsSG<P_V,P_M>::getMyOptionsValues()"
1520  << ", worldRank " << m_env.worldRank()
1521  << ", fullRank " << m_env.fullRank()
1522  << ", subEnvironment " << m_env.subId()
1523  << ", subRank " << m_env.subRank()
1524  << ", inter0Rank " << m_env.inter0Rank()
1525  << ": forcing the value of '" << m_option_filteredChain_lag
1526  << "' from " << m_ov.m_filteredChainLag
1527  << " to " << 2
1528  << std::endl;
1530  }
1531 
1533  m_ov.m_filteredChainDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_dataOutputFileName]).as<std::string>();
1534  }
1535 
1537  m_ov.m_filteredChainDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_dataOutputFileType]).as<std::string>();
1538  }
1539 
1542  }
1543 
1546  }
1549  std::vector<double> tmpAllow(0,0.);
1550  std::string inputString = m_env.allOptionsMap()[m_option_filteredChain_dataOutputAllowedSet].as<std::string>();
1551  MiscReadDoublesFromString(inputString,tmpAllow);
1552 
1553  if (tmpAllow.size() > 0) {
1554  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
1555  m_ov.m_filteredChainDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
1556  }
1557  }
1558  }
1559 
1560 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1561  if (m_env.allOptionsMap().count(m_option_filteredChain_computeStats)) {
1562  m_ov.m_filteredChainComputeStats = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_computeStats]).as<bool>();
1563  }
1564 #endif
1566  m_ov.m_displayCandidates = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_displayCandidates]).as<bool>();
1567  }
1568 
1570  m_ov.m_putOutOfBoundsInChain = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_putOutOfBoundsInChain]).as<bool>();
1571  }
1572 
1574  m_ov.m_tkUseLocalHessian = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_tk_useLocalHessian]).as<bool>();
1575  }
1576 
1578  m_ov.m_tkUseNewtonComponent = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_tk_useNewtonComponent]).as<bool>();
1579  }
1580 
1582  m_ov.m_drMaxNumExtraStages = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dr_maxNumExtraStages]).as<unsigned int>();
1583  }
1584 
1585  std::vector<double> tmpScales(0,0.);
1587  std::string inputString = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dr_listOfScalesForExtraStages]).as<std::string>();
1588  MiscReadDoublesFromString(inputString,tmpScales);
1589  //if (m_env.subDisplayFile()) {
1590  // *m_env.subDisplayFile() << "In MetropolisHastingsSG<P_V,P_M>::getMyOptionValues(): scales =";
1591  // for (unsigned int i = 0; i < tmpScales.size(); ++i) {
1592  // *m_env.subDisplayFile() << " " << tmpScales[i];
1593  // }
1594  // *m_env.subDisplayFile() << std::endl;
1595  //}
1596  }
1597 
1598  if (m_ov.m_drMaxNumExtraStages > 0) {
1599  double scale = 1.0;
1600  unsigned int tmpSize = tmpScales.size();
1601 
1604  for (unsigned int i = 0; i < m_ov.m_drMaxNumExtraStages; ++i) {
1605  if (i < tmpSize) scale = tmpScales[i];
1607  }
1608  //updateTK();
1609  }
1610 
1612  m_ov.m_drDuringAmNonAdaptiveInt = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dr_duringAmNonAdaptiveInt]).as<bool>();
1613  }
1614 
1616  m_ov.m_amKeepInitialMatrix = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_keepInitialMatrix]).as<bool>();
1617  }
1618 
1620  m_ov.m_amInitialNonAdaptInterval = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_initialNonAdaptInterval]).as<unsigned int>();
1621  }
1622 
1624  m_ov.m_amAdaptInterval = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_adaptInterval]).as<unsigned int>();
1625  }
1626 
1628  m_ov.m_amAdaptedMatricesDataOutputPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_adaptedMatrices_dataOutputPeriod]).as<unsigned int>();
1629  }
1630 
1632  m_ov.m_amAdaptedMatricesDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_adaptedMatrices_dataOutputFileName]).as<std::string>();
1633  }
1634 
1636  m_ov.m_amAdaptedMatricesDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_adaptedMatrices_dataOutputFileType]).as<std::string>();
1637  }
1638 
1641  }
1642 
1645  }
1648  std::vector<double> tmpAllow(0,0.);
1649  std::string inputString = m_env.allOptionsMap()[m_option_am_adaptedMatrices_dataOutputAllowedSet].as<std::string>();
1650  MiscReadDoublesFromString(inputString,tmpAllow);
1651 
1652  if (tmpAllow.size() > 0) {
1653  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
1654  m_ov.m_amAdaptedMatricesDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
1655  }
1656  }
1657  }
1658 
1659  if (m_env.allOptionsMap().count(m_option_am_eta)) {
1660  m_ov.m_amEta = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_eta]).as<double>();
1661  }
1662 
1663  if (m_env.allOptionsMap().count(m_option_am_epsilon)) {
1664  m_ov.m_amEpsilon = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_epsilon]).as<double>();
1665  }
1666 
1668  m_ov.m_enableBrooksGelmanConvMonitor = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_enableBrooksGelmanConvMonitor]).as<unsigned int>();
1669  }
1670 
1672  m_ov.m_BrooksGelmanLag = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_BrooksGelmanLag]).as<unsigned int>();
1673  }
1674 
1676  m_ov.m_outputLogLikelihood = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_outputLogLikelihood]).as<bool>();
1677  }
1678 
1680  m_ov.m_outputLogTarget = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_outputLogTarget]).as<bool>();
1681  }
1682 
1684  m_ov.m_doLogitTransform = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_doLogitTransform]).as<bool>();
1685  }
1686 
1687  if (m_env.allOptionsMap().count(m_option_algorithm)) {
1688  m_ov.m_algorithm = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_algorithm]).as<std::string>();
1689  }
1690 
1691  if (m_env.allOptionsMap().count(m_option_tk)) {
1692  m_ov.m_tk = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_tk]).as<std::string>();
1693  }
1694 }
1695 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
1696 
1697 // --------------------------------------------------
1698 // Operator declared outside class definition ------
1699 // --------------------------------------------------
1700 
1701 std::ostream& operator<<(std::ostream& os, const MetropolisHastingsSGOptions& obj)
1702 {
1703  queso_deprecated();
1704 
1705  obj.print(os);
1706 
1707  return os;
1708 }
1709 
1710 } // End namespace QUESO
#define UQ_MH_SG_TOTALLY_MUTE_ODV
#define UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV
MhOptionsValues & operator=(const MhOptionsValues &rhs)
Assignment operator; it copies rhs to this.
double m_filteredChainDiscardedPortion
Initial discarded portion for chain filtering.
double m_filteredChainDiscardedPortion
What initial fraction of the filtered chain is discarded.
virtual ~MhOptionsValues()
Destructor.
std::vector< double > m_drScalesForExtraStages
The vector of scale factors for the proposal covariance matrix to use for delayed rejection...
bool m_displayCandidates
Toggle to tell QUESO whether or not to write proposal (candidate) state to output file...
std::string m_rawChainDataOutputFileName
If not &quot;.&quot;, filename to write the Markov chain to.
#define UQ_MH_SG_RAW_CHAIN_GENERATE_EXTRA_ODV
bool m_totallyMute
If true, zero output is written to files. Default is false.
bool m_putOutOfBoundsInChain
Flag to tell QUESO how chains should be upon generating a proposal that is out of the problem domain...
std::set< unsigned int > m_amAdaptedMatricesDataOutputAllowedSet
This option is a no-op. The default is the empty set.
std::string m_option_rawChain_dataInputFileType
Option name for MhOptionsValues::m_rawChainDataInputFileType. Option name is m_prefix + &quot;mh_rawChain_...
double m_amEta
&#39;am&#39; eta.
bool m_drDuringAmNonAdaptiveInt
Whether or not &#39;dr&#39; is used during &#39;am&#39; non adaptive interval.
MhOptionsValues m_ov
This class is where the actual options are stored.
bool m_filteredChainGenerate
Whether or not to generate filtered chain.
std::string m_option_initialProposalCovMatrix_dataInputFileName
Option name for MhOptionsValues::m_initialProposalCovMatrixDataInputFileName. Option name is m_prefix...
unsigned int m_rawChainDataOutputPeriod
The frequency with which to write chain output. Defaults to 0.
double m_amEpsilon
&#39;am&#39; epsilon.
bool m_rawChainGenerateExtra
Generate extra information about raw chain.
#define UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV
int worldRank() const
Returns the process world rank.
Definition: Environment.C:262
std::string m_filteredChainDataOutputFileName
If not &quot;.&quot;, file name to save the filtered chain to. Default is &quot;.&quot;.
std::string m_option_rawChain_measureRunTimes
Option name for MhOptionsValues::m_rawChainMeasureRunTimes. Option name is m_prefix + &quot;mh_rawChain_me...
std::string m_rawChainDataOutputFileType
The filetype of m_rawChainDataOutputFileName.
#define UQ_MH_SG_RAW_CHAIN_MEASURE_RUN_TIMES_ODV
#define UQ_MH_SG_LIST_OF_DISABLED_PARAMETERS_ODV
bool m_drDuringAmNonAdaptiveInt
Do delayed rejection during the initial non-adaptive part of sampling?
#define UQ_MH_SG_TK_USE_LOCAL_HESSIAN_ODV
void checkOptions(const BaseEnvironment *env)
const GetPot & input() const
The GetPot input file parser.
Definition: Environment.C:1148
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320
std::string m_option_listOfDisabledParameters
Option name for MhOptionsValues::m_parameterDisabledSet. Option name is m_prefix + &quot;mh_listOfDisabled...
#define queso_require_greater_equal_msg(expr1, expr2, msg)
Definition: asserts.h:78
std::string m_option_am_eta
See MhOptionsValues::m_amEta.
std::string m_option_BrooksGelmanLag
Option name for MhOptionsValues::m_BrooksGelmanLag. Option name is m_prefix + &quot;mh_BrooksGelmanLag&quot;.
std::string m_initialPositionDataInputFileName
If not &quot;.&quot;, reads the contents of the file and uses that to start the MCMC. Default is &quot;...
int subRank() const
Access function for sub-rank.
Definition: Environment.C:287
std::string m_option_dr_listOfScalesForExtraStages
Option name for MhOptionsValues::m_drScalesForExtraStages. Option name is m_prefix + &quot;mh_dr_listOfSca...
unsigned int m_BrooksGelmanLag
The lag with which to compute the Brooks-Gelman convergence statistic.
bool m_putOutOfBoundsInChain
Put &#39;out of bound&#39; candidates in chain as well.
std::string m_initialProposalCovMatrixDataInputFileType
Type of input file for initial proposal covariance matrix.
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:353
std::string m_dataOutputFileName
Name of generic output file.
std::string m_tk
Which transition kernel to use for sampling.
#define UQ_MH_SG_DR_MAX_NUM_EXTRA_STAGES_ODV
std::string m_option_putOutOfBoundsInChain
Option name for MhOptionsValues::m_putOutOfBoundsInChain. Option name is m_prefix + &quot;mh_putOutOfBound...
#define UQ_MH_SG_OUTPUT_LOG_TARGET
#define UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV
#define UQ_MH_SG_AM_ADAPT_INTERVAL_ODV
This class reads the options for the Metropolis-Hastings generator of samples from an input file...
#define UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV
bool m_outputLogTarget
Flag for deciding whether or not to dump log target values in output Default is true.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:197
std::string m_option_totallyMute
Option name for MhOptionsValues::m_totallyMute. Option name is m_prefix + &quot;mh_totallyMute&quot;.
unsigned int m_rawChainDisplayPeriod
The frequency with which to output diagnostic information.
double scale
Definition: ann2fig.cpp:85
#define UQ_MH_SG_DR_LIST_OF_SCALES_FOR_EXTRA_STAGES_ODV
#define UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV
std::string m_initialProposalCovMatrixDataInputFileName
If not &quot;.&quot;, reads the contents of the file as the initial proposal covariance matrix.
#define UQ_MH_SG_FILTERED_CHAIN_LAG_ODV
std::string m_option_am_epsilon
See MhOptionsValues::m_amEpsilon.
std::string m_option_am_eta
Option name for MhOptionsValues::m_amEta. Option name is m_prefix + &quot;mh_am_eta&quot;.
unsigned int m_enableBrooksGelmanConvMonitor
The frequency with which to compute the Brooks-Gelman convergence statistic.
int inter0Rank() const
Returns the process inter0 rank.
Definition: Environment.C:307
std::set< unsigned int > m_rawChainDataOutputAllowedSet
subEnvs that will write to output file for raw chain.
std::string m_option_rawChain_displayPeriod
Option name for MhOptionsValues::m_rawChainDisplayPeriod. Option name is m_prefix + &quot;mh_rawChain_disp...
std::string m_option_tk
Option name for MhOptionsValues::m_tk. Option name is m_prefix + &quot;mh_tk&quot;.
std::string m_option_algorithm
Option name for MhOptionsValues::m_algorithm. Option name is m_prefix + &quot;mh_algorithm&quot;.
std::string m_option_filteredChain_generate
Option name for MhOptionsValues::m_filteredChainGenerate. Option name is m_prefix + &quot;mh_filteredChain...
unsigned int m_rawChainSize
Size of raw chain.
std::string m_initialPositionDataInputFileType
Type of input file for initial position.
bool m_tkUseLocalHessian
Flag to tell QUESO whether or not to use Hessian information for the proposal covariance matrix...
unsigned int m_filteredChainLag
Spacing for chain filtering.
std::string m_dataOutputFileName
The base name of output files where the chain (and related information) will be written.
std::set< unsigned int > m_amAdaptedMatricesDataOutputAllowedSet
subEnvs that will write to output file for &#39;am&#39; adapted matrices.
std::string m_option_am_adaptedMatrices_dataOutputFileType
Option name for MhOptionsValues::m_amAdaptedMatricesDataOutputFileType. Option name is m_prefix + &quot;mh...
unsigned vector_variable_size(const char *VarName) const
Definition: getpot.h:2532
bool m_filteredChainDataOutputAllowAll
Toggle for whether or not to allow all processes to write filtered Markov chain output to a file...
void getOption(std::string &name, T &value)
Get option name from the parser and set value to the parsed value.
std::set< unsigned int > m_parameterDisabledSet
Set of parameters that don&#39;t get sampled.
bool m_filteredChainGenerate
Toggle the option to save a filtered chain.
bool m_dataOutputAllowAll
subEnvs that will write to generic output file.
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
bool m_doLogitTransform
Whether or not a logit transform will be done for bounded domains.
std::string m_amAdaptedMatricesDataOutputFileType
Type of output file for &#39;am&#39; adapted matrices.
boost::program_options::variables_map & allOptionsMap() const
Definition: Environment.C:385
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
Definition: Miscellaneous.C:40
std::string m_option_help
Option name for MhOptionsValues::m_help. Option name is m_prefix + &quot;mh_help&quot;.
std::string m_option_rawChain_dataOutputAllowedSet
Option name for MhOptionsValues::m_rawChainDataOutputAllowedSet. Option name is m_prefix + &quot;mh_rawCha...
std::string m_option_enableBrooksGelmanConvMonitor
Option name for MhOptionsValues::m_enableBrooksGelmanConvMonitor. Option name is m_prefix + &quot;mh_enabl...
std::string m_option_outputLogTarget
Option name for MhOptionsValues::m_outputLogTarget. Option name is m_prefix + &quot;mh_outputLogTarget&quot;.
#define UQ_MH_SG_ALGORITHM
#define UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV
#define UQ_MH_SG_FILTERED_CHAIN_DISCARDED_PORTION_ODV
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the sequence options defined to the Metropolis-Hastings algorithm.
#define UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV
bool m_tkUseNewtonComponent
Whether or not &#39;proposal&#39; uses Newton component.
#define UQ_MH_SG_DR_DURING_AM_NON_ADAPTIVE_INT_ODV
unsigned int subId() const
Access function to the number of each sub-environment Id: m_subId.
Definition: Environment.C:341
#define UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV
std::string m_option_am_adaptedMatrices_dataOutputAllowAll
Option name for MhOptionsValues::m_amAdaptedMatricesDataOutputAllowAll. Option name is m_prefix + &quot;mh...
bool m_rawChainMeasureRunTimes
Whether or not to measure run times.
std::string m_rawChainDataInputFileType
The filetype of m_rawChainDataInputFileName. Only &quot;m&quot; (matlab) is currently supported. Default is &quot;m&quot;.
std::string m_amAdaptedMatricesDataOutputFileName
If not &quot;.&quot;, this is the file to write adapted proposal covariance matrices to. Default is &quot;...
#define UQ_MH_SG_RAW_CHAIN_DISPLAY_PERIOD_ODV
std::string m_option_dataOutputFileName
Option name for MhOptionsValues::m_dataOutputFileName. Option name is m_prefix + &quot;mh_dataOutputFileNa...
std::string m_initialProposalCovMatrixDataInputFileType
The filetype of m_initialProposalCovMatrixDataInputFileName. Only &quot;m&quot; (matlab) is currently supported...
#define queso_deprecated()
Definition: Defines.h:134
std::string m_option_filteredChain_dataOutputAllowAll
Option name for MhOptionsValues::m_filteredChainDataOutputAllowAll. Option name is m_prefix + &quot;mh_fil...
std::string m_option_rawChain_generateExtra
Option name for MhOptionsValues::m_rawChainGenerateExtra. Option name is m_prefix + &quot;mh_rawChain_gene...
std::string m_option_rawChain_dataOutputFileType
Option name for MhOptionsValues::m_rawChainDataOutputFileType. Option name is m_prefix + &quot;mh_rawChain...
#define UQ_MH_SG_DO_LOGIT_TRANSFORM
unsigned int m_amInitialNonAdaptInterval
The number of initial samples to do without adapting the proposal covariance matrix.
std::string m_option_tk_useLocalHessian
Option name for MhOptionsValues::m_tkUseLocalHessian. Option name is m_prefix + &quot;mh_tk_useLocalHessia...
std::string m_option_am_adaptedMatrices_dataOutputFileName
Option name for MhOptionsValues::m_amAdaptedMatricesDataOutputFileName. Option name is m_prefix + &quot;mh...
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
#define UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV
unsigned int m_drMaxNumExtraStages
&#39;dr&#39; maximum number of extra stages.
std::string m_option_doLogitTransform
Option name for MhOptionsValues::m_doLogitTransform. Option name is m_prefix + &quot;mh_doLogitTransform&quot;...
std::string m_option_dataOutputAllowAll
Option name for MhOptionsValues::m_dataOutputAllowAll. Option name is m_prefix + &quot;mh_dataOutputAllowA...
std::set< unsigned int > m_parameterDisabledSet
MhOptionsValues()
Default constructor.
std::string m_tk
Which transition kernel to use for MCMC. Default is &quot;random_walk&quot;.
std::string m_option_dataOutputAllowedSet
Option name for MhOptionsValues::m_dataOutputAllowedSet. Option name is m_prefix + &quot;mh_dataOutputAllo...
bool m_totallyMute
Whether or not to be totally mute (no printout message).
bool m_tkUseLocalHessian
Whether or not &#39;proposal&#39; uses local Hessian.
void scanInputFileForMyOptions(const boost::program_options::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
Definition: Environment.C:396
#define UQ_MH_SG_HELP
void scanInputFile()
This is the method that parses the input file.
#define UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD
#define UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV
#define UQ_MH_SG_RAW_CHAIN_SIZE_ODV
std::string m_rawChainDataOutputFileName
Name of output file for raw chain.
std::string m_algorithm
Which algorithm to use for the MCMC. Default is &quot;random_walk&quot;.
std::string m_option_am_epsilon
Option name for MhOptionsValues::m_amEpsilon. Option name is m_prefix + &quot;mh_am_epsilon&quot;.
bool m_outputLogLikelihood
Flag for deciding whether or not to dump log likelihood values in output. Default is true...
This class provides options for each level of the Multilevel sequence generator if no input file is a...
unsigned int m_drMaxNumExtraStages
The number of delayed rejection stages to do. Default is 0.
#define UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_MH_SG_FILTERED_CHAIN_GENERATE_ODV
std::string m_option_displayCandidates
Option name for MhOptionsValues::m_displayCandidates. Option name is m_prefix + &quot;mh_displayCandidates...
#define UQ_MH_SG_DISPLAY_CANDIDATES_ODV
int fullRank() const
Returns the process full rank.
Definition: Environment.C:268
std::string m_help
If non-empty string, print options and values to the output file.
#define UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV
std::string m_rawChainDataInputFileType
Type of input file for raw chain.
std::string m_initialPositionDataInputFileType
The filetype of m_initialPositionDataInputFileName. Only &quot;m&quot; (matlab) is currently supported...
#define UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV
#define UQ_MH_SG_BROOKS_GELMAN_LAG
std::string m_rawChainDataInputFileName
Filename for reading an already-produced Markov chain.
void scanOptionsValues()
It scans the option values from the options input file.
std::string m_option_am_initialNonAdaptInterval
Option name for MhOptionsValues::m_amInitialNonAdaptInterval. Option name is m_prefix + &quot;mh_am_initia...
#define UQ_MH_SG_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV
std::string m_option_outputLogLikelihood
Option name for MhOptionsValues::m_outputLogLikelihood. Option name is m_prefix + &quot;mh_outputLogLikeli...
std::string m_filteredChainDataOutputFileType
The filetype of m_filteredChainDataOutputFileName. Only &quot;m&quot; (matlab) is currently supported...
bool m_displayCandidates
Display candidates generated in the core MH algorithm.
std::string m_option_rawChain_dataOutputFileName
Option name for MhOptionsValues::m_rawChainDataOutputFileName. Option name is m_prefix + &quot;mh_rawChain...
std::set< unsigned int > m_dataOutputAllowedSet
subEnvs that will write to generic output file.
std::string m_option_initialPosition_dataInputFileType
Option name for MhOptionsValues::m_initialPositionDataInputFileType. Option name is m_prefix + &quot;mh_in...
std::vector< double > m_drScalesForExtraStages
&#39;dr&#39; list of scales for proposal covariance matrices from 2nd stage on.
std::string m_option_filteredChain_dataOutputAllowedSet
Option name for MhOptionsValues::m_filteredChainDataOutputAllowedSet. Option name is m_prefix + &quot;mh_f...
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:74
std::string m_option_filteredChain_discardedPortion
Option name for MhOptionsValues::m_filteredChainDiscardedPortion. Option name is m_prefix + &quot;mh_filte...
boost::program_options::options_description * m_optionsDesc
bool m_dataOutputAllowAll
If true, all processes write output and m_dataOutputAllowedSet is ignored.
bool m_rawChainGenerateExtra
If true, extra chain information is computed/stored.
#define UQ_MH_SG_DATA_OUTPUT_ALLOWED_SET_ODV
std::string m_amAdaptedMatricesDataOutputFileType
The filetype of m_amAdaptedMatricesDataOutputFileName. Only &quot;m&quot; (matlab) is currently supported...
#define UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV
MetropolisHastingsSGOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
std::string m_filteredChainDataOutputFileType
Type of output file for filtered chain.
bool m_rawChainDataOutputAllowAll
Toggle for whether or not to allow all processes to write Markov chain output to a file...
std::string m_option_tk_useNewtonComponent
Option name for MhOptionsValues::m_tkUseNewtonComponent. Option name is m_prefix + &quot;mh_tk_useNewtonCo...
#define UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV
std::string m_filteredChainDataOutputFileName
Name of output file for filtered chain.
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
#define UQ_MH_SG_AM_KEEP_INITIAL_MATRIX_ODV
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
std::string m_option_initialProposalCovMatrix_dataInputFileType
Option name for MhOptionsValues::m_initialProposalCovMatrixDataInputFileType. Option name is m_prefix...
#define UQ_MH_SG_TK_USE_NEWTON_COMPONENT_ODV
std::string m_option_initialPosition_dataInputFileName
Option name for MhOptionsValues::m_initialPositionDataInputFileName. Option name is m_prefix + &quot;mh_in...
std::string m_rawChainDataOutputFileType
Type of output file for raw chain.
unsigned int m_filteredChainLag
Set the lag for the filtered chain. Default is 1.
std::string m_initialProposalCovMatrixDataInputFileName
Name of input file for initial proposal covariance matrix.
unsigned int m_rawChainDataOutputPeriod
Period of message display during raw chain generation.
double m_amEta
Proposal covariance scaling factor, usually 2.4 * 2.4 / d.
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Defines the options for the Metropolis-Hastings generator of samples as the default options...
#define UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV
std::set< unsigned int > m_dataOutputAllowedSet
The set of MPI ranks that can write output. See m_dataOutputAllowAll.
bool m_tkUseNewtonComponent
This option is a no-op. Default is true.
#define UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV
unsigned int m_rawChainSize
The size of the chain (number of posterior samples) to generate. Default is 100.
unsigned int m_rawChainDisplayPeriod
Period of message display during raw chain generation.
void print(std::ostream &os) const
It prints the option values.
std::string m_option_dr_maxNumExtraStages
Option name for MhOptionsValues::m_drMaxNumExtraStages. Option name is m_prefix + &quot;mh_dr_maxNumExtraS...
#define UQ_MH_SG_TK
BoostInputOptionsParser * m_parser
std::set< unsigned int > m_filteredChainDataOutputAllowedSet
subEnvs that will write to output file for filtered chain.
#define queso_error_msg(msg)
Definition: asserts.h:47
This class provides options for the Metropolis-Hastings generator of samples if no input file is avai...
unsigned int m_amAdaptInterval
&#39;am&#39; adaptation interval.
std::string m_option_dr_duringAmNonAdaptiveInt
Option name for MhOptionsValues::m_drDuringAmNonAdaptiveInt. Option name is m_prefix + &quot;mh_dr_duringA...
std::set< unsigned int > m_filteredChainDataOutputAllowedSet
The set of MPI ranks that will write filtered Markov chain output to a file. See also m_filteredChain...
#define UQ_MH_SG_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_MH_SG_AM_EPSILON_ODV
bool m_amAdaptedMatricesDataOutputAllowAll
This option is a no-op. The default is false.
std::string m_option_rawChain_dataOutputPeriod
Option name for MhOptionsValues::m_rawChainDataOutputPeriod. Option name is m_prefix + &quot;mh_rawChain_d...
unsigned int m_amAdaptedMatricesDataOutputPeriod
Period for outputing &#39;am&#39; adapted matrices.
#define UQ_MH_SG_AM_INIT_NON_ADAPT_INT_ODV
std::string m_option_rawChain_dataOutputAllowAll
Option name for MhOptionsValues::m_rawChainDataOutputAllowAll. Option name is m_prefix + &quot;mh_rawChain...
bool m_rawChainMeasureRunTimes
If true, measures timings spent in various chain computions and writes them to the output file...
#define UQ_MH_SG_AM_ETA_ODV
std::string m_amAdaptedMatricesDataOutputFileName
Name of output file for &#39;am&#39; adapted matrices.
std::string m_rawChainDataInputFileName
Name of input file for raw chain.
bool m_amAdaptedMatricesDataOutputAllowAll
Whether or not subEnvs will write to output file for &#39;am&#39; adapted matrices.
std::string m_option_am_adaptedMatrices_dataOutputPeriod
Option name for MhOptionsValues::m_amAdaptedMatricesDataOutputPeriod. Option name is m_prefix + &quot;mh_a...
#define UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR
bool m_rawChainDataOutputAllowAll
Whether or not subEnvs will write to output file for raw chain.
double m_amEpsilon
Regularisation parameter for the DRAM covariance matrix.
bool m_doLogitTransform
Flag for deciding whether or not to do logit transform of bounded domains Default is true...
std::set< unsigned int > m_rawChainDataOutputAllowedSet
The set of MPI ranks that will write Markov chain output to a file. See also m_rawChainDataOutputAllo...
#define UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV
std::string m_option_am_keepInitialMatrix
Option name for MhOptionsValues::m_amKeepInitialMatrix. Option name is m_prefix + &quot;mh_am_keepInitialM...
std::string m_algorithm
Which algorithm to use for sampling.
std::string m_option_filteredChain_lag
Option name for MhOptionsValues::m_filteredChainLag. Option name is m_prefix + &quot;mh_filteredChain_lag&quot;...
#define UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOWED_SET_ODV
unsigned int m_amAdaptInterval
The frequency at which to adapt the proposal covariance matrix.
std::string m_initialPositionDataInputFileName
Name of input file for initial position.
std::string m_option_am_adaptedMatrices_dataOutputAllowedSet
Option name for MhOptionsValues::m_amAdaptedMatricesDataOutputAllowedSet. Option name is m_prefix + &quot;...
bool m_filteredChainDataOutputAllowAll
Whether or not subEnvs will write to output file for filtered chain.
std::string m_option_filteredChain_dataOutputFileType
Option name for MhOptionsValues::m_filteredChainDataOutputFileType. Option name is m_prefix + &quot;mh_fil...
bool m_amKeepInitialMatrix
This option is a no-op. The default is false.
void copy(const MhOptionsValues &src)
Copies the option values from src to this.
std::string m_option_am_adaptInterval
Option name for MhOptionsValues::m_amAdaptInterval. Option name is m_prefix + &quot;mh_am_adaptInterval&quot;.
std::string m_option_rawChain_size
Option name for MhOptionsValues::m_rawChainSize. Option name is m_prefix + &quot;mh_rawChain_size&quot;.
bool m_amKeepInitialMatrix
Whether or not &#39;am&#39; will keep initial (given) matrix.
unsigned int m_amInitialNonAdaptInterval
&#39;am&#39; initial non adaptation interval
#define UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV
unsigned int m_amAdaptedMatricesDataOutputPeriod
The frequency (after m_amInitialNonAdaptInterval samples are done) of printing the last adapted propo...
std::string m_option_rawChain_dataInputFileName
Option name for MhOptionsValues::m_rawChainDataInputFileName. Option name is m_prefix + &quot;mh_rawChain_...
#define UQ_MH_SG_DATA_OUTPUT_ALLOW_ALL_ODV
std::string m_option_filteredChain_dataOutputFileName
Option name for MhOptionsValues::m_filteredChainDataOutputFileName. Option name is m_prefix + &quot;mh_fil...

Generated on Thu Dec 15 2016 13:23:11 for queso-0.56.1 by  doxygen 1.8.5