queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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-2017 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #include <queso/Environment.h>
26 
27 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
28 #include <boost/program_options.hpp>
29 #else
30 #include <queso/getpot.h>
31 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
32 
33 #include <queso/MetropolisHastingsSGOptions.h>
34 #include <queso/Miscellaneous.h>
35 
36 // -------------------------------------------------
37 // MhOptionsValues --------------------------
38 // -------------------------------------------------
39 
40 namespace QUESO {
41 
42 // Default constructor -----------------------------
44 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
45  const SsOptionsValues* alternativeRawSsOptionsValues,
46  const SsOptionsValues* alternativeFilteredSsOptionsValues
47 #endif
48  )
49  :
50  m_prefix ("mh_"),
51  m_help(UQ_MH_SG_HELP),
52  m_dataOutputFileName (UQ_MH_SG_DATA_OUTPUT_FILE_NAME_ODV),
53  m_dataOutputAllowAll (UQ_MH_SG_DATA_OUTPUT_ALLOW_ALL_ODV),
54  //m_dataOutputAllowedSet (),
55  m_totallyMute (UQ_MH_SG_TOTALLY_MUTE_ODV),
56  m_initialPositionDataInputFileName (UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV),
57  m_initialPositionDataInputFileType (UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV),
58  m_initialProposalCovMatrixDataInputFileName(UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV),
59  m_initialProposalCovMatrixDataInputFileType(UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV),
60  //m_parameterDisabledSet (),
61  m_rawChainDataInputFileName (UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV),
62  m_rawChainDataInputFileType (UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV),
63  m_rawChainSize (UQ_MH_SG_RAW_CHAIN_SIZE_ODV),
64  m_rawChainGenerateExtra (UQ_MH_SG_RAW_CHAIN_GENERATE_EXTRA_ODV),
65  m_rawChainDisplayPeriod (UQ_MH_SG_RAW_CHAIN_DISPLAY_PERIOD_ODV),
66  m_rawChainMeasureRunTimes (UQ_MH_SG_RAW_CHAIN_MEASURE_RUN_TIMES_ODV),
67  m_rawChainDataOutputPeriod (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV),
68  m_rawChainDataOutputFileName (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV),
69  m_rawChainDataOutputFileType (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV),
70  m_rawChainDataOutputAllowAll (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV),
71  //m_rawChainDataOutputAllowedSet (),
72 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
73  m_rawChainComputeStats (UQ_MH_SG_RAW_CHAIN_COMPUTE_STATS_ODV),
74 #endif
75  m_filteredChainGenerate (UQ_MH_SG_FILTERED_CHAIN_GENERATE_ODV),
76  m_filteredChainDiscardedPortion (UQ_MH_SG_FILTERED_CHAIN_DISCARDED_PORTION_ODV),
77  m_filteredChainLag (UQ_MH_SG_FILTERED_CHAIN_LAG_ODV),
78  m_filteredChainDataOutputFileName (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV),
79  m_filteredChainDataOutputFileType (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV),
80  m_filteredChainDataOutputAllowAll (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV),
81  //m_filteredChainDataOutputAllowedSet (),
82 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
83  m_filteredChainComputeStats (UQ_MH_SG_FILTERED_CHAIN_COMPUTE_STATS_ODV),
84 #endif
85  m_displayCandidates (UQ_MH_SG_DISPLAY_CANDIDATES_ODV),
86  m_putOutOfBoundsInChain (UQ_MH_SG_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV),
87  m_tkUseLocalHessian (UQ_MH_SG_TK_USE_LOCAL_HESSIAN_ODV),
88  m_tkUseNewtonComponent (UQ_MH_SG_TK_USE_NEWTON_COMPONENT_ODV),
89  m_drMaxNumExtraStages (UQ_MH_SG_DR_MAX_NUM_EXTRA_STAGES_ODV),
90  m_drScalesForExtraStages (0),
91  m_drDuringAmNonAdaptiveInt (UQ_MH_SG_DR_DURING_AM_NON_ADAPTIVE_INT_ODV),
92  m_amKeepInitialMatrix (UQ_MH_SG_AM_KEEP_INITIAL_MATRIX_ODV),
93  m_amInitialNonAdaptInterval (UQ_MH_SG_AM_INIT_NON_ADAPT_INT_ODV),
94  m_amAdaptInterval (UQ_MH_SG_AM_ADAPT_INTERVAL_ODV),
95  m_amAdaptedMatricesDataOutputPeriod (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV),
96  m_amAdaptedMatricesDataOutputFileName (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV),
97  m_amAdaptedMatricesDataOutputFileType (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV),
98  m_amAdaptedMatricesDataOutputAllowAll (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV),
99  //m_amAdaptedMatricesDataOutputAllowedSet (),
100  m_amEta (UQ_MH_SG_AM_ETA_ODV),
101  m_amEpsilon (UQ_MH_SG_AM_EPSILON_ODV),
102  m_enableBrooksGelmanConvMonitor (UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR),
103  m_BrooksGelmanLag (UQ_MH_SG_BROOKS_GELMAN_LAG),
104  m_outputLogLikelihood (UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD),
105  m_outputLogTarget (UQ_MH_SG_OUTPUT_LOG_TARGET),
106  m_doLogitTransform (UQ_MH_SG_DO_LOGIT_TRANSFORM),
107  m_algorithm (UQ_MH_SG_ALGORITHM),
108  m_tk (UQ_MH_SG_TK),
109  m_updateInterval (UQ_MH_SG_UPDATE_INTERVAL),
110 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
111  m_alternativeRawSsOptionsValues (),
112  m_alternativeFilteredSsOptionsValues (),
113 #endif
114  m_env(NULL),
115 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
116  m_parser(),
117 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
118  m_option_help (m_prefix + "help" ),
119  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
120  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
121  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
122  m_option_totallyMute (m_prefix + "totallyMute" ),
123  m_option_initialPosition_dataInputFileName (m_prefix + "initialPosition_dataInputFileName" ),
124  m_option_initialPosition_dataInputFileType (m_prefix + "initialPosition_dataInputFileType" ),
125  m_option_initialProposalCovMatrix_dataInputFileName(m_prefix + "initialProposalCovMatrix_dataInputFileName"),
126  m_option_initialProposalCovMatrix_dataInputFileType(m_prefix + "initialProposalCovMatrix_dataInputFileType"),
127  m_option_listOfDisabledParameters (m_prefix + "listOfDisabledParameters" ),
128  m_option_rawChain_dataInputFileName (m_prefix + "rawChain_dataInputFileName" ),
129  m_option_rawChain_dataInputFileType (m_prefix + "rawChain_dataInputFileType" ),
130  m_option_rawChain_size (m_prefix + "rawChain_size" ),
131  m_option_rawChain_generateExtra (m_prefix + "rawChain_generateExtra" ),
132  m_option_rawChain_displayPeriod (m_prefix + "rawChain_displayPeriod" ),
133  m_option_rawChain_measureRunTimes (m_prefix + "rawChain_measureRunTimes" ),
134  m_option_rawChain_dataOutputPeriod (m_prefix + "rawChain_dataOutputPeriod" ),
135  m_option_rawChain_dataOutputFileName (m_prefix + "rawChain_dataOutputFileName" ),
136  m_option_rawChain_dataOutputFileType (m_prefix + "rawChain_dataOutputFileType" ),
137  m_option_rawChain_dataOutputAllowAll (m_prefix + "rawChain_dataOutputAllowAll" ),
138  m_option_rawChain_dataOutputAllowedSet (m_prefix + "rawChain_dataOutputAllowedSet" ),
139 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
140  m_option_rawChain_computeStats (m_prefix + "rawChain_computeStats" ),
141 #endif
142  m_option_filteredChain_generate (m_prefix + "filteredChain_generate" ),
143  m_option_filteredChain_discardedPortion (m_prefix + "filteredChain_discardedPortion" ),
144  m_option_filteredChain_lag (m_prefix + "filteredChain_lag" ),
145  m_option_filteredChain_dataOutputFileName (m_prefix + "filteredChain_dataOutputFileName" ),
146  m_option_filteredChain_dataOutputFileType (m_prefix + "filteredChain_dataOutputFileType" ),
147  m_option_filteredChain_dataOutputAllowAll (m_prefix + "filteredChain_dataOutputAllowAll" ),
148  m_option_filteredChain_dataOutputAllowedSet (m_prefix + "filteredChain_dataOutputAllowedSet" ),
149 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
150  m_option_filteredChain_computeStats (m_prefix + "filteredChain_computeStats" ),
151 #endif
152  m_option_displayCandidates (m_prefix + "displayCandidates" ),
153  m_option_putOutOfBoundsInChain (m_prefix + "putOutOfBoundsInChain" ),
154  m_option_tk_useLocalHessian (m_prefix + "tk_useLocalHessian" ),
155  m_option_tk_useNewtonComponent (m_prefix + "tk_useNewtonComponent" ),
156  m_option_dr_maxNumExtraStages (m_prefix + "dr_maxNumExtraStages" ),
157  m_option_dr_listOfScalesForExtraStages (m_prefix + "dr_listOfScalesForExtraStages" ),
158  m_option_dr_duringAmNonAdaptiveInt (m_prefix + "dr_duringAmNonAdaptiveInt" ),
159  m_option_am_keepInitialMatrix (m_prefix + "am_keepInitialMatrix" ),
160  m_option_am_initialNonAdaptInterval (m_prefix + "am_initialNonAdaptInterval" ),
161  m_option_am_adaptInterval (m_prefix + "am_adaptInterval" ),
162  m_option_am_adaptedMatrices_dataOutputPeriod (m_prefix + "am_adaptedMatrices_dataOutputPeriod" ),
163  m_option_am_adaptedMatrices_dataOutputFileName (m_prefix + "am_adaptedMatrices_dataOutputFileName" ),
164  m_option_am_adaptedMatrices_dataOutputFileType (m_prefix + "am_adaptedMatrices_dataOutputFileType" ),
165  m_option_am_adaptedMatrices_dataOutputAllowAll (m_prefix + "am_adaptedMatrices_dataOutputAllowAll" ),
166  m_option_am_adaptedMatrices_dataOutputAllowedSet (m_prefix + "am_adaptedMatrices_dataOutputAllowedSet" ),
167  m_option_am_eta (m_prefix + "am_eta" ),
168  m_option_am_epsilon (m_prefix + "am_epsilon" ),
169  m_option_enableBrooksGelmanConvMonitor (m_prefix + "enableBrooksGelmanConvMonitor" ),
170  m_option_BrooksGelmanLag (m_prefix + "BrooksGelmanLag" ),
171  m_option_outputLogLikelihood (m_prefix + "outputLogLikelihood" ),
172  m_option_outputLogTarget (m_prefix + "outputLogTarget" ),
173  m_option_doLogitTransform (m_prefix + "doLogitTransform" ),
174  m_option_algorithm (m_prefix + "algorithm" ),
175  m_option_tk (m_prefix + "tk" ),
176  m_option_updateInterval (m_prefix + "updateInterval" )
177 {
178 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
179  if (alternativeRawSsOptionsValues ) m_alternativeRawSsOptionsValues = *alternativeRawSsOptionsValues;
180  if (alternativeFilteredSsOptionsValues) m_alternativeFilteredSsOptionsValues = *alternativeFilteredSsOptionsValues;
181 #endif
182 }
183 
185 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
186  const SsOptionsValues* alternativeRawSsOptionsValues,
187  const SsOptionsValues* alternativeFilteredSsOptionsValues,
188 #endif
189  const BaseEnvironment * env,
190  const char * prefix
191  )
192  :
193  m_prefix ((std::string)(prefix) + "mh_"),
194  m_help(UQ_MH_SG_HELP),
195  m_dataOutputFileName (UQ_MH_SG_DATA_OUTPUT_FILE_NAME_ODV),
196  m_dataOutputAllowAll (UQ_MH_SG_DATA_OUTPUT_ALLOW_ALL_ODV),
197  //m_dataOutputAllowedSet (),
198  m_totallyMute (UQ_MH_SG_TOTALLY_MUTE_ODV),
199  m_initialPositionDataInputFileName (UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV),
200  m_initialPositionDataInputFileType (UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV),
201  m_initialProposalCovMatrixDataInputFileName(UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV),
202  m_initialProposalCovMatrixDataInputFileType(UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV),
203  //m_parameterDisabledSet (),
204  m_rawChainDataInputFileName (UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV),
205  m_rawChainDataInputFileType (UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV),
206  m_rawChainSize (UQ_MH_SG_RAW_CHAIN_SIZE_ODV),
207  m_rawChainGenerateExtra (UQ_MH_SG_RAW_CHAIN_GENERATE_EXTRA_ODV),
208  m_rawChainDisplayPeriod (UQ_MH_SG_RAW_CHAIN_DISPLAY_PERIOD_ODV),
209  m_rawChainMeasureRunTimes (UQ_MH_SG_RAW_CHAIN_MEASURE_RUN_TIMES_ODV),
210  m_rawChainDataOutputPeriod (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV),
211  m_rawChainDataOutputFileName (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV),
212  m_rawChainDataOutputFileType (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV),
213  m_rawChainDataOutputAllowAll (UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV),
214  //m_rawChainDataOutputAllowedSet (),
215 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
216  m_rawChainComputeStats (UQ_MH_SG_RAW_CHAIN_COMPUTE_STATS_ODV),
217 #endif
218  m_filteredChainGenerate (UQ_MH_SG_FILTERED_CHAIN_GENERATE_ODV),
219  m_filteredChainDiscardedPortion (UQ_MH_SG_FILTERED_CHAIN_DISCARDED_PORTION_ODV),
220  m_filteredChainLag (UQ_MH_SG_FILTERED_CHAIN_LAG_ODV),
221  m_filteredChainDataOutputFileName (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV),
222  m_filteredChainDataOutputFileType (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV),
223  m_filteredChainDataOutputAllowAll (UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV),
224  //m_filteredChainDataOutputAllowedSet (),
225 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
226  m_filteredChainComputeStats (UQ_MH_SG_FILTERED_CHAIN_COMPUTE_STATS_ODV),
227 #endif
228  m_displayCandidates (UQ_MH_SG_DISPLAY_CANDIDATES_ODV),
229  m_putOutOfBoundsInChain (UQ_MH_SG_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV),
230  m_tkUseLocalHessian (UQ_MH_SG_TK_USE_LOCAL_HESSIAN_ODV),
231  m_tkUseNewtonComponent (UQ_MH_SG_TK_USE_NEWTON_COMPONENT_ODV),
232  m_drMaxNumExtraStages (UQ_MH_SG_DR_MAX_NUM_EXTRA_STAGES_ODV),
233  m_drScalesForExtraStages (0),
234  m_drDuringAmNonAdaptiveInt (UQ_MH_SG_DR_DURING_AM_NON_ADAPTIVE_INT_ODV),
235  m_amKeepInitialMatrix (UQ_MH_SG_AM_KEEP_INITIAL_MATRIX_ODV),
236  m_amInitialNonAdaptInterval (UQ_MH_SG_AM_INIT_NON_ADAPT_INT_ODV),
237  m_amAdaptInterval (UQ_MH_SG_AM_ADAPT_INTERVAL_ODV),
238  m_amAdaptedMatricesDataOutputPeriod (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV),
239  m_amAdaptedMatricesDataOutputFileName (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV),
240  m_amAdaptedMatricesDataOutputFileType (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV),
241  m_amAdaptedMatricesDataOutputAllowAll (UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV),
242  //m_amAdaptedMatricesDataOutputAllowedSet (),
243  m_amEta (UQ_MH_SG_AM_ETA_ODV),
244  m_amEpsilon (UQ_MH_SG_AM_EPSILON_ODV),
245  m_enableBrooksGelmanConvMonitor (UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR),
246  m_BrooksGelmanLag (UQ_MH_SG_BROOKS_GELMAN_LAG),
247  m_outputLogLikelihood (UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD),
248  m_outputLogTarget (UQ_MH_SG_OUTPUT_LOG_TARGET),
249  m_doLogitTransform (UQ_MH_SG_DO_LOGIT_TRANSFORM),
250  m_algorithm (UQ_MH_SG_ALGORITHM),
251  m_tk (UQ_MH_SG_TK),
252  m_updateInterval (UQ_MH_SG_UPDATE_INTERVAL),
253 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
254  m_alternativeRawSsOptionsValues (),
255  m_alternativeFilteredSsOptionsValues (),
256 #endif
257  m_env(env),
258 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
259  m_parser(new BoostInputOptionsParser(env->optionsInputFileName())),
260 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
261  m_option_help (m_prefix + "help" ),
262  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
263  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
264  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
265  m_option_totallyMute (m_prefix + "totallyMute" ),
266  m_option_initialPosition_dataInputFileName (m_prefix + "initialPosition_dataInputFileName" ),
267  m_option_initialPosition_dataInputFileType (m_prefix + "initialPosition_dataInputFileType" ),
268  m_option_initialProposalCovMatrix_dataInputFileName(m_prefix + "initialProposalCovMatrix_dataInputFileName"),
269  m_option_initialProposalCovMatrix_dataInputFileType(m_prefix + "initialProposalCovMatrix_dataInputFileType"),
270  m_option_listOfDisabledParameters (m_prefix + "listOfDisabledParameters" ),
271  m_option_rawChain_dataInputFileName (m_prefix + "rawChain_dataInputFileName" ),
272  m_option_rawChain_dataInputFileType (m_prefix + "rawChain_dataInputFileType" ),
273  m_option_rawChain_size (m_prefix + "rawChain_size" ),
274  m_option_rawChain_generateExtra (m_prefix + "rawChain_generateExtra" ),
275  m_option_rawChain_displayPeriod (m_prefix + "rawChain_displayPeriod" ),
276  m_option_rawChain_measureRunTimes (m_prefix + "rawChain_measureRunTimes" ),
277  m_option_rawChain_dataOutputPeriod (m_prefix + "rawChain_dataOutputPeriod" ),
278  m_option_rawChain_dataOutputFileName (m_prefix + "rawChain_dataOutputFileName" ),
279  m_option_rawChain_dataOutputFileType (m_prefix + "rawChain_dataOutputFileType" ),
280  m_option_rawChain_dataOutputAllowAll (m_prefix + "rawChain_dataOutputAllowAll" ),
281  m_option_rawChain_dataOutputAllowedSet (m_prefix + "rawChain_dataOutputAllowedSet" ),
282 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
283  m_option_rawChain_computeStats (m_prefix + "rawChain_computeStats" ),
284 #endif
285  m_option_filteredChain_generate (m_prefix + "filteredChain_generate" ),
286  m_option_filteredChain_discardedPortion (m_prefix + "filteredChain_discardedPortion" ),
287  m_option_filteredChain_lag (m_prefix + "filteredChain_lag" ),
288  m_option_filteredChain_dataOutputFileName (m_prefix + "filteredChain_dataOutputFileName" ),
289  m_option_filteredChain_dataOutputFileType (m_prefix + "filteredChain_dataOutputFileType" ),
290  m_option_filteredChain_dataOutputAllowAll (m_prefix + "filteredChain_dataOutputAllowAll" ),
291  m_option_filteredChain_dataOutputAllowedSet (m_prefix + "filteredChain_dataOutputAllowedSet" ),
292 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
293  m_option_filteredChain_computeStats (m_prefix + "filteredChain_computeStats" ),
294 #endif
295  m_option_displayCandidates (m_prefix + "displayCandidates" ),
296  m_option_putOutOfBoundsInChain (m_prefix + "putOutOfBoundsInChain" ),
297  m_option_tk_useLocalHessian (m_prefix + "tk_useLocalHessian" ),
298  m_option_tk_useNewtonComponent (m_prefix + "tk_useNewtonComponent" ),
299  m_option_dr_maxNumExtraStages (m_prefix + "dr_maxNumExtraStages" ),
300  m_option_dr_listOfScalesForExtraStages (m_prefix + "dr_listOfScalesForExtraStages" ),
301  m_option_dr_duringAmNonAdaptiveInt (m_prefix + "dr_duringAmNonAdaptiveInt" ),
302  m_option_am_keepInitialMatrix (m_prefix + "am_keepInitialMatrix" ),
303  m_option_am_initialNonAdaptInterval (m_prefix + "am_initialNonAdaptInterval" ),
304  m_option_am_adaptInterval (m_prefix + "am_adaptInterval" ),
305  m_option_am_adaptedMatrices_dataOutputPeriod (m_prefix + "am_adaptedMatrices_dataOutputPeriod" ),
306  m_option_am_adaptedMatrices_dataOutputFileName (m_prefix + "am_adaptedMatrices_dataOutputFileName" ),
307  m_option_am_adaptedMatrices_dataOutputFileType (m_prefix + "am_adaptedMatrices_dataOutputFileType" ),
308  m_option_am_adaptedMatrices_dataOutputAllowAll (m_prefix + "am_adaptedMatrices_dataOutputAllowAll" ),
309  m_option_am_adaptedMatrices_dataOutputAllowedSet (m_prefix + "am_adaptedMatrices_dataOutputAllowedSet" ),
310  m_option_am_eta (m_prefix + "am_eta" ),
311  m_option_am_epsilon (m_prefix + "am_epsilon" ),
312  m_option_enableBrooksGelmanConvMonitor (m_prefix + "enableBrooksGelmanConvMonitor" ),
313  m_option_BrooksGelmanLag (m_prefix + "BrooksGelmanLag" ),
314  m_option_outputLogLikelihood (m_prefix + "outputLogLikelihood" ),
315  m_option_outputLogTarget (m_prefix + "outputLogTarget" ),
316  m_option_doLogitTransform (m_prefix + "doLogitTransform" ),
317  m_option_algorithm (m_prefix + "algorithm" ),
318  m_option_tk (m_prefix + "tk" ),
319  m_option_updateInterval (m_prefix + "updateInterval" )
320 {
321 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
322  if (alternativeRawSsOptionsValues ) m_alternativeRawSsOptionsValues = *alternativeRawSsOptionsValues;
323  if (alternativeFilteredSsOptionsValues) m_alternativeFilteredSsOptionsValues = *alternativeFilteredSsOptionsValues;
324 #endif
325 
326 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
327  m_parser->registerOption<std::string >(m_option_help, UQ_MH_SG_HELP, "produce help msg for Bayesian Metropolis-Hastings" );
328  m_parser->registerOption<std::string >(m_option_dataOutputFileName, UQ_MH_SG_DATA_OUTPUT_FILE_NAME_ODV , "name of generic output file" );
329  m_parser->registerOption<bool >(m_option_dataOutputAllowAll, UQ_MH_SG_DATA_OUTPUT_ALLOW_ALL_ODV , "allow all subEnvs write to a generic output file" );
330  m_parser->registerOption<std::string >(m_option_dataOutputAllowedSet, UQ_MH_SG_DATA_OUTPUT_ALLOWED_SET_ODV , "subEnvs that will write to generic output file" );
331  m_parser->registerOption<bool >(m_option_totallyMute, UQ_MH_SG_TOTALLY_MUTE_ODV , "totally mute (no printout msg)" );
332  m_parser->registerOption<std::string >(m_option_initialPosition_dataInputFileName, UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV , "name of input file for raw chain " );
333  m_parser->registerOption<std::string >(m_option_initialPosition_dataInputFileType, UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV , "type of input file for raw chain " );
334  m_parser->registerOption<std::string >(m_option_initialProposalCovMatrix_dataInputFileName, UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV, "name of input file for raw chain " );
335  m_parser->registerOption<std::string >(m_option_initialProposalCovMatrix_dataInputFileType, UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV, "type of input file for raw chain " );
336  m_parser->registerOption<std::string >(m_option_listOfDisabledParameters, UQ_MH_SG_LIST_OF_DISABLED_PARAMETERS_ODV , "list of disabled parameters" );
337  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 " );
338  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 " );
339  m_parser->registerOption<unsigned int>(m_option_rawChain_size, UQ_MH_SG_RAW_CHAIN_SIZE_ODV , "size of raw chain" );
340  m_parser->registerOption<bool >(m_option_rawChain_generateExtra, UQ_MH_SG_RAW_CHAIN_GENERATE_EXTRA_ODV , "generate extra information about raw chain" );
341  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" );
342  m_parser->registerOption<bool >(m_option_rawChain_measureRunTimes, UQ_MH_SG_RAW_CHAIN_MEASURE_RUN_TIMES_ODV , "measure run times" );
343  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" );
344  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 " );
345  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 " );
346  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" );
347  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" );
348 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
349  m_parser->registerOption<bool >(m_option_rawChain_computeStats, UQ_MH_SG_RAW_CHAIN_COMPUTE_STATS_ODV , "compute statistics on raw chain" );
350 #endif
351  m_parser->registerOption<bool >(m_option_filteredChain_generate, UQ_MH_SG_FILTERED_CHAIN_GENERATE_ODV , "generate filtered chain" );
352  m_parser->registerOption<double >(m_option_filteredChain_discardedPortion, UQ_MH_SG_FILTERED_CHAIN_DISCARDED_PORTION_ODV , "initial discarded portion for chain filtering" );
353  m_parser->registerOption<unsigned int>(m_option_filteredChain_lag, UQ_MH_SG_FILTERED_CHAIN_LAG_ODV , "spacing for chain filtering" );
354  m_parser->registerOption<std::string >(m_option_filteredChain_dataOutputFileName, UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV , "name of output file for filtered chain" );
355  m_parser->registerOption<std::string >(m_option_filteredChain_dataOutputFileType, UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV , "type of output file for filtered chain" );
356  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" );
357  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" );
358 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
359  m_parser->registerOption<bool >(m_option_filteredChain_computeStats, UQ_MH_SG_FILTERED_CHAIN_COMPUTE_STATS_ODV , "compute statistics on filtered chain" );
360 #endif
361  m_parser->registerOption<bool >(m_option_displayCandidates, UQ_MH_SG_DISPLAY_CANDIDATES_ODV , "display candidates in the core MH algorithm" );
362  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" );
363  m_parser->registerOption<bool >(m_option_tk_useLocalHessian, UQ_MH_SG_TK_USE_LOCAL_HESSIAN_ODV , "'proposal' use local Hessian" );
364  m_parser->registerOption<bool >(m_option_tk_useNewtonComponent, UQ_MH_SG_TK_USE_NEWTON_COMPONENT_ODV , "'proposal' use Newton component" );
365  m_parser->registerOption<unsigned int>(m_option_dr_maxNumExtraStages, UQ_MH_SG_DR_MAX_NUM_EXTRA_STAGES_ODV , "'dr' maximum number of extra stages" );
366  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" );
367  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" );
368  m_parser->registerOption<bool >(m_option_am_keepInitialMatrix, UQ_MH_SG_AM_KEEP_INITIAL_MATRIX_ODV , "'am' keep initial (given) matrix" );
369  m_parser->registerOption<unsigned int>(m_option_am_initialNonAdaptInterval, UQ_MH_SG_AM_INIT_NON_ADAPT_INT_ODV , "'am' initial non adaptation interval" );
370  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_am_adaptedMatrices_dataOutputPeriod, UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV , "period for outputting 'am' adapted matrices" );
372  m_parser->registerOption<std::string >(m_option_am_adaptedMatrices_dataOutputFileName, UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV , "name of output file for 'am' adapted matrices" );
373  m_parser->registerOption<std::string >(m_option_am_adaptedMatrices_dataOutputFileType, UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV , "type of output file for 'am' adapted matrices" );
374  m_parser->registerOption<bool >(m_option_am_adaptedMatrices_dataOutputAllowAll, UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV , "type of output file for 'am' adapted matrices" );
375  m_parser->registerOption<std::string >(m_option_am_adaptedMatrices_dataOutputAllowedSet, UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOWED_SET_ODV , "type of output file for 'am' adapted matrices" );
376  m_parser->registerOption<double >(m_option_am_eta, UQ_MH_SG_AM_ETA_ODV , "'am' eta" );
377  m_parser->registerOption<double >(m_option_am_epsilon, UQ_MH_SG_AM_EPSILON_ODV , "'am' epsilon" );
378  m_parser->registerOption<unsigned int>(m_option_enableBrooksGelmanConvMonitor, UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR , "assess convergence using Brooks-Gelman metric" );
379  m_parser->registerOption<unsigned int>(m_option_BrooksGelmanLag, UQ_MH_SG_BROOKS_GELMAN_LAG , "number of chain positions before starting to compute metric");
380  m_parser->registerOption<bool >(m_option_outputLogLikelihood, UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD , "flag to toggle output of log likelihood values" );
381  m_parser->registerOption<bool >(m_option_outputLogTarget, UQ_MH_SG_OUTPUT_LOG_TARGET , "flag to toggle output of log target values" );
382  m_parser->registerOption<bool >(m_option_doLogitTransform, UQ_MH_SG_DO_LOGIT_TRANSFORM , "flag to toggle logit transform for bounded domains" );
383  m_parser->registerOption<std::string >(m_option_algorithm, UQ_MH_SG_ALGORITHM , "which MCMC algorithm to use" );
384  m_parser->registerOption<std::string >(m_option_tk, UQ_MH_SG_TK , "which MCMC transition kernel to use" );
385  m_parser->registerOption<unsigned int>(m_option_updateInterval, UQ_MH_SG_UPDATE_INTERVAL , "how often to call updateTK method" );
386 
387  m_parser->scanInputFile();
388 
389  m_parser->getOption<std::string >(m_option_help, m_help);
390  m_parser->getOption<std::string >(m_option_dataOutputFileName, m_dataOutputFileName);
391  m_parser->getOption<bool >(m_option_dataOutputAllowAll, m_dataOutputAllowAll);
392  m_parser->getOption<std::set<unsigned int> >(m_option_dataOutputAllowedSet, m_dataOutputAllowedSet);
393  m_parser->getOption<bool >(m_option_totallyMute, m_totallyMute);
394  m_parser->getOption<std::string >(m_option_initialPosition_dataInputFileName, m_initialPositionDataInputFileName);
395  m_parser->getOption<std::string >(m_option_initialPosition_dataInputFileType, m_initialPositionDataInputFileType);
396  m_parser->getOption<std::string >(m_option_initialProposalCovMatrix_dataInputFileName, m_initialProposalCovMatrixDataInputFileName);
397  m_parser->getOption<std::string >(m_option_initialProposalCovMatrix_dataInputFileType, m_initialProposalCovMatrixDataInputFileType);
398  m_parser->getOption<std::set<unsigned int> >(m_option_listOfDisabledParameters, m_parameterDisabledSet);
399  m_parser->getOption<std::string >(m_option_rawChain_dataInputFileName, m_rawChainDataInputFileName);
400  m_parser->getOption<std::string >(m_option_rawChain_dataInputFileType, m_rawChainDataInputFileType);
401  m_parser->getOption<unsigned int>(m_option_rawChain_size, m_rawChainSize);
402  m_parser->getOption<bool >(m_option_rawChain_generateExtra, m_rawChainGenerateExtra);
403  m_parser->getOption<unsigned int>(m_option_rawChain_displayPeriod, m_rawChainDisplayPeriod);
404  m_parser->getOption<bool >(m_option_rawChain_measureRunTimes, m_rawChainMeasureRunTimes);
405  m_parser->getOption<unsigned int>(m_option_rawChain_dataOutputPeriod, m_rawChainDataOutputPeriod);
406  m_parser->getOption<std::string >(m_option_rawChain_dataOutputFileName, m_rawChainDataOutputFileName);
407  m_parser->getOption<std::string >(m_option_rawChain_dataOutputFileType, m_rawChainDataOutputFileType);
408  m_parser->getOption<bool >(m_option_rawChain_dataOutputAllowAll, m_rawChainDataOutputAllowAll);
409  m_parser->getOption<std::set<unsigned int> >(m_option_rawChain_dataOutputAllowedSet, m_rawChainDataOutputAllowedSet);
410 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
411  m_parser->getOption<bool >(m_option_rawChain_computeStats, m_rawChain_computeStats);
412 #endif
413  m_parser->getOption<bool >(m_option_filteredChain_generate, m_filteredChainGenerate);
414  m_parser->getOption<double >(m_option_filteredChain_discardedPortion, m_filteredChainDiscardedPortion);
415  m_parser->getOption<unsigned int>(m_option_filteredChain_lag, m_filteredChainLag);
416  m_parser->getOption<std::string >(m_option_filteredChain_dataOutputFileName, m_filteredChainDataOutputFileName);
417  m_parser->getOption<std::string >(m_option_filteredChain_dataOutputFileType, m_filteredChainDataOutputFileType);
418  m_parser->getOption<bool >(m_option_filteredChain_dataOutputAllowAll, m_filteredChainDataOutputAllowAll);
419  m_parser->getOption<std::set<unsigned int> >(m_option_filteredChain_dataOutputAllowedSet, m_filteredChainDataOutputAllowedSet);
420 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
421  m_parser->getOption<bool >(m_option_filteredChain_computeStats, m_filteredChain_computeStats);
422 #endif
423  m_parser->getOption<bool >(m_option_displayCandidates, m_displayCandidates);
424  m_parser->getOption<bool >(m_option_putOutOfBoundsInChain, m_putOutOfBoundsInChain);
425  m_parser->getOption<bool >(m_option_tk_useLocalHessian, m_tkUseLocalHessian);
426  m_parser->getOption<bool >(m_option_tk_useNewtonComponent, m_tkUseNewtonComponent);
427  m_parser->getOption<unsigned int>(m_option_dr_maxNumExtraStages, m_drMaxNumExtraStages);
428  m_parser->getOption<std::vector<double> >(m_option_dr_listOfScalesForExtraStages, m_drScalesForExtraStages);
429  m_parser->getOption<bool >(m_option_dr_duringAmNonAdaptiveInt, m_drDuringAmNonAdaptiveInt);
430  m_parser->getOption<bool >(m_option_am_keepInitialMatrix, m_amKeepInitialMatrix);
431  m_parser->getOption<unsigned int>(m_option_am_initialNonAdaptInterval, m_amInitialNonAdaptInterval);
432  m_parser->getOption<unsigned int>(m_option_am_adaptInterval, m_amAdaptInterval);
433  m_parser->getOption<unsigned int>(m_option_am_adaptedMatrices_dataOutputPeriod, m_amAdaptedMatricesDataOutputPeriod);
434  m_parser->getOption<std::string >(m_option_am_adaptedMatrices_dataOutputFileName, m_amAdaptedMatricesDataOutputFileName);
435  m_parser->getOption<std::string >(m_option_am_adaptedMatrices_dataOutputFileType, m_amAdaptedMatricesDataOutputFileType);
436  m_parser->getOption<bool >(m_option_am_adaptedMatrices_dataOutputAllowAll, m_amAdaptedMatricesDataOutputAllowAll);
437  m_parser->getOption<std::set<unsigned int> >(m_option_am_adaptedMatrices_dataOutputAllowedSet, m_amAdaptedMatricesDataOutputAllowedSet);
438  m_parser->getOption<double >(m_option_am_eta, m_amEta);
439  m_parser->getOption<double >(m_option_am_epsilon, m_amEpsilon);
440  m_parser->getOption<unsigned int>(m_option_enableBrooksGelmanConvMonitor, m_enableBrooksGelmanConvMonitor);
441  m_parser->getOption<unsigned int>(m_option_BrooksGelmanLag, m_BrooksGelmanLag);
442  m_parser->getOption<bool >(m_option_outputLogLikelihood, m_outputLogLikelihood);
443  m_parser->getOption<bool >(m_option_outputLogTarget, m_outputLogTarget);
444  m_parser->getOption<bool >(m_option_doLogitTransform, m_doLogitTransform);
445  m_parser->getOption<std::string >(m_option_algorithm, m_algorithm);
446  m_parser->getOption<std::string >(m_option_tk, m_tk);
447  m_parser->getOption<unsigned int>(m_option_updateInterval, m_updateInterval);
448 #else
449  m_help = m_env->input()(m_option_help, UQ_MH_SG_HELP);
450  m_dataOutputFileName = m_env->input()(m_option_dataOutputFileName, UQ_MH_SG_DATA_OUTPUT_FILE_NAME_ODV);
451  m_dataOutputAllowAll = m_env->input()(m_option_dataOutputAllowAll, UQ_MH_SG_DATA_OUTPUT_ALLOW_ALL_ODV);
452 
453  // UQ_MH_SG_DATA_OUTPUT_ALLOWED_SET_ODV is the empty set (string) by default
454  unsigned int size = m_env->input().vector_variable_size(m_option_dataOutputAllowedSet);
455  for (unsigned int i = 0; i < size; i++) {
456  // We default to empty set, so the default values are actually never used
457  // here
458  unsigned int allowed = m_env->input()(m_option_dataOutputAllowedSet, i, i);
459  m_dataOutputAllowedSet.insert(allowed);
460  }
461 
462  m_totallyMute = m_env->input()(m_option_totallyMute, UQ_MH_SG_TOTALLY_MUTE_ODV);
463  m_initialPositionDataInputFileName = m_env->input()(m_option_initialPosition_dataInputFileName, UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV);
464  m_initialPositionDataInputFileType = m_env->input()(m_option_initialPosition_dataInputFileType, UQ_MH_SG_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV);
465  m_initialProposalCovMatrixDataInputFileName = m_env->input()(m_option_initialProposalCovMatrix_dataInputFileName, UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV);
466  m_initialProposalCovMatrixDataInputFileType = m_env->input()(m_option_initialProposalCovMatrix_dataInputFileType, UQ_MH_SG_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV);
467 
468  // UQ_MH_SG_LIST_OF_DISABLED_PARAMETERS_ODV is the empty set (string) by
469  // default
470  size = m_env->input().vector_variable_size(m_option_listOfDisabledParameters);
471  for (unsigned int i = 0; i < size; i++) {
472  // We default to empty set, so the default values are actually never used
473  // here
474  unsigned int disabled = m_env->input()(m_option_listOfDisabledParameters, i, i);
475  m_parameterDisabledSet.insert(disabled);
476  }
477 
478  m_rawChainDataInputFileName = m_env->input()(m_option_rawChain_dataInputFileName, UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV);
479  m_rawChainDataInputFileType = m_env->input()(m_option_rawChain_dataInputFileType, UQ_MH_SG_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV);
480  m_rawChainSize = m_env->input()(m_option_rawChain_size, UQ_MH_SG_RAW_CHAIN_SIZE_ODV);
481  m_rawChainGenerateExtra = m_env->input()(m_option_rawChain_generateExtra, UQ_MH_SG_RAW_CHAIN_GENERATE_EXTRA_ODV);
482  m_rawChainDisplayPeriod = m_env->input()(m_option_rawChain_displayPeriod, UQ_MH_SG_RAW_CHAIN_DISPLAY_PERIOD_ODV);
483  m_rawChainMeasureRunTimes = m_env->input()(m_option_rawChain_measureRunTimes, UQ_MH_SG_RAW_CHAIN_MEASURE_RUN_TIMES_ODV);
484  m_rawChainDataOutputPeriod = m_env->input()(m_option_rawChain_dataOutputPeriod, UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV);
485  m_rawChainDataOutputFileName = m_env->input()(m_option_rawChain_dataOutputFileName, UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV);
486  m_rawChainDataOutputFileType = m_env->input()(m_option_rawChain_dataOutputFileType, UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV);
487  m_rawChainDataOutputAllowAll = m_env->input()(m_option_rawChain_dataOutputAllowAll, UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV);
488 
489  // UQ_MH_SG_RAW_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV is the empty set (string) by default
490  size = m_env->input().vector_variable_size(m_option_rawChain_dataOutputAllowedSet);
491  for (unsigned int i = 0; i < size; i++) {
492  // We default to empty set, so the default values are actually never used
493  // here
494  unsigned int allowed = m_env->input()(m_option_rawChain_dataOutputAllowedSet, i, i);
495  m_rawChainDataOutputAllowedSet.insert(allowed);
496  }
497 
498 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
499  m_rawChain_computeStats = m_env->input()(m_option_rawChain_computeStats, UQ_MH_SG_RAW_CHAIN_COMPUTE_STATS_ODV);
500 #endif
501  m_filteredChainGenerate = m_env->input()(m_option_filteredChain_generate, UQ_MH_SG_FILTERED_CHAIN_GENERATE_ODV);
502  m_filteredChainDiscardedPortion = m_env->input()(m_option_filteredChain_discardedPortion, UQ_MH_SG_FILTERED_CHAIN_DISCARDED_PORTION_ODV);
503  m_filteredChainLag = m_env->input()(m_option_filteredChain_lag, UQ_MH_SG_FILTERED_CHAIN_LAG_ODV);
504  m_filteredChainDataOutputFileName = m_env->input()(m_option_filteredChain_dataOutputFileName, UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV);
505  m_filteredChainDataOutputFileType = m_env->input()(m_option_filteredChain_dataOutputFileType, UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV);
506  m_filteredChainDataOutputAllowAll = m_env->input()(m_option_filteredChain_dataOutputAllowAll, UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV);
507 
508  // UQ_MH_SG_FILTERED_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV is the empty set (string) by default
509  size = m_env->input().vector_variable_size(m_option_filteredChain_dataOutputAllowedSet);
510  for (unsigned int i = 0; i < size; i++) {
511  // We default to empty set, so the default values are actually never used
512  // here
513  unsigned int allowed = m_env->input()(m_option_filteredChain_dataOutputAllowedSet, i, i);
514  m_filteredChainDataOutputAllowedSet.insert(allowed);
515  }
516 
517 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
518  m_filteredChain_computeStats = m_env->input()(m_option_filteredChain_computeStats, UQ_MH_SG_FILTERED_CHAIN_COMPUTE_STATS_ODV);
519 #endif
520  m_displayCandidates = m_env->input()(m_option_displayCandidates, UQ_MH_SG_DISPLAY_CANDIDATES_ODV);
521  m_putOutOfBoundsInChain = m_env->input()(m_option_putOutOfBoundsInChain, UQ_MH_SG_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV);
522  m_tkUseLocalHessian = m_env->input()(m_option_tk_useLocalHessian, UQ_MH_SG_TK_USE_LOCAL_HESSIAN_ODV);
523  m_tkUseNewtonComponent = m_env->input()(m_option_tk_useNewtonComponent, UQ_MH_SG_TK_USE_NEWTON_COMPONENT_ODV);
524  m_drMaxNumExtraStages = m_env->input()(m_option_dr_maxNumExtraStages, UQ_MH_SG_DR_MAX_NUM_EXTRA_STAGES_ODV);
525 
526  // UQ_MH_SG_DR_LIST_OF_SCALES_FOR_EXTRA_STAGES_ODV is the empty set (string) by default
527  size = m_env->input().vector_variable_size(m_option_dr_listOfScalesForExtraStages);
528  for (unsigned int i = 0; i < size; i++) {
529  // We default to empty set, so the default values are actually never used
530  // here
531  unsigned int allowed = m_env->input()(m_option_dr_listOfScalesForExtraStages, i, i);
532  m_drScalesForExtraStages.push_back(allowed);
533  }
534 
535  m_drDuringAmNonAdaptiveInt = m_env->input()(m_option_dr_duringAmNonAdaptiveInt, UQ_MH_SG_DR_DURING_AM_NON_ADAPTIVE_INT_ODV);
536  m_amKeepInitialMatrix = m_env->input()(m_option_am_keepInitialMatrix, UQ_MH_SG_AM_KEEP_INITIAL_MATRIX_ODV);
537  m_amInitialNonAdaptInterval = m_env->input()(m_option_am_initialNonAdaptInterval, UQ_MH_SG_AM_INIT_NON_ADAPT_INT_ODV);
538  m_amAdaptInterval = m_env->input()(m_option_am_adaptInterval, UQ_MH_SG_AM_ADAPT_INTERVAL_ODV);
539  m_amAdaptedMatricesDataOutputPeriod = m_env->input()(m_option_am_adaptedMatrices_dataOutputPeriod, UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV);
540  m_amAdaptedMatricesDataOutputFileName = m_env->input()(m_option_am_adaptedMatrices_dataOutputFileName, UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV);
541  m_amAdaptedMatricesDataOutputFileType = m_env->input()(m_option_am_adaptedMatrices_dataOutputFileType, UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV);
542  m_amAdaptedMatricesDataOutputAllowAll = m_env->input()(m_option_am_adaptedMatrices_dataOutputAllowAll, UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV);
543 
544  // UQ_MH_SG_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOWED_SET_ODV is the empty set (string) by default
545  size = m_env->input().vector_variable_size(m_option_am_adaptedMatrices_dataOutputAllowedSet);
546  for (unsigned int i = 0; i < size; i++) {
547  // We default to empty set, so the default values are actually never used
548  // here
549  unsigned int allowed = m_env->input()(m_option_am_adaptedMatrices_dataOutputAllowedSet, i, i);
550  m_amAdaptedMatricesDataOutputAllowedSet.insert(allowed);
551  }
552 
553  m_amEta = m_env->input()(m_option_am_eta, UQ_MH_SG_AM_ETA_ODV);
554  m_amEpsilon = m_env->input()(m_option_am_epsilon, UQ_MH_SG_AM_EPSILON_ODV);
555  m_enableBrooksGelmanConvMonitor = m_env->input()(m_option_enableBrooksGelmanConvMonitor, UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR);
556  m_BrooksGelmanLag = m_env->input()(m_option_BrooksGelmanLag, UQ_MH_SG_BROOKS_GELMAN_LAG);
557  m_outputLogLikelihood = m_env->input()(m_option_outputLogLikelihood, UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD);
558  m_outputLogTarget = m_env->input()(m_option_outputLogTarget, UQ_MH_SG_OUTPUT_LOG_TARGET);
559  m_doLogitTransform = m_env->input()(m_option_doLogitTransform, UQ_MH_SG_DO_LOGIT_TRANSFORM);
560  m_algorithm = m_env->input()(m_option_algorithm, UQ_MH_SG_ALGORITHM);
561  m_tk = m_env->input()(m_option_tk, UQ_MH_SG_TK);
562  m_updateInterval = m_env->input()(m_option_updateInterval, UQ_MH_SG_UPDATE_INTERVAL);
563 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
564 
565  checkOptions(env);
566 }
567 // Copy constructor----------------------------------
569 {
570  this->copy(src);
571 }
572 // Destructor ---------------------------------------
574 {
575 }
576 // Set methods --------------------------------------
579 {
580  this->copy(rhs);
581  return *this;
582 }
583 // Private methods-----------------------------------
584 void
586 {
587  if (m_dataOutputAllowAll) {
588  // So, ignore the 'set' option
589  m_dataOutputAllowedSet.clear();
590  m_dataOutputAllowedSet.insert(env->subId());
591  }
592 
594  // Again, ignore the set
596  m_rawChainDataOutputAllowedSet.insert(env->subId());
597  }
598 
599  if (m_filteredChainGenerate == true) {
600  queso_require_greater_equal_msg(m_filteredChainLag, 2, "option `" << m_option_filteredChain_lag << "` must be at least 2");
601  }
602 
606  }
607 
608  // If max is bigger than the list provided, then pad with ones
609  if (m_drMaxNumExtraStages > 0) {
610  unsigned int size = m_drScalesForExtraStages.size();
611  if (m_drMaxNumExtraStages > size) {
612  for (unsigned int i = size; i < m_drMaxNumExtraStages; i++) {
613  double scale = 1.0;
614  m_drScalesForExtraStages.push_back(scale);
615  }
616  }
617  }
618  else {
619  m_drScalesForExtraStages.clear();
620  }
621 
625  }
626 
627  if ((m_tk == "random_walk") && (m_algorithm == "logit_random_walk")) {
628  queso_error_msg("random_walk transition kernel and logit_random_walk algorithm are incompatible options");
629  }
630 
631  if ((m_tk == "logit_random_walk") && (m_algorithm == "random_walk")) {
632  queso_error_msg("logit_random_walk transition kernel and random_walk algorithm are incompatible options");
633  }
634 
635  if (m_tk == "random_walk") {
638  0,
639  "logit transform must be off to use random_walk");
642  0,
643  "local Hessian must be off to use random_walk");
644  }
645 
646  if (m_tk == "logit_random_walk") {
649  1,
650  "logit transform must be on to use logit_random_walk");
653  0,
654  "local Hessian must be off to use logit_random_walk");
655  }
656 
657  if (m_tk == "stochastic_newton") {
660  0,
661  "logit transform must be off to use stochastic_newton");
664  1,
665  "local Hessian must be on to use stochastic_newton");
666  }
667 
668 }
669 
670 void
672 {
693 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
695 #endif
696 //m_rawChainStatisticalOptionsObj = src.m_rawChainStatisticalOptionsObj; // dakota
697 //m_rawChainStatOptsInstantiated = src.m_rawChainStatOptsInstantiated; // dakota
705 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
707 #endif
708 //m_filteredChainStatisticalOptionsObj = src.m_filteredChainStatisticalOptionsObj; // dakota
709 //m_filteredChainStatOptsInstantiated = src.m_filteredChainStatOptsInstantiated; // dakota
725  m_amEta = src.m_amEta;
726  m_amEpsilon = src.m_amEpsilon;
732  m_algorithm = src.m_algorithm;
733  m_tk = src.m_tk;
735 
736 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
739 #endif
740  return;
741 }
742 
743 std::ostream & operator<<(std::ostream & os, const MhOptionsValues & obj)
744 {
745 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
746  os << (*(obj.m_parser)) << std::endl;
747 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
748 
749  os << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName
750  << "\n" << obj.m_option_dataOutputAllowAll << " = " << obj.m_dataOutputAllowAll
751  << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
752  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
753  os << *setIt << " ";
754  }
755  os << "\n" << obj.m_option_totallyMute << " = " << obj.m_totallyMute
760  << "\n" << obj.m_option_listOfDisabledParameters << " = ";
761  for (std::set<unsigned int>::iterator setIt = obj.m_parameterDisabledSet.begin(); setIt != obj.m_parameterDisabledSet.end(); ++setIt) {
762  os << *setIt << " ";
763  }
764  os << "\n" << obj.m_option_rawChain_dataInputFileName << " = " << obj.m_rawChainDataInputFileName
766  << "\n" << obj.m_option_rawChain_size << " = " << obj.m_rawChainSize
767  << "\n" << obj.m_option_rawChain_generateExtra << " = " << obj.m_rawChainGenerateExtra
768  << "\n" << obj.m_option_rawChain_displayPeriod << " = " << obj.m_rawChainDisplayPeriod
769  << "\n" << obj.m_option_rawChain_measureRunTimes << " = " << obj.m_rawChainMeasureRunTimes
774  << "\n" << obj.m_option_rawChain_dataOutputAllowedSet << " = ";
775  for (std::set<unsigned int>::iterator setIt = obj.m_rawChainDataOutputAllowedSet.begin(); setIt != obj.m_rawChainDataOutputAllowedSet.end(); ++setIt) {
776  os << *setIt << " ";
777  }
778  os
779 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
780  << "\n" << obj.m_option_rawChain_computeStats << " = " << obj.m_rawChainComputeStats
781 #endif
782  << "\n" << obj.m_option_filteredChain_generate << " = " << obj.m_filteredChainGenerate
784  << "\n" << obj.m_option_filteredChain_lag << " = " << obj.m_filteredChainLag
788  << "\n" << obj.m_option_filteredChain_dataOutputAllowedSet << " = ";
789  for (std::set<unsigned int>::iterator setIt = obj.m_filteredChainDataOutputAllowedSet.begin(); setIt != obj.m_filteredChainDataOutputAllowedSet.end(); ++setIt) {
790  os << *setIt << " ";
791  }
792  os
793 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
795 #endif
796  << "\n" << obj.m_option_displayCandidates << " = " << obj.m_displayCandidates
797  << "\n" << obj.m_option_putOutOfBoundsInChain << " = " << obj.m_putOutOfBoundsInChain
798  << "\n" << obj.m_option_tk_useLocalHessian << " = " << obj.m_tkUseLocalHessian
799  << "\n" << obj.m_option_tk_useNewtonComponent << " = " << obj.m_tkUseNewtonComponent
800  << "\n" << obj.m_option_dr_maxNumExtraStages << " = " << obj.m_drMaxNumExtraStages
801  << "\n" << obj.m_option_dr_listOfScalesForExtraStages << " = ";
802  for (unsigned int i = 0; i < obj.m_drScalesForExtraStages.size(); ++i) {
803  os << obj.m_drScalesForExtraStages[i] << " ";
804  }
805  os << "\n" << obj.m_option_dr_duringAmNonAdaptiveInt << " = " << obj.m_drDuringAmNonAdaptiveInt
806  << "\n" << obj.m_option_am_keepInitialMatrix << " = " << obj.m_amKeepInitialMatrix
808  << "\n" << obj.m_option_am_adaptInterval << " = " << obj.m_amAdaptInterval
813  << "\n" << obj.m_option_am_adaptedMatrices_dataOutputAllowedSet << " = ";
814  for (std::set<unsigned int>::iterator setIt = obj.m_amAdaptedMatricesDataOutputAllowedSet.begin(); setIt != obj.m_amAdaptedMatricesDataOutputAllowedSet.end(); ++setIt) {
815  os << *setIt << " ";
816  }
817  os << "\n" << obj.m_option_am_eta << " = " << obj.m_amEta
818  << "\n" << obj.m_option_am_epsilon << " = " << obj.m_amEpsilon
820  << "\n" << obj.m_option_BrooksGelmanLag << " = " << obj.m_BrooksGelmanLag
821  << "\n" << obj.m_option_outputLogLikelihood << " = " << obj.m_outputLogLikelihood
822  << "\n" << obj.m_option_outputLogTarget << " = " << obj.m_outputLogTarget
823  << "\n" << obj.m_option_doLogitTransform << " = " << obj.m_doLogitTransform
824  << "\n" << obj.m_option_algorithm << " = " << obj.m_algorithm
825  << "\n" << obj.m_option_tk << " = " << obj.m_tk
826  << "\n" << obj.m_option_updateInterval << " = " << obj.m_updateInterval
827  << std::endl;
828 
829  return os;
830 }
831 
832 //---------------------------------------------------
833 // MetropolisHastingsSGOptions ---------------
834 //---------------------------------------------------
835 
836 // Default constructor -----------------------------
838  const BaseEnvironment& env,
839  const char* prefix)
840  :
841 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
842  m_ov (NULL,NULL), // dakota
843  m_rawChainStatisticalOptionsObj (NULL),
844  m_rawChainStatOptsInstantiated (false),
845  m_filteredChainStatisticalOptionsObj (NULL),
846  m_filteredChainStatOptsInstantiated (false),
847 #else
848  m_ov (),
849 #endif
850  m_prefix ((std::string)(prefix) + "mh_"),
851  m_env (env),
852 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
853  m_optionsDesc (new boost::program_options::options_description("Bayesian Metropolis-Hastings options")),
854 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
855  m_option_help (m_prefix + "help" ),
856  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
857  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
858  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
859  m_option_totallyMute (m_prefix + "totallyMute" ),
860  m_option_initialPosition_dataInputFileName (m_prefix + "initialPosition_dataInputFileName" ),
861  m_option_initialPosition_dataInputFileType (m_prefix + "initialPosition_dataInputFileType" ),
862  m_option_initialProposalCovMatrix_dataInputFileName(m_prefix + "initialProposalCovMatrix_dataInputFileName"),
863  m_option_initialProposalCovMatrix_dataInputFileType(m_prefix + "initialProposalCovMatrix_dataInputFileType"),
864  m_option_listOfDisabledParameters (m_prefix + "listOfDisabledParameters" ),
865  m_option_rawChain_dataInputFileName (m_prefix + "rawChain_dataInputFileName" ),
866  m_option_rawChain_dataInputFileType (m_prefix + "rawChain_dataInputFileType" ),
867  m_option_rawChain_size (m_prefix + "rawChain_size" ),
868  m_option_rawChain_generateExtra (m_prefix + "rawChain_generateExtra" ),
869  m_option_rawChain_displayPeriod (m_prefix + "rawChain_displayPeriod" ),
870  m_option_rawChain_measureRunTimes (m_prefix + "rawChain_measureRunTimes" ),
871  m_option_rawChain_dataOutputPeriod (m_prefix + "rawChain_dataOutputPeriod" ),
872  m_option_rawChain_dataOutputFileName (m_prefix + "rawChain_dataOutputFileName" ),
873  m_option_rawChain_dataOutputFileType (m_prefix + "rawChain_dataOutputFileType" ),
874  m_option_rawChain_dataOutputAllowAll (m_prefix + "rawChain_dataOutputAllowAll" ),
875  m_option_rawChain_dataOutputAllowedSet (m_prefix + "rawChain_dataOutputAllowedSet" ),
876 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
877  m_option_rawChain_computeStats (m_prefix + "rawChain_computeStats" ),
878 #endif
879  m_option_filteredChain_generate (m_prefix + "filteredChain_generate" ),
880  m_option_filteredChain_discardedPortion (m_prefix + "filteredChain_discardedPortion" ),
881  m_option_filteredChain_lag (m_prefix + "filteredChain_lag" ),
882  m_option_filteredChain_dataOutputFileName (m_prefix + "filteredChain_dataOutputFileName" ),
883  m_option_filteredChain_dataOutputFileType (m_prefix + "filteredChain_dataOutputFileType" ),
884  m_option_filteredChain_dataOutputAllowAll (m_prefix + "filteredChain_dataOutputAllowAll" ),
885  m_option_filteredChain_dataOutputAllowedSet (m_prefix + "filteredChain_dataOutputAllowedSet" ),
886 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
887  m_option_filteredChain_computeStats (m_prefix + "filteredChain_computeStats" ),
888 #endif
889  m_option_displayCandidates (m_prefix + "displayCandidates" ),
890  m_option_putOutOfBoundsInChain (m_prefix + "putOutOfBoundsInChain" ),
891  m_option_tk_useLocalHessian (m_prefix + "tk_useLocalHessian" ),
892  m_option_tk_useNewtonComponent (m_prefix + "tk_useNewtonComponent" ),
893  m_option_dr_maxNumExtraStages (m_prefix + "dr_maxNumExtraStages" ),
894  m_option_dr_listOfScalesForExtraStages (m_prefix + "dr_listOfScalesForExtraStages" ),
895  m_option_dr_duringAmNonAdaptiveInt (m_prefix + "dr_duringAmNonAdaptiveInt" ),
896  m_option_am_keepInitialMatrix (m_prefix + "am_keepInitialMatrix" ),
897  m_option_am_initialNonAdaptInterval (m_prefix + "am_initialNonAdaptInterval" ),
898  m_option_am_adaptInterval (m_prefix + "am_adaptInterval" ),
899  m_option_am_adaptedMatrices_dataOutputPeriod (m_prefix + "am_adaptedMatrices_dataOutputPeriod" ),
900  m_option_am_adaptedMatrices_dataOutputFileName (m_prefix + "am_adaptedMatrices_dataOutputFileName" ),
901  m_option_am_adaptedMatrices_dataOutputFileType (m_prefix + "am_adaptedMatrices_dataOutputFileType" ),
902  m_option_am_adaptedMatrices_dataOutputAllowAll (m_prefix + "am_adaptedMatrices_dataOutputAllowAll" ),
903  m_option_am_adaptedMatrices_dataOutputAllowedSet (m_prefix + "am_adaptedMatrices_dataOutputAllowedSet" ),
904  m_option_am_eta (m_prefix + "am_eta" ),
905  m_option_am_epsilon (m_prefix + "am_epsilon" ),
906  m_option_enableBrooksGelmanConvMonitor (m_prefix + "enableBrooksGelmanConvMonitor" ),
907  m_option_BrooksGelmanLag (m_prefix + "BrooksGelmanLag" ),
908  m_option_outputLogLikelihood (m_prefix + "outputLogLikelihood" ),
909  m_option_outputLogTarget (m_prefix + "outputLogTarget" ),
910  m_option_doLogitTransform (m_prefix + "doLogitTransform" ),
911  m_option_algorithm (m_prefix + "algorithm" ),
912  m_option_tk (m_prefix + "tk" ),
913  m_option_updateInterval (m_prefix + "updateInterval" )
914 {
915  queso_deprecated();
916 
917  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"));
918 }
919 // Constructor 2------------------------------------
921  const BaseEnvironment& env,
922  const char* prefix,
923  const MhOptionsValues& alternativeOptionsValues)
924  :
925  m_ov (alternativeOptionsValues),
926 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
927  m_rawChainStatisticalOptionsObj (NULL),
928  m_rawChainStatOptsInstantiated (false),
929  m_filteredChainStatisticalOptionsObj (NULL),
930  m_filteredChainStatOptsInstantiated (false),
931 #endif
932  m_prefix ((std::string)(prefix) + "mh_"),
933  m_env (env),
934 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
935  m_optionsDesc (),
936 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
937  m_option_help (m_prefix + "help" ),
938  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
939  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
940  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
941  m_option_totallyMute (m_prefix + "totallyMute" ),
942  m_option_initialPosition_dataInputFileName (m_prefix + "initialPosition_dataInputFileName" ),
943  m_option_initialPosition_dataInputFileType (m_prefix + "initialPosition_dataInputFileType" ),
944  m_option_initialProposalCovMatrix_dataInputFileName(m_prefix + "initialProposalCovMatrix_dataInputFileName"),
945  m_option_initialProposalCovMatrix_dataInputFileType(m_prefix + "initialProposalCovMatrix_dataInputFileType"),
946  m_option_listOfDisabledParameters (m_prefix + "listOfDisabledParameters" ),
947  m_option_rawChain_dataInputFileName (m_prefix + "rawChain_dataInputFileName" ),
948  m_option_rawChain_dataInputFileType (m_prefix + "rawChain_dataInputFileType" ),
949  m_option_rawChain_size (m_prefix + "rawChain_size" ),
950  m_option_rawChain_generateExtra (m_prefix + "rawChain_generateExtra" ),
951  m_option_rawChain_displayPeriod (m_prefix + "rawChain_displayPeriod" ),
952  m_option_rawChain_measureRunTimes (m_prefix + "rawChain_measureRunTimes" ),
953  m_option_rawChain_dataOutputPeriod (m_prefix + "rawChain_dataOutputPeriod" ),
954  m_option_rawChain_dataOutputFileName (m_prefix + "rawChain_dataOutputFileName" ),
955  m_option_rawChain_dataOutputFileType (m_prefix + "rawChain_dataOutputFileType" ),
956  m_option_rawChain_dataOutputAllowAll (m_prefix + "rawChain_dataOutputAllowAll" ),
957  m_option_rawChain_dataOutputAllowedSet (m_prefix + "rawChain_dataOutputAllowedSet" ),
958 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
959  m_option_rawChain_computeStats (m_prefix + "rawChain_computeStats" ),
960 #endif
961  m_option_filteredChain_generate (m_prefix + "filteredChain_generate" ),
962  m_option_filteredChain_discardedPortion (m_prefix + "filteredChain_discardedPortion" ),
963  m_option_filteredChain_lag (m_prefix + "filteredChain_lag" ),
964  m_option_filteredChain_dataOutputFileName (m_prefix + "filteredChain_dataOutputFileName" ),
965  m_option_filteredChain_dataOutputFileType (m_prefix + "filteredChain_dataOutputFileType" ),
966  m_option_filteredChain_dataOutputAllowAll (m_prefix + "filteredChain_dataOutputAllowAll" ),
967  m_option_filteredChain_dataOutputAllowedSet (m_prefix + "filteredChain_dataOutputAllowedSet" ),
968 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
969  m_option_filteredChain_computeStats (m_prefix + "filteredChain_computeStats" ),
970 #endif
971  m_option_displayCandidates (m_prefix + "displayCandidates" ),
972  m_option_putOutOfBoundsInChain (m_prefix + "putOutOfBoundsInChain" ),
973  m_option_tk_useLocalHessian (m_prefix + "tk_useLocalHessian" ),
974  m_option_tk_useNewtonComponent (m_prefix + "tk_useNewtonComponent" ),
975  m_option_dr_maxNumExtraStages (m_prefix + "dr_maxNumExtraStages" ),
976  m_option_dr_listOfScalesForExtraStages (m_prefix + "dr_listOfScalesForExtraStages" ),
977  m_option_dr_duringAmNonAdaptiveInt (m_prefix + "dr_duringAmNonAdaptiveInt" ),
978  m_option_am_keepInitialMatrix (m_prefix + "am_keepInitialMatrix" ),
979  m_option_am_initialNonAdaptInterval (m_prefix + "am_initialNonAdaptInterval" ),
980  m_option_am_adaptInterval (m_prefix + "am_adaptInterval" ),
981  m_option_am_adaptedMatrices_dataOutputPeriod (m_prefix + "am_adaptedMatrices_dataOutputPeriod" ),
982  m_option_am_adaptedMatrices_dataOutputFileName (m_prefix + "am_adaptedMatrices_dataOutputFileName" ),
983  m_option_am_adaptedMatrices_dataOutputFileType (m_prefix + "am_adaptedMatrices_dataOutputFileType" ),
984  m_option_am_adaptedMatrices_dataOutputAllowAll (m_prefix + "am_adaptedMatrices_dataOutputAllowAll" ),
985  m_option_am_adaptedMatrices_dataOutputAllowedSet (m_prefix + "am_adaptedMatrices_dataOutputAllowedSet" ),
986  m_option_am_eta (m_prefix + "am_eta" ),
987  m_option_am_epsilon (m_prefix + "am_epsilon" ),
988  m_option_enableBrooksGelmanConvMonitor (m_prefix + "enableBrooksGelmanConvMonitor" ),
989  m_option_BrooksGelmanLag (m_prefix + "BrooksGelmanLag" ),
990  m_option_outputLogLikelihood (m_prefix + "outputLogLikelihood" ),
991  m_option_outputLogTarget (m_prefix + "outputLogTarget" ),
992  m_option_doLogitTransform (m_prefix + "doLogitTransform" ),
993  m_option_algorithm (m_prefix + "algorithm" ),
994  m_option_tk (m_prefix + "tk" ),
995  m_option_updateInterval (m_prefix + "updateInterval" )
996 {
997  queso_deprecated();
998 
999  queso_require_equal_to_msg(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the existence of an options input file"));
1000 
1001  if ((m_env.subDisplayFile() != NULL ) &&
1002  (m_ov.m_totallyMute == false)) {
1003  *m_env.subDisplayFile() << "In MetropolisHastingsSGOptions::constructor(2)"
1004  << ": after setting values of options with prefix '" << m_prefix
1005  << "', state of object is:"
1006  << "\n" << *this
1007  << std::endl;
1008  }
1009 
1010 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1014  }
1018  }
1019 #endif
1020 }
1021 // Copy constructor---------------------------------
1023  const MLSamplingLevelOptions& mlOptions)
1024  :
1025 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1026  m_ov (NULL,NULL), // dakota
1027  m_rawChainStatisticalOptionsObj (NULL),
1028  m_rawChainStatOptsInstantiated (false),
1029  m_filteredChainStatisticalOptionsObj (NULL),
1030  m_filteredChainStatOptsInstantiated (false),
1031 #else
1032  m_ov (),
1033 #endif
1034  m_prefix (mlOptions.m_prefix),
1035  m_env (mlOptions.env()),
1036 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
1037  m_optionsDesc (),
1038 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
1039  m_option_help (m_prefix + "help" ),
1040  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
1041  m_option_dataOutputAllowAll (m_prefix + "dataOutputAllowAll" ),
1042  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
1043  m_option_totallyMute (m_prefix + "totallyMute" ),
1044  m_option_initialPosition_dataInputFileName (m_prefix + "initialPosition_dataInputFileName" ),
1045  m_option_initialPosition_dataInputFileType (m_prefix + "initialPosition_dataInputFileType" ),
1046  m_option_initialProposalCovMatrix_dataInputFileName(m_prefix + "initialProposalCovMatrix_dataInputFileName"),
1047  m_option_initialProposalCovMatrix_dataInputFileType(m_prefix + "initialProposalCovMatrix_dataInputFileType"),
1048  m_option_listOfDisabledParameters (m_prefix + "listOfDisabledParameters" ),
1049  m_option_rawChain_dataInputFileName (m_prefix + "rawChain_dataInputFileName" ),
1050  m_option_rawChain_dataInputFileType (m_prefix + "rawChain_dataInputFileType" ),
1051  m_option_rawChain_size (m_prefix + "rawChain_size" ),
1052  m_option_rawChain_generateExtra (m_prefix + "rawChain_generateExtra" ),
1053  m_option_rawChain_displayPeriod (m_prefix + "rawChain_displayPeriod" ),
1054  m_option_rawChain_measureRunTimes (m_prefix + "rawChain_measureRunTimes" ),
1055  m_option_rawChain_dataOutputPeriod (m_prefix + "rawChain_dataOutputPeriod" ),
1056  m_option_rawChain_dataOutputFileName (m_prefix + "rawChain_dataOutputFileName" ),
1057  m_option_rawChain_dataOutputFileType (m_prefix + "rawChain_dataOutputFileType" ),
1058  m_option_rawChain_dataOutputAllowAll (m_prefix + "rawChain_dataOutputAllowAll" ),
1059  m_option_rawChain_dataOutputAllowedSet (m_prefix + "rawChain_dataOutputAllowedSet" ),
1060 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1061  m_option_rawChain_computeStats (m_prefix + "rawChain_computeStats" ),
1062 #endif
1063  m_option_filteredChain_generate (m_prefix + "filteredChain_generate" ),
1064  m_option_filteredChain_discardedPortion (m_prefix + "filteredChain_discardedPortion" ),
1065  m_option_filteredChain_lag (m_prefix + "filteredChain_lag" ),
1066  m_option_filteredChain_dataOutputFileName (m_prefix + "filteredChain_dataOutputFileName" ),
1067  m_option_filteredChain_dataOutputFileType (m_prefix + "filteredChain_dataOutputFileType" ),
1068  m_option_filteredChain_dataOutputAllowAll (m_prefix + "filteredChain_dataOutputAllowAll" ),
1069  m_option_filteredChain_dataOutputAllowedSet (m_prefix + "filteredChain_dataOutputAllowedSet" ),
1070 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1071  m_option_filteredChain_computeStats (m_prefix + "filteredChain_computeStats" ),
1072 #endif
1073  m_option_displayCandidates (m_prefix + "displayCandidates" ),
1074  m_option_putOutOfBoundsInChain (m_prefix + "putOutOfBoundsInChain" ),
1075  m_option_tk_useLocalHessian (m_prefix + "tk_useLocalHessian" ),
1076  m_option_tk_useNewtonComponent (m_prefix + "tk_useNewtonComponent" ),
1077  m_option_dr_maxNumExtraStages (m_prefix + "dr_maxNumExtraStages" ),
1078  m_option_dr_listOfScalesForExtraStages (m_prefix + "dr_listOfScalesForExtraStages" ),
1079  m_option_dr_duringAmNonAdaptiveInt (m_prefix + "dr_duringAmNonAdaptiveInt" ),
1080  m_option_am_keepInitialMatrix (m_prefix + "am_keepInitialMatrix" ),
1081  m_option_am_initialNonAdaptInterval (m_prefix + "am_initialNonAdaptInterval" ),
1082  m_option_am_adaptInterval (m_prefix + "am_adaptInterval" ),
1083  m_option_am_adaptedMatrices_dataOutputPeriod (m_prefix + "am_adaptedMatrices_dataOutputPeriod" ),
1084  m_option_am_adaptedMatrices_dataOutputFileName (m_prefix + "am_adaptedMatrices_dataOutputFileName" ),
1085  m_option_am_adaptedMatrices_dataOutputFileType (m_prefix + "am_adaptedMatrices_dataOutputFileType" ),
1086  m_option_am_adaptedMatrices_dataOutputAllowAll (m_prefix + "am_adaptedMatrices_dataOutputAllowAll" ),
1087  m_option_am_adaptedMatrices_dataOutputAllowedSet (m_prefix + "am_adaptedMatrices_dataOutputAllowedSet" ),
1088  m_option_am_eta (m_prefix + "am_eta" ),
1089  m_option_am_epsilon (m_prefix + "am_epsilon" ),
1090  m_option_enableBrooksGelmanConvMonitor (m_prefix + "enableBrooksGelmanConvMonitor" ),
1091  m_option_BrooksGelmanLag (m_prefix + "BrooksGelmanLag" ),
1092  m_option_outputLogLikelihood (m_prefix + "outputLogLikelihood" ),
1093  m_option_outputLogTarget (m_prefix + "outputLogTarget" ),
1094  m_option_doLogitTransform (m_prefix + "doLogitTransform" ),
1095  m_option_algorithm (m_prefix + "algorithm" ),
1096  m_option_tk (m_prefix + "tk" ),
1097  m_option_updateInterval (m_prefix + "updateInterval" )
1098 {
1099  queso_deprecated();
1100 
1104  m_ov.m_totallyMute = mlOptions.m_totallyMute;
1112  m_ov.m_rawChainSize = mlOptions.m_rawChainSize;
1121 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1123 #endif
1131 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1133 #endif
1149  m_ov.m_amEta = mlOptions.m_amEta;
1150  m_ov.m_amEpsilon = mlOptions.m_amEpsilon;
1151  m_ov.m_enableBrooksGelmanConvMonitor = UQ_MH_SG_ENABLE_BROOKS_GELMAN_CONV_MONITOR;
1152  m_ov.m_BrooksGelmanLag = UQ_MH_SG_BROOKS_GELMAN_LAG;
1153  m_ov.m_outputLogLikelihood = UQ_MH_SG_OUTPUT_LOG_LIKELIHOOD;
1154  m_ov.m_outputLogTarget = UQ_MH_SG_OUTPUT_LOG_TARGET;
1156  m_ov.m_algorithm = mlOptions.m_algorithm;
1157  m_ov.m_tk = mlOptions.m_tk;
1159 
1160 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1161 //m_ov.m_alternativeRawSsOptionsValues = mlOptions.; // dakota
1162 //m_ov.m_alternativeFilteredSsOptionsValues = mlOptions.; // dakota
1163 #endif
1164 
1165 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1170 #endif
1171  if ((m_env.subDisplayFile() != NULL ) &&
1172  (m_ov.m_totallyMute == false)) {
1173  *m_env.subDisplayFile() << "In MetropolisHastingsSGOptions::constructor(3)"
1174  << ": after copying values of options with prefix '" << m_prefix
1175  << "', state of object is:"
1176  << "\n" << *this
1177  << std::endl;
1178  }
1179 }
1180 // Destructor --------------------------------------
1182 {
1183  queso_deprecated();
1184 
1185 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1188 #endif
1189 }
1190 
1191 // I/O methods -------------------------------------
1192 void
1194 {
1195  queso_deprecated();
1196 
1197 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
1198  queso_require_msg(m_optionsDesc, "m_optionsDesc variable is NULL");
1199 
1203 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
1204 
1205  if ((m_env.subDisplayFile() != NULL) &&
1206  (m_ov.m_totallyMute == false )) {
1207  *m_env.subDisplayFile() << "In MetropolisHastingsSGOptions::scanOptionsValues()"
1208  << ": after reading values of options with prefix '" << m_prefix
1209  << "', state of object is:"
1210  << "\n" << *this
1211  << std::endl;
1212  }
1213 
1214 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1218  }
1222  }
1223 #endif
1224 
1225  return;
1226 }
1227 // -------------------------------------------------
1228 void
1229 MetropolisHastingsSGOptions::print(std::ostream& os) const
1230 {
1231  queso_deprecated();
1232 
1233  os << m_option_dataOutputFileName << " = " << m_ov.m_dataOutputFileName
1234  << "\n" << m_option_dataOutputAllowAll << " = " << m_ov.m_dataOutputAllowAll
1235  << "\n" << m_option_dataOutputAllowedSet << " = ";
1236  for (std::set<unsigned int>::iterator setIt = m_ov.m_dataOutputAllowedSet.begin(); setIt != m_ov.m_dataOutputAllowedSet.end(); ++setIt) {
1237  os << *setIt << " ";
1238  }
1239  os << "\n" << m_option_totallyMute << " = " << m_ov.m_totallyMute
1240  << "\n" << m_option_initialPosition_dataInputFileName << " = " << m_ov.m_initialPositionDataInputFileName
1241  << "\n" << m_option_initialPosition_dataInputFileType << " = " << m_ov.m_initialPositionDataInputFileType
1242  << "\n" << m_option_initialProposalCovMatrix_dataInputFileName << " = " << m_ov.m_initialProposalCovMatrixDataInputFileName
1243  << "\n" << m_option_initialProposalCovMatrix_dataInputFileType << " = " << m_ov.m_initialProposalCovMatrixDataInputFileType
1244  << "\n" << m_option_listOfDisabledParameters << " = ";
1245  for (std::set<unsigned int>::iterator setIt = m_ov.m_parameterDisabledSet.begin(); setIt != m_ov.m_parameterDisabledSet.end(); ++setIt) {
1246  os << *setIt << " ";
1247  }
1248  os << "\n" << m_option_rawChain_dataInputFileName << " = " << m_ov.m_rawChainDataInputFileName
1249  << "\n" << m_option_rawChain_dataInputFileType << " = " << m_ov.m_rawChainDataInputFileType
1250  << "\n" << m_option_rawChain_size << " = " << m_ov.m_rawChainSize
1251  << "\n" << m_option_rawChain_generateExtra << " = " << m_ov.m_rawChainGenerateExtra
1252  << "\n" << m_option_rawChain_displayPeriod << " = " << m_ov.m_rawChainDisplayPeriod
1253  << "\n" << m_option_rawChain_measureRunTimes << " = " << m_ov.m_rawChainMeasureRunTimes
1254  << "\n" << m_option_rawChain_dataOutputPeriod << " = " << m_ov.m_rawChainDataOutputPeriod
1255  << "\n" << m_option_rawChain_dataOutputFileName << " = " << m_ov.m_rawChainDataOutputFileName
1256  << "\n" << m_option_rawChain_dataOutputFileType << " = " << m_ov.m_rawChainDataOutputFileType
1257  << "\n" << m_option_rawChain_dataOutputAllowAll << " = " << m_ov.m_rawChainDataOutputAllowAll
1258  << "\n" << m_option_rawChain_dataOutputAllowedSet << " = ";
1259  for (std::set<unsigned int>::iterator setIt = m_ov.m_rawChainDataOutputAllowedSet.begin(); setIt != m_ov.m_rawChainDataOutputAllowedSet.end(); ++setIt) {
1260  os << *setIt << " ";
1261  }
1262  os
1263 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1264  << "\n" << m_option_rawChain_computeStats << " = " << m_ov.m_rawChainComputeStats
1265 #endif
1266  << "\n" << m_option_filteredChain_generate << " = " << m_ov.m_filteredChainGenerate
1267  << "\n" << m_option_filteredChain_discardedPortion << " = " << m_ov.m_filteredChainDiscardedPortion
1268  << "\n" << m_option_filteredChain_lag << " = " << m_ov.m_filteredChainLag
1269  << "\n" << m_option_filteredChain_dataOutputFileName << " = " << m_ov.m_filteredChainDataOutputFileName
1270  << "\n" << m_option_filteredChain_dataOutputFileType << " = " << m_ov.m_filteredChainDataOutputFileType
1271  << "\n" << m_option_filteredChain_dataOutputAllowAll << " = " << m_ov.m_filteredChainDataOutputAllowAll
1272  << "\n" << m_option_filteredChain_dataOutputAllowedSet << " = ";
1273  for (std::set<unsigned int>::iterator setIt = m_ov.m_filteredChainDataOutputAllowedSet.begin(); setIt != m_ov.m_filteredChainDataOutputAllowedSet.end(); ++setIt) {
1274  os << *setIt << " ";
1275  }
1276  os
1277 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1278  << "\n" << m_option_filteredChain_computeStats << " = " << m_ov.m_filteredChainComputeStats
1279 #endif
1280  << "\n" << m_option_displayCandidates << " = " << m_ov.m_displayCandidates
1281  << "\n" << m_option_putOutOfBoundsInChain << " = " << m_ov.m_putOutOfBoundsInChain
1282  << "\n" << m_option_tk_useLocalHessian << " = " << m_ov.m_tkUseLocalHessian
1283  << "\n" << m_option_tk_useNewtonComponent << " = " << m_ov.m_tkUseNewtonComponent
1284  << "\n" << m_option_dr_maxNumExtraStages << " = " << m_ov.m_drMaxNumExtraStages
1285  << "\n" << m_option_dr_listOfScalesForExtraStages << " = ";
1286  for (unsigned int i = 0; i < m_ov.m_drScalesForExtraStages.size(); ++i) {
1287  os << m_ov.m_drScalesForExtraStages[i] << " ";
1288  }
1289  os << "\n" << m_option_dr_duringAmNonAdaptiveInt << " = " << m_ov.m_drDuringAmNonAdaptiveInt
1290  << "\n" << m_option_am_keepInitialMatrix << " = " << m_ov.m_amKeepInitialMatrix
1291  << "\n" << m_option_am_initialNonAdaptInterval << " = " << m_ov.m_amInitialNonAdaptInterval
1292  << "\n" << m_option_am_adaptInterval << " = " << m_ov.m_amAdaptInterval
1293  << "\n" << m_option_am_adaptedMatrices_dataOutputPeriod << " = " << m_ov.m_amAdaptedMatricesDataOutputPeriod
1294  << "\n" << m_option_am_adaptedMatrices_dataOutputFileName << " = " << m_ov.m_amAdaptedMatricesDataOutputFileName
1295  << "\n" << m_option_am_adaptedMatrices_dataOutputFileType << " = " << m_ov.m_amAdaptedMatricesDataOutputFileType
1296  << "\n" << m_option_am_adaptedMatrices_dataOutputAllowAll << " = " << m_ov.m_amAdaptedMatricesDataOutputAllowAll
1297  << "\n" << m_option_am_adaptedMatrices_dataOutputAllowedSet << " = ";
1298  for (std::set<unsigned int>::iterator setIt = m_ov.m_amAdaptedMatricesDataOutputAllowedSet.begin(); setIt != m_ov.m_amAdaptedMatricesDataOutputAllowedSet.end(); ++setIt) {
1299  os << *setIt << " ";
1300  }
1301  os << "\n" << m_option_am_eta << " = " << m_ov.m_amEta
1302  << "\n" << m_option_am_epsilon << " = " << m_ov.m_amEpsilon
1303  << "\n" << m_option_enableBrooksGelmanConvMonitor << " = " << m_ov.m_enableBrooksGelmanConvMonitor
1304  << "\n" << m_option_BrooksGelmanLag << " = " << m_ov.m_BrooksGelmanLag
1305  << "\n" << m_option_outputLogLikelihood << " = " << m_ov.m_outputLogLikelihood
1306  << "\n" << m_option_outputLogTarget << " = " << m_ov.m_outputLogTarget
1307  << "\n" << m_option_doLogitTransform << " = " << m_ov.m_doLogitTransform
1308  << "\n" << m_option_algorithm << " = " << m_ov.m_algorithm
1309  << "\n" << m_option_tk << " = " << m_ov.m_tk
1310  << "\n" << m_option_updateInterval << " = " << m_ov.m_updateInterval
1311  << std::endl;
1312 
1313  return;
1314 }
1315 
1316 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
1317 // Private methods----------------------------------
1318 void
1319 MetropolisHastingsSGOptions::defineMyOptions(boost::program_options::options_description& optionsDesc) const
1320 {
1321  queso_deprecated();
1322 
1323  optionsDesc.add_options()
1324  (m_option_help.c_str(), "produce help msg for Bayesian Metropolis-Hastings" )
1325  (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" )
1326  (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" )
1327  (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" )
1328  (m_option_totallyMute.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_TOTALLY_MUTE_ODV ), "totally mute (no printout msg)" )
1329  (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 " )
1330  (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 " )
1331  (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 " )
1332  (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 " )
1333  (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" )
1334  (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 " )
1335  (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 " )
1336  (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" )
1337  (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" )
1338  (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" )
1339  (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" )
1340  (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" )
1341  (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 " )
1342  (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 " )
1343  (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" )
1344  (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" )
1345 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1346  (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" )
1347 #endif
1348  (m_option_filteredChain_generate.c_str(), boost::program_options::value<bool >()->default_value(UQ_MH_SG_FILTERED_CHAIN_GENERATE_ODV ), "generate filtered chain" )
1349  (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" )
1350  (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" )
1351  (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" )
1352  (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" )
1353  (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" )
1354  (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" )
1355 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1356  (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" )
1357 #endif
1358  (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" )
1359  (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" )
1360  (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" )
1361  (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" )
1362  (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" )
1363  (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" )
1364  (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" )
1365  (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" )
1366  (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" )
1367  (m_option_am_adaptInterval.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_AM_ADAPT_INTERVAL_ODV ), "'am' adaptation interval" )
1368  (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" )
1369  (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" )
1370  (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" )
1371  (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" )
1372  (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" )
1373  (m_option_am_eta.c_str(), boost::program_options::value<double >()->default_value(UQ_MH_SG_AM_ETA_ODV ), "'am' eta" )
1374  (m_option_am_epsilon.c_str(), boost::program_options::value<double >()->default_value(UQ_MH_SG_AM_EPSILON_ODV ), "'am' epsilon" )
1375  (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" )
1376  (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")
1377  (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" )
1378  (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" )
1379  (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" )
1380  (m_option_algorithm.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_ALGORITHM ), "which mcmc algorithm to use" )
1381  (m_option_tk.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MH_SG_TK ), "which mcmc tk to use" )
1382  (m_option_updateInterval.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MH_SG_UPDATE_INTERVAL ), "how often to call updateTK method" )
1383  ;
1384 
1385  return;
1386 }
1387 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
1388 
1389 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
1390 // -------------------------------------------------
1391 void
1392 MetropolisHastingsSGOptions::getMyOptionValues(boost::program_options::options_description& optionsDesc)
1393 {
1394  queso_deprecated();
1395 
1396  if (m_env.allOptionsMap().count(m_option_help)) {
1397  if ((m_env.subDisplayFile()) &&
1398  (m_ov.m_totallyMute == false)) {
1399  *m_env.subDisplayFile() << optionsDesc
1400  << std::endl;
1401  }
1402  }
1403 
1404  if (m_env.allOptionsMap().count(m_option_dataOutputFileName)) {
1405  m_ov.m_dataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dataOutputFileName]).as<std::string>();
1406  }
1407 
1408  if (m_env.allOptionsMap().count(m_option_dataOutputAllowAll.c_str())) {
1410  }
1411 
1412  if (m_ov.m_dataOutputAllowAll) {
1414  }
1415  else if (m_env.allOptionsMap().count(m_option_dataOutputAllowedSet)) {
1416  m_ov.m_dataOutputAllowedSet.clear();
1417  std::vector<double> tmpAllow(0,0.);
1418  std::string inputString = m_env.allOptionsMap()[m_option_dataOutputAllowedSet].as<std::string>();
1419  MiscReadDoublesFromString(inputString,tmpAllow);
1420 
1421  if (tmpAllow.size() > 0) {
1422  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
1423  m_ov.m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
1424  }
1425  }
1426  }
1427 
1428  if (m_env.allOptionsMap().count(m_option_totallyMute)) {
1429  m_ov.m_totallyMute = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_totallyMute]).as<bool>();
1430  }
1431 
1432  if (m_env.allOptionsMap().count(m_option_initialPosition_dataInputFileName)) {
1433  m_ov.m_initialPositionDataInputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_initialPosition_dataInputFileName]).as<std::string>();
1434  }
1435 
1436  if (m_env.allOptionsMap().count(m_option_initialPosition_dataInputFileType)) {
1437  m_ov.m_initialPositionDataInputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_initialPosition_dataInputFileType]).as<std::string>();
1438  }
1439 
1440  if (m_env.allOptionsMap().count(m_option_initialProposalCovMatrix_dataInputFileName)) {
1441  m_ov.m_initialProposalCovMatrixDataInputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_initialProposalCovMatrix_dataInputFileName]).as<std::string>();
1442  }
1443 
1444  if (m_env.allOptionsMap().count(m_option_initialProposalCovMatrix_dataInputFileType)) {
1445  m_ov.m_initialProposalCovMatrixDataInputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_initialProposalCovMatrix_dataInputFileType]).as<std::string>();
1446  }
1447 
1448  if (m_env.allOptionsMap().count(m_option_listOfDisabledParameters)) {
1449  m_ov.m_parameterDisabledSet.clear();
1450  std::vector<double> tmpAllow(0,0.);
1451  std::string inputString = m_env.allOptionsMap()[m_option_listOfDisabledParameters].as<std::string>();
1452  MiscReadDoublesFromString(inputString,tmpAllow);
1453  if (tmpAllow.size() > 0) {
1454  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
1455  m_ov.m_parameterDisabledSet.insert((unsigned int) tmpAllow[i]);
1456  }
1457  }
1458  }
1459 
1460  if (m_env.allOptionsMap().count(m_option_rawChain_dataInputFileName)) {
1461  m_ov.m_rawChainDataInputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_dataInputFileName]).as<std::string>();
1462  }
1463 
1464  if (m_env.allOptionsMap().count(m_option_rawChain_dataInputFileType)) {
1465  m_ov.m_rawChainDataInputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_dataInputFileType]).as<std::string>();
1466  }
1467 
1468  if (m_env.allOptionsMap().count(m_option_rawChain_size)) {
1469  m_ov.m_rawChainSize = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_size]).as<unsigned int>();
1470  }
1471 
1472  if (m_env.allOptionsMap().count(m_option_rawChain_displayPeriod)) {
1473  m_ov.m_rawChainDisplayPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_displayPeriod]).as<unsigned int>();
1474  }
1475 
1476  if (m_env.allOptionsMap().count(m_option_rawChain_measureRunTimes)) {
1477  m_ov.m_rawChainMeasureRunTimes = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_measureRunTimes]).as<bool>();
1478  }
1479 
1480  if (m_env.allOptionsMap().count(m_option_rawChain_dataOutputPeriod)) {
1481  m_ov.m_rawChainDataOutputPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_dataOutputPeriod]).as<unsigned int>();
1482  }
1483 
1484  if (m_env.allOptionsMap().count(m_option_rawChain_dataOutputFileName)) {
1485  m_ov.m_rawChainDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_dataOutputFileName]).as<std::string>();
1486  }
1487 
1488  if (m_env.allOptionsMap().count(m_option_rawChain_dataOutputFileType)) {
1489  m_ov.m_rawChainDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_dataOutputFileType]).as<std::string>();
1490  }
1491 
1492  if (m_env.allOptionsMap().count(m_option_rawChain_dataOutputAllowAll.c_str())) {
1494  }
1495 
1498  }
1499  else if (m_env.allOptionsMap().count(m_option_rawChain_dataOutputAllowedSet)) {
1501  std::vector<double> tmpAllow(0,0.);
1502  std::string inputString = m_env.allOptionsMap()[m_option_rawChain_dataOutputAllowedSet].as<std::string>();
1503  MiscReadDoublesFromString(inputString,tmpAllow);
1504 
1505  if (tmpAllow.size() > 0) {
1506  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
1507  m_ov.m_rawChainDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
1508  }
1509  }
1510  }
1511 
1512 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1513  if (m_env.allOptionsMap().count(m_option_rawChain_computeStats)) {
1514  m_ov.m_rawChainComputeStats = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_computeStats]).as<bool>();
1515  }
1516 #endif
1517  if (m_env.allOptionsMap().count(m_option_rawChain_generateExtra)) {
1518  m_ov.m_rawChainGenerateExtra = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_rawChain_generateExtra]).as<bool>();
1519  }
1520 
1521  if (m_env.allOptionsMap().count(m_option_filteredChain_generate)) {
1522  m_ov.m_filteredChainGenerate = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_generate]).as<bool>();
1523  }
1524 
1525  if (m_env.allOptionsMap().count(m_option_filteredChain_discardedPortion)) {
1526  m_ov.m_filteredChainDiscardedPortion = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_discardedPortion]).as<double>();
1527  }
1528 
1529  if (m_env.allOptionsMap().count(m_option_filteredChain_lag)) {
1530  m_ov.m_filteredChainLag = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_lag]).as<unsigned int>();
1531  }
1532  if ((m_ov.m_filteredChainGenerate == true) &&
1533  (m_ov.m_filteredChainLag < 2 )) {
1534  std::cerr << "WARNING In MetropolisHastingsSG<P_V,P_M>::getMyOptionsValues()"
1535  << ", worldRank " << m_env.worldRank()
1536  << ", fullRank " << m_env.fullRank()
1537  << ", subEnvironment " << m_env.subId()
1538  << ", subRank " << m_env.subRank()
1539  << ", inter0Rank " << m_env.inter0Rank()
1540  << ": forcing the value of '" << m_option_filteredChain_lag
1541  << "' from " << m_ov.m_filteredChainLag
1542  << " to " << 2
1543  << std::endl;
1545  }
1546 
1547  if (m_env.allOptionsMap().count(m_option_filteredChain_dataOutputFileName)) {
1548  m_ov.m_filteredChainDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_dataOutputFileName]).as<std::string>();
1549  }
1550 
1551  if (m_env.allOptionsMap().count(m_option_filteredChain_dataOutputFileType)) {
1552  m_ov.m_filteredChainDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_dataOutputFileType]).as<std::string>();
1553  }
1554 
1555  if (m_env.allOptionsMap().count(m_option_filteredChain_dataOutputAllowAll.c_str())) {
1557  }
1558 
1561  }
1562  else if (m_env.allOptionsMap().count(m_option_filteredChain_dataOutputAllowedSet)) {
1564  std::vector<double> tmpAllow(0,0.);
1565  std::string inputString = m_env.allOptionsMap()[m_option_filteredChain_dataOutputAllowedSet].as<std::string>();
1566  MiscReadDoublesFromString(inputString,tmpAllow);
1567 
1568  if (tmpAllow.size() > 0) {
1569  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
1570  m_ov.m_filteredChainDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
1571  }
1572  }
1573  }
1574 
1575 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
1576  if (m_env.allOptionsMap().count(m_option_filteredChain_computeStats)) {
1577  m_ov.m_filteredChainComputeStats = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_filteredChain_computeStats]).as<bool>();
1578  }
1579 #endif
1580  if (m_env.allOptionsMap().count(m_option_displayCandidates)) {
1581  m_ov.m_displayCandidates = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_displayCandidates]).as<bool>();
1582  }
1583 
1584  if (m_env.allOptionsMap().count(m_option_putOutOfBoundsInChain)) {
1585  m_ov.m_putOutOfBoundsInChain = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_putOutOfBoundsInChain]).as<bool>();
1586  }
1587 
1588  if (m_env.allOptionsMap().count(m_option_tk_useLocalHessian)) {
1589  m_ov.m_tkUseLocalHessian = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_tk_useLocalHessian]).as<bool>();
1590  }
1591 
1592  if (m_env.allOptionsMap().count(m_option_tk_useNewtonComponent)) {
1593  m_ov.m_tkUseNewtonComponent = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_tk_useNewtonComponent]).as<bool>();
1594  }
1595 
1596  if (m_env.allOptionsMap().count(m_option_dr_maxNumExtraStages)) {
1597  m_ov.m_drMaxNumExtraStages = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dr_maxNumExtraStages]).as<unsigned int>();
1598  }
1599 
1600  std::vector<double> tmpScales(0,0.);
1601  if (m_env.allOptionsMap().count(m_option_dr_listOfScalesForExtraStages)) {
1602  std::string inputString = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dr_listOfScalesForExtraStages]).as<std::string>();
1603  MiscReadDoublesFromString(inputString,tmpScales);
1604  //if (m_env.subDisplayFile()) {
1605  // *m_env.subDisplayFile() << "In MetropolisHastingsSG<P_V,P_M>::getMyOptionValues(): scales =";
1606  // for (unsigned int i = 0; i < tmpScales.size(); ++i) {
1607  // *m_env.subDisplayFile() << " " << tmpScales[i];
1608  // }
1609  // *m_env.subDisplayFile() << std::endl;
1610  //}
1611  }
1612 
1613  if (m_ov.m_drMaxNumExtraStages > 0) {
1614  double scale = 1.0;
1615  unsigned int tmpSize = tmpScales.size();
1616 
1619  for (unsigned int i = 0; i < m_ov.m_drMaxNumExtraStages; ++i) {
1620  if (i < tmpSize) scale = tmpScales[i];
1621  m_ov.m_drScalesForExtraStages[i] = scale;
1622  }
1623  //updateTK();
1624  }
1625 
1626  if (m_env.allOptionsMap().count(m_option_dr_duringAmNonAdaptiveInt)) {
1627  m_ov.m_drDuringAmNonAdaptiveInt = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dr_duringAmNonAdaptiveInt]).as<bool>();
1628  }
1629 
1630  if (m_env.allOptionsMap().count(m_option_am_keepInitialMatrix)) {
1631  m_ov.m_amKeepInitialMatrix = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_keepInitialMatrix]).as<bool>();
1632  }
1633 
1634  if (m_env.allOptionsMap().count(m_option_am_initialNonAdaptInterval)) {
1635  m_ov.m_amInitialNonAdaptInterval = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_initialNonAdaptInterval]).as<unsigned int>();
1636  }
1637 
1638  if (m_env.allOptionsMap().count(m_option_am_adaptInterval)) {
1639  m_ov.m_amAdaptInterval = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_adaptInterval]).as<unsigned int>();
1640  }
1641 
1642  if (m_env.allOptionsMap().count(m_option_am_adaptedMatrices_dataOutputPeriod)) {
1643  m_ov.m_amAdaptedMatricesDataOutputPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_adaptedMatrices_dataOutputPeriod]).as<unsigned int>();
1644  }
1645 
1646  if (m_env.allOptionsMap().count(m_option_am_adaptedMatrices_dataOutputFileName)) {
1647  m_ov.m_amAdaptedMatricesDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_adaptedMatrices_dataOutputFileName]).as<std::string>();
1648  }
1649 
1650  if (m_env.allOptionsMap().count(m_option_am_adaptedMatrices_dataOutputFileType)) {
1651  m_ov.m_amAdaptedMatricesDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_adaptedMatrices_dataOutputFileType]).as<std::string>();
1652  }
1653 
1654  if (m_env.allOptionsMap().count(m_option_am_adaptedMatrices_dataOutputAllowAll.c_str())) {
1656  }
1657 
1660  }
1661  else if (m_env.allOptionsMap().count(m_option_am_adaptedMatrices_dataOutputAllowedSet)) {
1663  std::vector<double> tmpAllow(0,0.);
1664  std::string inputString = m_env.allOptionsMap()[m_option_am_adaptedMatrices_dataOutputAllowedSet].as<std::string>();
1665  MiscReadDoublesFromString(inputString,tmpAllow);
1666 
1667  if (tmpAllow.size() > 0) {
1668  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
1669  m_ov.m_amAdaptedMatricesDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
1670  }
1671  }
1672  }
1673 
1674  if (m_env.allOptionsMap().count(m_option_am_eta)) {
1675  m_ov.m_amEta = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_eta]).as<double>();
1676  }
1677 
1678  if (m_env.allOptionsMap().count(m_option_am_epsilon)) {
1679  m_ov.m_amEpsilon = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_am_epsilon]).as<double>();
1680  }
1681 
1682  if (m_env.allOptionsMap().count(m_option_enableBrooksGelmanConvMonitor)) {
1683  m_ov.m_enableBrooksGelmanConvMonitor = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_enableBrooksGelmanConvMonitor]).as<unsigned int>();
1684  }
1685 
1686  if (m_env.allOptionsMap().count(m_option_BrooksGelmanLag)) {
1687  m_ov.m_BrooksGelmanLag = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_BrooksGelmanLag]).as<unsigned int>();
1688  }
1689 
1690  if (m_env.allOptionsMap().count(m_option_outputLogLikelihood)) {
1691  m_ov.m_outputLogLikelihood = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_outputLogLikelihood]).as<bool>();
1692  }
1693 
1694  if (m_env.allOptionsMap().count(m_option_outputLogTarget)) {
1695  m_ov.m_outputLogTarget = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_outputLogTarget]).as<bool>();
1696  }
1697 
1698  if (m_env.allOptionsMap().count(m_option_doLogitTransform)) {
1699  m_ov.m_doLogitTransform = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_doLogitTransform]).as<bool>();
1700  }
1701 
1702  if (m_env.allOptionsMap().count(m_option_algorithm)) {
1703  m_ov.m_algorithm = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_algorithm]).as<std::string>();
1704  }
1705 
1706  if (m_env.allOptionsMap().count(m_option_tk)) {
1707  m_ov.m_tk = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_tk]).as<std::string>();
1708  }
1709 
1710  if (m_env.allOptionsMap().count(m_option_updateInterval)) {
1711  m_ov.m_updateInterval = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_updateInterval]).as<unsigned int>();
1712  }
1713 }
1714 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
1715 
1716 // --------------------------------------------------
1717 // Operator declared outside class definition ------
1718 // --------------------------------------------------
1719 
1720 std::ostream& operator<<(std::ostream& os, const MetropolisHastingsSGOptions& obj)
1721 {
1722  queso_deprecated();
1723 
1724  obj.print(os);
1725 
1726  return os;
1727 }
1728 
1729 } // End namespace QUESO
unsigned int m_rawChainDataOutputPeriod
Period of message display during raw chain generation.
SequenceStatisticalOptions * m_filteredChainStatisticalOptionsObj
bool m_drDuringAmNonAdaptiveInt
Do delayed rejection during the initial non-adaptive part of sampling?
std::string m_amAdaptedMatricesDataOutputFileName
Name of output file for &#39;am&#39; adapted matrices.
bool m_rawChainComputeStats
Compute statistics on raw chain.
std::string m_option_initialProposalCovMatrix_dataInputFileType
Option name for MhOptionsValues::m_initialProposalCovMatrixDataInputFileType. Option name is m_prefix...
std::string m_option_am_keepInitialMatrix
Option name for MhOptionsValues::m_amKeepInitialMatrix. Option name is m_prefix + &quot;mh_am_keepInitialM...
bool m_filteredChainGenerate
Whether or not to generate filtered chain.
std::string m_rawChainDataOutputFileName
If not &quot;.&quot;, filename to write the Markov chain to.
void scanOptionsValues()
It scans the option values from the options input file.
unsigned int m_drMaxNumExtraStages
&#39;dr&#39; maximum number of extra stages.
bool m_putOutOfBoundsInChain
Flag to tell QUESO how chains should be upon generating a proposal that is out of the problem domain...
bool m_rawChainDataOutputAllowAll
Whether or not subEnvs will write to output file for raw chain.
std::string m_algorithm
Which algorithm to use for sampling.
unsigned int subId() const
Access function to the number of each sub-environment Id: m_subId.
Definition: Environment.C:342
bool m_amKeepInitialMatrix
This option is a no-op. The default is false.
std::set< unsigned int > m_amAdaptedMatricesDataOutputAllowedSet
subEnvs that will write to output file for &#39;am&#39; adapted matrices.
std::string m_option_rawChain_measureRunTimes
Option name for MhOptionsValues::m_rawChainMeasureRunTimes. Option name is m_prefix + &quot;mh_rawChain_me...
bool m_totallyMute
Whether or not to be totally mute (no printout message).
std::string m_option_rawChain_size
Option name for MhOptionsValues::m_rawChainSize. Option name is m_prefix + &quot;mh_rawChain_size&quot;.
std::string m_rawChainDataOutputFileType
The filetype of m_rawChainDataOutputFileName.
std::string m_tk
Which transition kernel to use for MCMC. Default is &quot;random_walk&quot;.
std::string m_option_updateInterval
Option name for MhOptionsValues::m_updateInterval. Option name is m_prefix + &quot;mh_updateInterval&quot;.
void checkOptions(const BaseEnvironment *env)
MhOptionsValues & operator=(const MhOptionsValues &rhs)
Assignment operator; it copies rhs to this.
std::string m_initialProposalCovMatrixDataInputFileName
If not &quot;.&quot;, reads the contents of the file as the initial proposal covariance matrix.
std::string m_rawChainDataInputFileName
Name of input file for raw chain.
bool m_displayCandidates
Display candidates generated in the core MH algorithm.
bool m_amAdaptedMatricesDataOutputAllowAll
Whether or not subEnvs will write to output file for &#39;am&#39; adapted matrices.
std::string m_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...
bool m_totallyMute
If true, zero output is written to files. Default is false.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:198
unsigned int m_amInitialNonAdaptInterval
The number of initial samples to do without adapting the proposal covariance matrix.
std::string m_initialPositionDataInputFileName
If not &quot;.&quot;, reads the contents of the file and uses that to start the MCMC. Default is &quot;...
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_algorithm
Option name for MhOptionsValues::m_algorithm. Option name is m_prefix + &quot;mh_algorithm&quot;.
A templated class that stores statistical options (optionally read from an input file) ...
std::string m_option_rawChain_dataInputFileType
Option name for MhOptionsValues::m_rawChainDataInputFileType. Option name is m_prefix + &quot;mh_rawChain_...
std::string m_option_filteredChain_generate
Option name for MhOptionsValues::m_filteredChainGenerate. Option name is m_prefix + &quot;mh_filteredChain...
unsigned int m_BrooksGelmanLag
The lag with which to compute the Brooks-Gelman convergence statistic.
std::string m_initialPositionDataInputFileName
Name of input file for initial position.
std::string m_option_initialProposalCovMatrix_dataInputFileName
Option name for MhOptionsValues::m_initialProposalCovMatrixDataInputFileName. Option name is m_prefix...
std::string m_option_putOutOfBoundsInChain
Option name for MhOptionsValues::m_putOutOfBoundsInChain. Option name is m_prefix + &quot;mh_putOutOfBound...
std::string m_option_am_adaptedMatrices_dataOutputFileType
Option name for MhOptionsValues::m_amAdaptedMatricesDataOutputFileType. Option name is m_prefix + &quot;mh...
std::string m_initialProposalCovMatrixDataInputFileName
Name of input file for initial proposal covariance matrix.
boost::program_options::variables_map & allOptionsMap() const
Definition: Environment.C:386
const BaseEnvironment & m_env
This class reads the options for the Metropolis-Hastings generator of samples from an input file...
unsigned int m_rawChainSize
Size of raw chain.
std::string m_option_listOfDisabledParameters
Option name for MhOptionsValues::m_parameterDisabledSet. Option name is m_prefix + &quot;mh_listOfDisabled...
SsOptionsValues m_alternativeRawSsOptionsValues
std::ostream & operator<<(std::ostream &os, const SequenceStatisticalOptions &obj)
std::string m_option_rawChain_dataOutputFileName
Option name for MhOptionsValues::m_rawChainDataOutputFileName. Option name is m_prefix + &quot;mh_rawChain...
std::string m_option_outputLogTarget
Option name for MhOptionsValues::m_outputLogTarget. Option name is m_prefix + &quot;mh_outputLogTarget&quot;.
unsigned int m_enableBrooksGelmanConvMonitor
The frequency with which to compute the Brooks-Gelman convergence statistic.
std::string m_option_BrooksGelmanLag
Option name for MhOptionsValues::m_BrooksGelmanLag. Option name is m_prefix + &quot;mh_BrooksGelmanLag&quot;.
bool m_rawChainMeasureRunTimes
If true, measures timings spent in various chain computions and writes them to the output file...
void print(std::ostream &os) const
It prints the option values.
const GetPot & input() const
The GetPot input file parser.
Definition: Environment.C:1149
MonteCarloSGOptions::MonteCarloSGOptions(const BaseEnvironment &env, const char *prefix 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"))
std::string m_rawChainDataOutputFileType
Type of output file for raw chain.
int subRank() const
Returns the rank of the MPI process in the sub-communicator subComm()
Definition: Environment.C:287
std::string m_rawChainDataInputFileType
The filetype of m_rawChainDataInputFileName. Only &quot;m&quot; (matlab) is currently supported. Default is &quot;m&quot;.
bool m_tkUseLocalHessian
Flag to tell QUESO whether or not to use Hessian information for the proposal covariance matrix...
double m_amEta
&#39;am&#39; eta.
bool m_filteredChainGenerate
Toggle the option to save a filtered chain.
std::set< unsigned int > m_rawChainDataOutputAllowedSet
The set of MPI ranks that will write Markov chain output to a file. See also m_rawChainDataOutputAllo...
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:354
virtual ~MhOptionsValues()
Destructor.
std::string m_option_filteredChain_lag
Option name for MhOptionsValues::m_filteredChainLag. Option name is m_prefix + &quot;mh_filteredChain_lag&quot;...
bool m_rawChainGenerateExtra
Generate extra information about raw chain.
std::string m_initialPositionDataInputFileType
Type of input file for initial position.
bool m_doLogitTransform
Whether or not a logit transform will be done for bounded domains.
std::string m_option_filteredChain_dataOutputFileType
Option name for MhOptionsValues::m_filteredChainDataOutputFileType. Option name is m_prefix + &quot;mh_fil...
std::string m_option_initialPosition_dataInputFileType
Option name for MhOptionsValues::m_initialPositionDataInputFileType. Option name is m_prefix + &quot;mh_in...
SharedPtr< BaseTKGroup< P_V, P_M > >::Type m_tk
std::string m_option_rawChain_displayPeriod
Option name for MhOptionsValues::m_rawChainDisplayPeriod. Option name is m_prefix + &quot;mh_rawChain_disp...
MhOptionsValues()
Default constructor.
std::string m_option_dataOutputAllowedSet
Option name for MhOptionsValues::m_dataOutputAllowedSet. Option name is m_prefix + &quot;mh_dataOutputAllo...
std::string m_option_rawChain_dataInputFileName
Option name for MhOptionsValues::m_rawChainDataInputFileName. Option name is m_prefix + &quot;mh_rawChain_...
std::string m_amAdaptedMatricesDataOutputFileName
If not &quot;.&quot;, this is the file to write adapted proposal covariance matrices to. Default is &quot;...
std::string m_amAdaptedMatricesDataOutputFileType
The filetype of m_amAdaptedMatricesDataOutputFileName. Only &quot;m&quot; (matlab) is currently supported...
bool m_putOutOfBoundsInChain
Put &#39;out of bound&#39; candidates in chain as well.
int worldRank() const
Returns the same thing as fullRank()
Definition: Environment.C:262
unsigned int m_amInitialNonAdaptInterval
&#39;am&#39; initial non adaptation interval
bool m_filteredChainDataOutputAllowAll
Toggle for whether or not to allow all processes to write filtered Markov chain output to a file...
bool m_displayCandidates
Toggle to tell QUESO whether or not to write proposal (candidate) state to output file...
MetropolisHastingsSGOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
std::string m_option_am_epsilon
Option name for MhOptionsValues::m_amEpsilon. Option name is m_prefix + &quot;mh_am_epsilon&quot;.
std::set< unsigned int > m_parameterDisabledSet
Set of parameters that don&#39;t get sampled.
std::string m_option_filteredChain_dataOutputAllowAll
Option name for MhOptionsValues::m_filteredChainDataOutputAllowAll. Option name is m_prefix + &quot;mh_fil...
This class provides options for the Metropolis-Hastings generator of samples if no input file is avai...
unsigned int m_filteredChainLag
Spacing for chain filtering.
std::string m_option_tk_useNewtonComponent
Option name for MhOptionsValues::m_tkUseNewtonComponent. Option name is m_prefix + &quot;mh_tk_useNewtonCo...
int fullRank() const
Returns the rank of the MPI process in QUESO&#39;s full communicator.
Definition: Environment.C:268
unsigned int m_amAdaptInterval
&#39;am&#39; adaptation interval.
std::string m_option_doLogitTransform
Option name for MhOptionsValues::m_doLogitTransform. Option name is m_prefix + &quot;mh_doLogitTransform&quot;...
std::string m_option_rawChain_dataOutputPeriod
Option name for MhOptionsValues::m_rawChainDataOutputPeriod. Option name is m_prefix + &quot;mh_rawChain_d...
unsigned int m_updateInterval
How often to call the TK&#39;s updateTK method. Default is 1.
SequenceStatisticalOptions * m_rawChainStatisticalOptionsObj
std::string m_filteredChainDataOutputFileName
Name of output file for filtered chain.
MhOptionsValues m_ov
This class is where the actual options are stored.
std::string m_option_dataOutputFileName
Option name for MhOptionsValues::m_dataOutputFileName. Option name is m_prefix + &quot;mh_dataOutputFileNa...
std::string m_option_am_eta
Option name for MhOptionsValues::m_amEta. Option name is m_prefix + &quot;mh_am_eta&quot;.
std::string m_initialProposalCovMatrixDataInputFileType
The filetype of m_initialProposalCovMatrixDataInputFileName. Only &quot;m&quot; (matlab) is currently supported...
double m_amEpsilon
Regularisation parameter for the DRAM covariance matrix.
bool m_tkUseNewtonComponent
This option is a no-op. Default is true.
bool m_outputLogLikelihood
Flag for deciding whether or not to dump log likelihood values in output. Default is true...
std::string m_rawChainDataOutputFileName
Name of output file for raw chain.
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...
std::string m_dataOutputFileName
The base name of output files where the chain (and related information) will be written.
std::string m_option_am_eta
See MhOptionsValues::m_amEta.
std::string m_tk
Which transition kernel to use for sampling.
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
Definition: Miscellaneous.C:40
std::set< unsigned int > m_dataOutputAllowedSet
subEnvs that will write to generic output file.
std::string m_dataOutputFileName
Name of generic output file.
unsigned int m_updateInterval
How often to call the TK&#39;s updateTK method.
SsOptionsValues m_alternativeFilteredSsOptionsValues
unsigned int m_rawChainDisplayPeriod
Period of message display during raw chain generation.
std::string m_initialPositionDataInputFileType
The filetype of m_initialPositionDataInputFileName. Only &quot;m&quot; (matlab) is currently supported...
std::string m_rawChainDataInputFileName
Filename for reading an already-produced Markov chain.
std::string m_filteredChainDataOutputFileType
The filetype of m_filteredChainDataOutputFileName. Only &quot;m&quot; (matlab) is currently supported...
std::string m_option_am_epsilon
See MhOptionsValues::m_amEpsilon.
std::string m_option_am_adaptedMatrices_dataOutputPeriod
Option name for MhOptionsValues::m_amAdaptedMatricesDataOutputPeriod. Option name is m_prefix + &quot;mh_a...
std::string m_option_outputLogLikelihood
Option name for MhOptionsValues::m_outputLogLikelihood. Option name is m_prefix + &quot;mh_outputLogLikeli...
bool m_dataOutputAllowAll
subEnvs that will write to generic output file.
bool m_tkUseNewtonComponent
Whether or not &#39;proposal&#39; uses Newton component.
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:397
bool m_doLogitTransform
Flag for deciding whether or not to do logit transform of bounded domains Default is true...
std::string m_option_filteredChain_dataOutputAllowedSet
Option name for MhOptionsValues::m_filteredChainDataOutputAllowedSet. Option name is m_prefix + &quot;mh_f...
SequenceStatisticalOptions * m_rawChainStatisticalOptionsObj
This class provides options for each level of the Multilevel sequence generator if no input file is a...
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the sequence options defined to the Metropolis-Hastings algorithm.
std::string m_option_filteredChain_discardedPortion
Option name for MhOptionsValues::m_filteredChainDiscardedPortion. Option name is m_prefix + &quot;mh_filte...
std::string m_initialProposalCovMatrixDataInputFileType
Type of input file for initial proposal covariance matrix.
bool m_rawChainGenerateExtra
If true, extra chain information is computed/stored.
unsigned int m_amAdaptInterval
The frequency at which to adapt the proposal covariance matrix.
std::string m_option_displayCandidates
Option name for MhOptionsValues::m_displayCandidates. Option name is m_prefix + &quot;mh_displayCandidates...
double m_amEta
Proposal covariance scaling factor, usually 2.4 * 2.4 / d.
unsigned int m_rawChainDataOutputPeriod
The frequency with which to write chain output. Defaults to 0.
bool m_filteredChainComputeStats
Compute statistics on filtered chain.
bool m_tkUseLocalHessian
Whether or not &#39;proposal&#39; uses local Hessian.
std::string m_amAdaptedMatricesDataOutputFileType
Type of output file for &#39;am&#39; adapted matrices.
MonteCarloSGOptions::MonteCarloSGOptions(const BaseEnvironment &env, const char *prefix, const McOptionsValues &alternativeOptionsValues queso_require_equal_to_msg)(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the existence of an options input file"))
SharedPtr< Algorithm< P_V, P_M > >::Type m_algorithm
std::string m_option_dataOutputAllowAll
Option name for MhOptionsValues::m_dataOutputAllowAll. Option name is m_prefix + &quot;mh_dataOutputAllowA...
std::string m_option_initialPosition_dataInputFileName
Option name for MhOptionsValues::m_initialPositionDataInputFileName. Option name is m_prefix + &quot;mh_in...
bool m_filteredChainDataOutputAllowAll
Whether or not subEnvs will write to output file for filtered chain.
std::set< unsigned int > m_rawChainDataOutputAllowedSet
subEnvs that will write to output file for raw chain.
std::set< unsigned int > m_amAdaptedMatricesDataOutputAllowedSet
This option is a no-op. The default is the empty set.
std::string m_option_dr_listOfScalesForExtraStages
Option name for MhOptionsValues::m_drScalesForExtraStages. Option name is m_prefix + &quot;mh_dr_listOfSca...
std::string m_option_am_adaptedMatrices_dataOutputAllowAll
Option name for MhOptionsValues::m_amAdaptedMatricesDataOutputAllowAll. Option name is m_prefix + &quot;mh...
std::string m_option_filteredChain_computeStats
Option name for MhOptionsValues::m_filteredChainComputeStats. Option name is m_prefix + &quot;mh_filteredC...
ScopedPtr< BoostInputOptionsParser >::Type m_parser
unsigned int m_filteredChainLag
Set the lag for the filtered chain. Default is 1.
std::string m_algorithm
Which algorithm to use for the MCMC. Default is &quot;random_walk&quot;.
std::string m_rawChainDataInputFileType
Type of input file for raw chain.
std::string m_filteredChainDataOutputFileName
If not &quot;.&quot;, file name to save the filtered chain to. Default is &quot;.&quot;.
std::string m_option_dr_maxNumExtraStages
Option name for MhOptionsValues::m_drMaxNumExtraStages. Option name is m_prefix + &quot;mh_dr_maxNumExtraS...
std::set< unsigned int > m_dataOutputAllowedSet
The set of MPI ranks that can write output. See m_dataOutputAllowAll.
bool m_rawChainDataOutputAllowAll
Toggle for whether or not to allow all processes to write Markov chain output to a file...
std::string m_option_am_adaptedMatrices_dataOutputFileName
Option name for MhOptionsValues::m_amAdaptedMatricesDataOutputFileName. Option name is m_prefix + &quot;mh...
unsigned int m_rawChainSize
The size of the chain (number of posterior samples) to generate. Default is 100.
std::string m_option_totallyMute
Option name for MhOptionsValues::m_totallyMute. Option name is m_prefix + &quot;mh_totallyMute&quot;.
unsigned int m_drMaxNumExtraStages
The number of delayed rejection stages to do. Default is 0.
bool m_drDuringAmNonAdaptiveInt
Whether or not &#39;dr&#39; is used during &#39;am&#39; non adaptive interval.
bool m_amKeepInitialMatrix
Whether or not &#39;am&#39; will keep initial (given) matrix.
ScopedPtr< boost::program_options::options_description >::Type m_optionsDesc
bool m_amAdaptedMatricesDataOutputAllowAll
This option is a no-op. The default is false.
double m_filteredChainDiscardedPortion
Initial discarded portion for chain filtering.
std::vector< double > m_drScalesForExtraStages
&#39;dr&#39; list of scales for proposal covariance matrices from 2nd stage on.
std::set< unsigned int > m_parameterDisabledSet
std::set< unsigned int > m_filteredChainDataOutputAllowedSet
subEnvs that will write to output file for filtered chain.
unsigned int m_amAdaptedMatricesDataOutputPeriod
The frequency (after m_amInitialNonAdaptInterval samples are done) of printing the last adapted propo...
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Defines the options for the Metropolis-Hastings generator of samples as the default options...
bool m_outputLogTarget
Flag for deciding whether or not to dump log target values in output Default is true.
std::string m_option_rawChain_computeStats
Option name for MhOptionsValues::m_rawChainComputeStats. Option name is m_prefix + &quot;mh_rawChain_compu...
std::vector< double > m_drScalesForExtraStages
The vector of scale factors for the proposal covariance matrix to use for delayed rejection...
unsigned int m_rawChainDisplayPeriod
The frequency with which to output diagnostic information.
std::string m_filteredChainDataOutputFileType
Type of output file for filtered chain.
int inter0Rank() const
Returns the process inter0 rank.
Definition: Environment.C:307
bool m_filteredChainComputeStats
Toggle to tell QUESO whether or not to compute statistics on the filtered chain. Default is false...
checkOptions()
SequenceStatisticalOptions * m_filteredChainStatisticalOptionsObj
std::string m_option_am_adaptedMatrices_dataOutputAllowedSet
Option name for MhOptionsValues::m_amAdaptedMatricesDataOutputAllowedSet. Option name is m_prefix + &quot;...
bool m_rawChainComputeStats
Flag to tell QUESO whether or not to compute chain statistics. Default is false.
bool m_dataOutputAllowAll
If true, all processes write output and m_dataOutputAllowedSet is ignored.
double m_amEpsilon
&#39;am&#39; epsilon.
std::string m_option_dr_duringAmNonAdaptiveInt
Option name for MhOptionsValues::m_drDuringAmNonAdaptiveInt. Option name is m_prefix + &quot;mh_dr_duringA...
void copy(const MhOptionsValues &src)
Copies the option values from src to this.
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_am_adaptInterval
Option name for MhOptionsValues::m_amAdaptInterval. Option name is m_prefix + &quot;mh_am_adaptInterval&quot;.
std::string m_option_rawChain_dataOutputAllowAll
Option name for MhOptionsValues::m_rawChainDataOutputAllowAll. Option name is m_prefix + &quot;mh_rawChain...
std::string m_option_tk
Option name for MhOptionsValues::m_tk. Option name is m_prefix + &quot;mh_tk&quot;.
std::string m_option_am_initialNonAdaptInterval
Option name for MhOptionsValues::m_amInitialNonAdaptInterval. Option name is m_prefix + &quot;mh_am_initia...
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320
std::string m_option_filteredChain_dataOutputFileName
Option name for MhOptionsValues::m_filteredChainDataOutputFileName. Option name is m_prefix + &quot;mh_fil...
bool m_rawChainMeasureRunTimes
Whether or not to measure run times.
unsigned int m_amAdaptedMatricesDataOutputPeriod
Period for outputing &#39;am&#39; adapted matrices.
double m_filteredChainDiscardedPortion
What initial fraction of the filtered chain is discarded.
A templated class that stores default statistical options for a sequence of vectors, e.g. a Markov chain, a Monte Carlo input sequence, or a Monte Carlo output sequence.

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