queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
SequenceStatisticalOptions.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/Defines.h>
26 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
27 
28 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
29 #include <boost/program_options.hpp>
30 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
31 
32 #include <queso/SequenceStatisticalOptions.h>
33 #include <queso/Miscellaneous.h>
34 
35 namespace QUESO {
36 
38  :
39  m_prefix ("stats_"),
40  m_initialDiscardedPortions(0 ),//,0.),
41 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
42  m_meanMonitorPeriod (UQ_SEQUENCE_MEAN_MONITOR_PERIOD_ODV ),
43  m_bmmRun (UQ_SEQUENCE_BMM_RUN_ODV ),
44  m_bmmLengths (0 ),//,0),
45  m_fftCompute (UQ_SEQUENCE_FFT_COMPUTE_ODV ),
46  m_fftParamId (UQ_SEQUENCE_FFT_PARAM_ID_ODV ),
47  m_fftSize (UQ_SEQUENCE_FFT_SIZE_ODV ),
48  m_fftTestInversion (UQ_SEQUENCE_FFT_TEST_INVERSION_ODV ),
49  m_fftWrite (UQ_SEQUENCE_FFT_WRITE_ODV ),
50  m_psdCompute (UQ_SEQUENCE_PSD_COMPUTE_ODV ),
51  m_psdNumBlocks (UQ_SEQUENCE_PSD_NUM_BLOCKS_ODV ),
52  m_psdHopSizeRatio (UQ_SEQUENCE_PSD_HOP_SIZE_RATIO_ODV ),
53  m_psdParamId (UQ_SEQUENCE_PSD_PARAM_ID_ODV ),
54  m_psdWrite (UQ_SEQUENCE_PSD_WRITE_ODV ),
55  m_psdAtZeroCompute (UQ_SEQUENCE_PSD_AT_ZERO_COMPUTE_ODV ),
56  m_psdAtZeroNumBlocks (0 ),//,0),
57  m_psdAtZeroHopSizeRatio (UQ_SEQUENCE_PSD_AT_ZERO_HOP_SIZE_RATIO_ODV ),
58  m_psdAtZeroDisplay (UQ_SEQUENCE_PSD_AT_ZERO_DISPLAY_ODV ),
59  m_psdAtZeroWrite (UQ_SEQUENCE_PSD_AT_ZERO_WRITE_ODV ),
60  m_gewekeCompute (UQ_SEQUENCE_GEWEKE_COMPUTE_ODV ),
61  m_gewekeNaRatio (UQ_SEQUENCE_GEWEKE_NA_RATIO_ODV ),
62  m_gewekeNbRatio (UQ_SEQUENCE_GEWEKE_NB_RATIO_ODV ),
63  m_gewekeDisplay (UQ_SEQUENCE_GEWEKE_DISPLAY_ODV ),
64  m_gewekeWrite (UQ_SEQUENCE_GEWEKE_WRITE_ODV ),
65  m_meanStaccCompute (UQ_SEQUENCE_MEAN_STACC_COMPUTE_ODV ),
66  m_histCompute (UQ_SEQUENCE_HIST_COMPUTE_ODV ),
67  m_histNumInternalBins (UQ_SEQUENCE_HIST_NUM_INTERNAL_BINS_ODV ),
68  m_cdfStaccCompute (UQ_SEQUENCE_CDF_STACC_COMPUTE_ODV ),
69  m_cdfStaccNumEvalPositions(UQ_SEQUENCE_CDF_STACC_NUM_EVAL_POSITIONS_ODV),
70 #endif
71  m_autoCorrComputeViaDef (UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_DEF_ODV ),
72  m_autoCorrComputeViaFft (UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_FFT_ODV ),
73  m_autoCorrSecondLag (UQ_SEQUENCE_AUTO_CORR_SECOND_LAG_ODV ),
74  m_autoCorrLagSpacing (UQ_SEQUENCE_AUTO_CORR_LAG_SPACING_ODV ),
75  m_autoCorrNumLags (UQ_SEQUENCE_AUTO_CORR_NUM_LAGS_ODV ),
76  m_autoCorrDisplay (UQ_SEQUENCE_AUTO_CORR_DISPLAY_ODV ),
77  m_autoCorrWrite (UQ_SEQUENCE_AUTO_CORR_WRITE_ODV ),
78  m_kdeCompute (UQ_SEQUENCE_KDE_COMPUTE_ODV ),
79  m_kdeNumEvalPositions (UQ_SEQUENCE_KDE_NUM_EVAL_POSITIONS_ODV ),
80  m_covMatrixCompute (UQ_SEQUENCE_COV_MATRIX_COMPUTE_ODV ),
81  m_corrMatrixCompute (UQ_SEQUENCE_CORR_MATRIX_COMPUTE_ODV ),
82  m_option_help (m_prefix + "help" ),
83  m_option_initialDiscardedPortions (m_prefix + "initialDiscardedPortions" ),
84 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
85  m_option_mean_monitorPeriod (m_prefix + "mean_monitorPeriod" ),
86  m_option_bmm_run (m_prefix + "bmm_run" ),
87  m_option_bmm_lengths (m_prefix + "bmm_lengths" ),
88  m_option_bmm_display (m_prefix + "bmm_display" ),
89  m_option_bmm_write (m_prefix + "bmm_write" ),
90  m_option_fft_compute (m_prefix + "fft_compute" ),
91  m_option_fft_paramId (m_prefix + "fft_paramId" ),
92  m_option_fft_size (m_prefix + "fft_size" ),
93  m_option_fft_testInversion (m_prefix + "fft_testInversion" ),
94  m_option_fft_write (m_prefix + "fft_write" ),
95  m_option_psd_compute (m_prefix + "psd_compute" ),
96  m_option_psd_numBlocks (m_prefix + "psd_numBlocks" ),
97  m_option_psd_hopSizeRatio (m_prefix + "psd_hopSizeRatio" ),
98  m_option_psd_paramId (m_prefix + "psd_paramId" ),
99  m_option_psd_write (m_prefix + "psd_write" ),
100  m_option_psdAtZero_compute (m_prefix + "psdAtZero_compute" ),
101  m_option_psdAtZero_numBlocks (m_prefix + "psdAtZero_numBlocks" ),
102  m_option_psdAtZero_hopSizeRatio (m_prefix + "psdAtZero_hopSizeRatio" ),
103  m_option_psdAtZero_display (m_prefix + "psdAtZero_display" ),
104  m_option_psdAtZero_write (m_prefix + "psdAtZero_write" ),
105  m_option_geweke_compute (m_prefix + "geweke_compute" ),
106  m_option_geweke_naRatio (m_prefix + "geweke_naRatio" ),
107  m_option_geweke_nbRatio (m_prefix + "geweke_nbRatio" ),
108  m_option_geweke_display (m_prefix + "geweke_display" ),
109  m_option_geweke_write (m_prefix + "geweke_write" ),
110  m_option_meanStacc_compute (m_prefix + "meanStacc_compute" ),
111  m_option_hist_compute (m_prefix + "hist_compute" ),
112  m_option_hist_numInternalBins (m_prefix + "hist_numInternalBins" ),
113  m_option_cdfStacc_compute (m_prefix + "cdfStacc_compute" ),
114  m_option_cdfStacc_numEvalPositions(m_prefix + "cdfStacc_numEvalPositions"),
115 #endif
116  m_option_autoCorr_computeViaDef (m_prefix + "autoCorr_computeViaDef" ),
117  m_option_autoCorr_computeViaFft (m_prefix + "autoCorr_computeViaFft" ),
118  m_option_autoCorr_secondLag (m_prefix + "autoCorr_secondLag" ),
119  m_option_autoCorr_lagSpacing (m_prefix + "autoCorr_lagSpacing" ),
120  m_option_autoCorr_numLags (m_prefix + "autoCorr_numLags" ),
121  m_option_autoCorr_display (m_prefix + "autoCorr_display" ),
122  m_option_autoCorr_write (m_prefix + "autoCorr_write" ),
123  m_option_kde_compute (m_prefix + "kde_compute" ),
124  m_option_kde_numEvalPositions (m_prefix + "kde_numEvalPositions" ),
125  m_option_covMatrix_compute (m_prefix + "covMatrix_compute" ),
126  m_option_corrMatrix_compute (m_prefix + "corrMatrix_compute" )
127 {
128 }
129 
130 SsOptionsValues::SsOptionsValues(const BaseEnvironment * env, const char *
131  prefix)
132  :
133  m_prefix ((std::string)(prefix) + "stats_"),
134  m_initialDiscardedPortions(0 ),//,0.),
135 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
136  m_meanMonitorPeriod (UQ_SEQUENCE_MEAN_MONITOR_PERIOD_ODV ),
137  m_bmmRun (UQ_SEQUENCE_BMM_RUN_ODV ),
138  m_bmmLengths (0 ),//,0),
139  m_fftCompute (UQ_SEQUENCE_FFT_COMPUTE_ODV ),
140  m_fftParamId (UQ_SEQUENCE_FFT_PARAM_ID_ODV ),
141  m_fftSize (UQ_SEQUENCE_FFT_SIZE_ODV ),
142  m_fftTestInversion (UQ_SEQUENCE_FFT_TEST_INVERSION_ODV ),
143  m_fftWrite (UQ_SEQUENCE_FFT_WRITE_ODV ),
144  m_psdCompute (UQ_SEQUENCE_PSD_COMPUTE_ODV ),
145  m_psdNumBlocks (UQ_SEQUENCE_PSD_NUM_BLOCKS_ODV ),
146  m_psdHopSizeRatio (UQ_SEQUENCE_PSD_HOP_SIZE_RATIO_ODV ),
147  m_psdParamId (UQ_SEQUENCE_PSD_PARAM_ID_ODV ),
148  m_psdWrite (UQ_SEQUENCE_PSD_WRITE_ODV ),
149  m_psdAtZeroCompute (UQ_SEQUENCE_PSD_AT_ZERO_COMPUTE_ODV ),
150  m_psdAtZeroNumBlocks (0 ),//,0),
151  m_psdAtZeroHopSizeRatio (UQ_SEQUENCE_PSD_AT_ZERO_HOP_SIZE_RATIO_ODV ),
152  m_psdAtZeroDisplay (UQ_SEQUENCE_PSD_AT_ZERO_DISPLAY_ODV ),
153  m_psdAtZeroWrite (UQ_SEQUENCE_PSD_AT_ZERO_WRITE_ODV ),
154  m_gewekeCompute (UQ_SEQUENCE_GEWEKE_COMPUTE_ODV ),
155  m_gewekeNaRatio (UQ_SEQUENCE_GEWEKE_NA_RATIO_ODV ),
156  m_gewekeNbRatio (UQ_SEQUENCE_GEWEKE_NB_RATIO_ODV ),
157  m_gewekeDisplay (UQ_SEQUENCE_GEWEKE_DISPLAY_ODV ),
158  m_gewekeWrite (UQ_SEQUENCE_GEWEKE_WRITE_ODV ),
159  m_meanStaccCompute (UQ_SEQUENCE_MEAN_STACC_COMPUTE_ODV ),
160  m_histCompute (UQ_SEQUENCE_HIST_COMPUTE_ODV ),
161  m_histNumInternalBins (UQ_SEQUENCE_HIST_NUM_INTERNAL_BINS_ODV ),
162  m_cdfStaccCompute (UQ_SEQUENCE_CDF_STACC_COMPUTE_ODV ),
163  m_cdfStaccNumEvalPositions(UQ_SEQUENCE_CDF_STACC_NUM_EVAL_POSITIONS_ODV),
164 #endif
165  m_autoCorrComputeViaDef (UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_DEF_ODV ),
166  m_autoCorrComputeViaFft (UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_FFT_ODV ),
167  m_autoCorrSecondLag (UQ_SEQUENCE_AUTO_CORR_SECOND_LAG_ODV ),
168  m_autoCorrLagSpacing (UQ_SEQUENCE_AUTO_CORR_LAG_SPACING_ODV ),
169  m_autoCorrNumLags (UQ_SEQUENCE_AUTO_CORR_NUM_LAGS_ODV ),
170  m_autoCorrDisplay (UQ_SEQUENCE_AUTO_CORR_DISPLAY_ODV ),
171  m_autoCorrWrite (UQ_SEQUENCE_AUTO_CORR_WRITE_ODV ),
172  m_kdeCompute (UQ_SEQUENCE_KDE_COMPUTE_ODV ),
173  m_kdeNumEvalPositions (UQ_SEQUENCE_KDE_NUM_EVAL_POSITIONS_ODV ),
174  m_covMatrixCompute (UQ_SEQUENCE_COV_MATRIX_COMPUTE_ODV ),
175  m_corrMatrixCompute (UQ_SEQUENCE_CORR_MATRIX_COMPUTE_ODV ),
176  m_parser(new BoostInputOptionsParser(env->optionsInputFileName())),
177  m_option_help (m_prefix + "help" ),
178  m_option_initialDiscardedPortions (m_prefix + "initialDiscardedPortions" ),
179 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
180  m_option_mean_monitorPeriod (m_prefix + "mean_monitorPeriod" ),
181  m_option_bmm_run (m_prefix + "bmm_run" ),
182  m_option_bmm_lengths (m_prefix + "bmm_lengths" ),
183  m_option_bmm_display (m_prefix + "bmm_display" ),
184  m_option_bmm_write (m_prefix + "bmm_write" ),
185  m_option_fft_compute (m_prefix + "fft_compute" ),
186  m_option_fft_paramId (m_prefix + "fft_paramId" ),
187  m_option_fft_size (m_prefix + "fft_size" ),
188  m_option_fft_testInversion (m_prefix + "fft_testInversion" ),
189  m_option_fft_write (m_prefix + "fft_write" ),
190  m_option_psd_compute (m_prefix + "psd_compute" ),
191  m_option_psd_numBlocks (m_prefix + "psd_numBlocks" ),
192  m_option_psd_hopSizeRatio (m_prefix + "psd_hopSizeRatio" ),
193  m_option_psd_paramId (m_prefix + "psd_paramId" ),
194  m_option_psd_write (m_prefix + "psd_write" ),
195  m_option_psdAtZero_compute (m_prefix + "psdAtZero_compute" ),
196  m_option_psdAtZero_numBlocks (m_prefix + "psdAtZero_numBlocks" ),
197  m_option_psdAtZero_hopSizeRatio (m_prefix + "psdAtZero_hopSizeRatio" ),
198  m_option_psdAtZero_display (m_prefix + "psdAtZero_display" ),
199  m_option_psdAtZero_write (m_prefix + "psdAtZero_write" ),
200  m_option_geweke_compute (m_prefix + "geweke_compute" ),
201  m_option_geweke_naRatio (m_prefix + "geweke_naRatio" ),
202  m_option_geweke_nbRatio (m_prefix + "geweke_nbRatio" ),
203  m_option_geweke_display (m_prefix + "geweke_display" ),
204  m_option_geweke_write (m_prefix + "geweke_write" ),
205  m_option_meanStacc_compute (m_prefix + "meanStacc_compute" ),
206  m_option_hist_compute (m_prefix + "hist_compute" ),
207  m_option_hist_numInternalBins (m_prefix + "hist_numInternalBins" ),
208  m_option_cdfStacc_compute (m_prefix + "cdfStacc_compute" ),
209  m_option_cdfStacc_numEvalPositions(m_prefix + "cdfStacc_numEvalPositions"),
210 #endif
211  m_option_autoCorr_computeViaDef (m_prefix + "autoCorr_computeViaDef" ),
212  m_option_autoCorr_computeViaFft (m_prefix + "autoCorr_computeViaFft" ),
213  m_option_autoCorr_secondLag (m_prefix + "autoCorr_secondLag" ),
214  m_option_autoCorr_lagSpacing (m_prefix + "autoCorr_lagSpacing" ),
215  m_option_autoCorr_numLags (m_prefix + "autoCorr_numLags" ),
216  m_option_autoCorr_display (m_prefix + "autoCorr_display" ),
217  m_option_autoCorr_write (m_prefix + "autoCorr_write" ),
218  m_option_kde_compute (m_prefix + "kde_compute" ),
219  m_option_kde_numEvalPositions (m_prefix + "kde_numEvalPositions" ),
220  m_option_covMatrix_compute (m_prefix + "covMatrix_compute" ),
221  m_option_corrMatrix_compute (m_prefix + "corrMatrix_compute" )
222 {
223  (m_option_help, "produce help message for chain statistical options" )
224  (m_option_initialDiscardedPortions, boost::program_options::value<std::string >()->default_value(UQ_SEQUENCE_INITIAL_DISCARDED_PORTIONS_ODV ), "list of initial discarded portions for chain statistics" )
225 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
226  m_parser->registerOption(m_option_mean_monitorPeriod, UQ_SEQUENCE_MEAN_MONITOR_PERIOD_ODV, "period for monitoring mean" );
227  m_parser->registerOption(m_option_bmm_run, UQ_SEQUENCE_BMM_RUN_ODV , "compute variance of sample mean with batch means method" );
228  m_parser->registerOption<std::string>(m_option_bmm_lengths, UQ_SEQUENCE_BMM_LENGTHS_ODV , "list of batch lenghts for BMM" );
229  m_parser->registerOption(m_option_fft_compute, UQ_SEQUENCE_FFT_COMPUTE_ODV , "compute fft" );
230  m_parser->registerOption(m_option_fft_paramId, UQ_SEQUENCE_FFT_PARAM_ID_ODV , "parameter id for fft computations" );
231  m_parser->registerOption(m_option_fft_size, UQ_SEQUENCE_FFT_SIZE_ODV , "fft size" );
232  m_parser->registerOption(m_option_fft_testInversion, UQ_SEQUENCE_FFT_TEST_INVERSION_ODV , "test fft inversion" );
233  m_parser->registerOption(m_option_fft_write, UQ_SEQUENCE_FFT_WRITE_ODV , "write fft" );
234  m_parser->registerOption(m_option_psd_compute, UQ_SEQUENCE_PSD_COMPUTE_ODV , "compute psd" );
235  m_parser->registerOption(m_option_psd_numBlocks, UQ_SEQUENCE_PSD_NUM_BLOCKS_ODV , "number of blocks for computation of psd" );
236  m_parser->registerOption(m_option_psd_hopSizeRatio, UQ_SEQUENCE_PSD_HOP_SIZE_RATIO_ODV , "hop size ratio for psd" );
237  m_parser->registerOption(m_option_psd_paramId, UQ_SEQUENCE_PSD_PARAM_ID_ODV , "parameter id for psd computations" );
238  m_parser->registerOption(m_option_psd_write, UQ_SEQUENCE_PSD_WRITE_ODV , "write psd" );
239  m_parser->registerOption(m_option_psdAtZero_compute, UQ_SEQUENCE_PSD_AT_ZERO_COMPUTE_ODV, "compute power spectral densities" );
240  m_parser->registerOption<std::string>(m_option_psdAtZero_numBlocks, UQ_SEQUENCE_PSD_AT_ZERO_NUM_BLOCKS_ODV , "list of numbers of blocks for computation of psd at zero" );
241  m_parser->registerOption(m_option_psdAtZero_hopSizeRatio, UQ_SEQUENCE_PSD_AT_ZERO_HOP_SIZE_RATIO_ODV , "hop size ratio for psd at zero" );
242  m_parser->registerOption(m_option_psdAtZero_display, UQ_SEQUENCE_PSD_AT_ZERO_DISPLAY_ODV, "display computed psd at frequency zero on screen" );
243  m_parser->registerOption(m_option_psdAtZero_write, UQ_SEQUENCE_PSD_AT_ZERO_WRITE_ODV , "write computed psd at frequency zero to the output file" );
244  m_parser->registerOption(m_option_geweke_compute, UQ_SEQUENCE_GEWEKE_COMPUTE_ODV , "compute Geweke coefficients" );
245  m_parser->registerOption(m_option_geweke_naRatio, UQ_SEQUENCE_GEWEKE_NA_RATIO_ODV , "ratio NA for Geweke" );
246  m_parser->registerOption(m_option_geweke_nbRatio, UQ_SEQUENCE_GEWEKE_NB_RATIO_ODV , "ratio NB for Geweke" );
247  m_parser->registerOption(m_option_geweke_display, UQ_SEQUENCE_GEWEKE_DISPLAY_ODV , "display computed Geweke on screen" );
248  m_parser->registerOption(m_option_geweke_write, UQ_SEQUENCE_GEWEKE_WRITE_ODV , "write computed Geweke to the output file" );
249  m_parser->registerOption(m_option_meanStacc_compute, UQ_SEQUENCE_MEAN_STACC_COMPUTE_ODV , "compute statistical accuracy of mean" );
250  m_parser->registerOption(m_option_hist_compute, UQ_SEQUENCE_HIST_COMPUTE_ODV , "compute histograms" );
251  m_parser->registerOption(m_option_hist_numInternalBins, UQ_SEQUENCE_HIST_NUM_INTERNAL_BINS_ODV , "number of internal bins" );
252  m_parser->registerOption(m_option_cdfStacc_compute, UQ_SEQUENCE_CDF_STACC_COMPUTE_ODV , "compute statisical accuracy of cdf" );
253  m_parser->registerOption(m_option_cdfStacc_numEvalPositions, UQ_SEQUENCE_CDF_STACC_NUM_EVAL_POSITIONS_ODV , "number of evaluations points for statistical accuracy of cdf" );
254 #endif
255  m_parser->registerOption(m_option_autoCorr_computeViaDef, boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_DEF_ODV ), "compute correlations via definition" )
256  m_parser->registerOption(m_option_autoCorr_computeViaFft, boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_FFT_ODV ), "compute correlations via fft" )
257  m_parser->registerOption(m_option_autoCorr_secondLag, boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_AUTO_CORR_SECOND_LAG_ODV ), "second lag for computation of autocorrelations" )
258  m_parser->registerOption(m_option_autoCorr_lagSpacing, boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_AUTO_CORR_LAG_SPACING_ODV ), "lag spacing for computation of autocorrelations" )
259  m_parser->registerOption(m_option_autoCorr_numLags, boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_AUTO_CORR_NUM_LAGS_ODV ), "number of lags for computation of autocorrelations" )
260  m_parser->registerOption(m_option_autoCorr_display, boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_DISPLAY_ODV ), "display computed autocorrelations on the screen" )
261  m_parser->registerOption(m_option_autoCorr_write, boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_WRITE_ODV ), "write computed autocorrelations to the output file" )
262  m_parser->registerOption(m_option_kde_compute, boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_KDE_COMPUTE_ODV ), "compute kernel density estimators" )
263  m_parser->registerOption(m_option_kde_numEvalPositions, boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_KDE_NUM_EVAL_POSITIONS_ODV ), "number of evaluation positions" )
264  m_parser->registerOption(m_option_covMatrix_compute, boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_COV_MATRIX_COMPUTE_ODV ), "compute covariance matrix" )
265  m_parser->registerOption(m_option_corrMatrix_compute, boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_CORR_MATRIX_COMPUTE_ODV ), "compute correlation matrix" )
266 }
267 
269 {
270 }
271 
273 {
274  this->copy(src);
275 }
276 
279 {
280  this->copy(rhs);
281  return *this;
282 }
283 
284 void
285 SsOptionsValues::defineOptions()
286 {
287  (*m_optionsDescription).add_options()
288  (m_option_help.c_str(), "produce help message for chain statistical options" )
289  (m_option_initialDiscardedPortions.c_str(), boost::program_options::value<std::string >()->default_value(UQ_SEQUENCE_INITIAL_DISCARDED_PORTIONS_ODV ), "list of initial discarded portions for chain statistics" )
290 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
291  (m_option_mean_monitorPeriod.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_MEAN_MONITOR_PERIOD_ODV ), "period for monitoring mean" )
292  (m_option_bmm_run.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_BMM_RUN_ODV ), "compute variance of sample mean with batch means method" )
293  (m_option_bmm_lengths.c_str(), boost::program_options::value<std::string >()->default_value(UQ_SEQUENCE_BMM_LENGTHS_ODV ), "list of batch lenghts for BMM" )
294  (m_option_fft_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_FFT_COMPUTE_ODV ), "compute fft" )
295  (m_option_fft_paramId.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_FFT_PARAM_ID_ODV ), "parameter id for fft computations" )
296  (m_option_fft_size.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_FFT_SIZE_ODV ), "fft size" )
297  (m_option_fft_testInversion.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_FFT_TEST_INVERSION_ODV ), "test fft inversion" )
298  (m_option_fft_write.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_FFT_WRITE_ODV ), "write fft" )
299  (m_option_psd_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_PSD_COMPUTE_ODV ), "compute psd" )
300  (m_option_psd_numBlocks.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_PSD_NUM_BLOCKS_ODV ), "number of blocks for computation of psd" )
301  (m_option_psd_hopSizeRatio.c_str(), boost::program_options::value<double >()->default_value(UQ_SEQUENCE_PSD_HOP_SIZE_RATIO_ODV ), "hop size ratio for psd" )
302  (m_option_psd_paramId.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_PSD_PARAM_ID_ODV ), "parameter id for psd computations" )
303  (m_option_psd_write.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_PSD_WRITE_ODV ), "write psd" )
304  (m_option_psdAtZero_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_COMPUTE_ODV ), "compute power spectral densities" )
305  (m_option_psdAtZero_numBlocks.c_str(), boost::program_options::value<std::string >()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_NUM_BLOCKS_ODV ), "list of numbers of blocks for computation of psd at zero" )
306  (m_option_psdAtZero_hopSizeRatio.c_str(), boost::program_options::value<double >()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_HOP_SIZE_RATIO_ODV ), "hop size ratio for psd at zero" )
307  (m_option_psdAtZero_display.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_DISPLAY_ODV ), "display computed psd at frequency zero on screen" )
308  (m_option_psdAtZero_write.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_WRITE_ODV ), "write computed psd at frequency zero to the output file" )
309  (m_option_geweke_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_GEWEKE_COMPUTE_ODV ), "compute Geweke coefficients" )
310  (m_option_geweke_naRatio.c_str(), boost::program_options::value<double >()->default_value(UQ_SEQUENCE_GEWEKE_NA_RATIO_ODV ), "ratio NA for Geweke" )
311  (m_option_geweke_nbRatio.c_str(), boost::program_options::value<double >()->default_value(UQ_SEQUENCE_GEWEKE_NB_RATIO_ODV ), "ratio NB for Geweke" )
312  (m_option_geweke_display.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_GEWEKE_DISPLAY_ODV ), "display computed Geweke on screen" )
313  (m_option_geweke_write.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_GEWEKE_WRITE_ODV ), "write computed Geweke to the output file" )
314  (m_option_meanStacc_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_MEAN_STACC_COMPUTE_ODV ), "compute statistical accuracy of mean" )
315  (m_option_hist_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_HIST_COMPUTE_ODV ), "compute histograms" )
316  (m_option_hist_numInternalBins.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_HIST_NUM_INTERNAL_BINS_ODV ), "number of internal bins" )
317  (m_option_cdfStacc_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_CDF_STACC_COMPUTE_ODV ), "compute statisical accuracy of cdf" )
318  (m_option_cdfStacc_numEvalPositions.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_CDF_STACC_NUM_EVAL_POSITIONS_ODV ), "number of evaluations points for statistical accuracy of cdf" )
319 #endif
320  (m_option_autoCorr_computeViaDef.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_DEF_ODV ), "compute correlations via definition" )
321  (m_option_autoCorr_computeViaFft.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_FFT_ODV ), "compute correlations via fft" )
322  (m_option_autoCorr_secondLag.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_AUTO_CORR_SECOND_LAG_ODV ), "second lag for computation of autocorrelations" )
323  (m_option_autoCorr_lagSpacing.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_AUTO_CORR_LAG_SPACING_ODV ), "lag spacing for computation of autocorrelations" )
324  (m_option_autoCorr_numLags.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_AUTO_CORR_NUM_LAGS_ODV ), "number of lags for computation of autocorrelations" )
325  (m_option_autoCorr_display.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_DISPLAY_ODV ), "display computed autocorrelations on the screen" )
326  (m_option_autoCorr_write.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_WRITE_ODV ), "write computed autocorrelations to the output file" )
327  (m_option_kde_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_KDE_COMPUTE_ODV ), "compute kernel density estimators" )
328  (m_option_kde_numEvalPositions.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_KDE_NUM_EVAL_POSITIONS_ODV ), "number of evaluation positions" )
329  (m_option_covMatrix_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_COV_MATRIX_COMPUTE_ODV ), "compute covariance matrix" )
330  (m_option_corrMatrix_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_CORR_MATRIX_COMPUTE_ODV ), "compute correlation matrix" )
331  ;
332 }
333 
334 void
335 SsOptionsValues::getOptionValues()
336 {
337  if ((*m_optionsMap).count(m_option_help)) {
338  if (m_env->subDisplayFile()) {
339  *m_env->subDisplayFile() << (*m_optionsDescription)
340  << std::endl;
341  }
342  }
343 
344  if ((*m_optionsMap).count(m_option_initialDiscardedPortions)) {
346  std::vector<double> tmpPortions(0,0.);
347  std::string inputString = (*m_optionsMap)[m_option_initialDiscardedPortions].as<std::string>();
348  MiscReadDoublesFromString(inputString,tmpPortions);
349  //if (m_env->subDisplayFile()) {
350  // *m_env->subDisplayFile() << "In SequenceStatisticalOptions::getMyOptionValues(): percents = ";
351  // for (unsigned int i = 0; i < tmpPortions.size(); ++i) {
352  // *m_env->subDisplayFile() << " " << tmpPortions[i];
353  // }
354  // *m_env->subDisplayFile() << std::endl;
355  //}
356 
357  if (tmpPortions.size() > 0) {
358  m_initialDiscardedPortions.resize(tmpPortions.size(),0.);
359  for (unsigned int i = 0; i < m_initialDiscardedPortions.size(); ++i) {
360  m_initialDiscardedPortions[i] = tmpPortions[i];
361  }
362  }
363  }
364 
365 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
366  if ((*m_optionsMap).count(m_option_mean_monitorPeriod)) {
367  m_meanMonitorPeriod = (*m_optionsMap)[m_option_mean_monitorPeriod].as<unsigned int>();
368  }
369 
370  if ((*m_optionsMap).count(m_option_bmm_run)) {
371  m_bmmRun = (*m_optionsMap)[m_option_bmm_run].as<bool>();
372  }
373 
374  if ((*m_optionsMap).count(m_option_bmm_lengths)) {
375  m_bmmLengths.clear();
376  std::vector<double> tmpLengths(0,0.);
377  std::string inputString = (*m_optionsMap)[m_option_bmm_lengths].as<std::string>();
378  MiscReadDoublesFromString(inputString,tmpLengths);
379  //if (m_env->subDisplayFile()) {
380  // *m_env->subDisplayFile() << "In SequenceStatisticalOptions::getMyOptionValues(): lengths for BMM = ";
381  // for (unsigned int i = 0; i < tmpLengths.size(); ++i) {
382  // *m_env->subDisplayFile() << " " << tmpLengths[i];
383  // }
384  // *m_env->subDisplayFile() << std::endl;
385  //}
386 
387  if (tmpLengths.size() > 0) {
388  m_bmmLengths.resize(tmpLengths.size(),0);
389  for (unsigned int i = 0; i < m_bmmLengths.size(); ++i) {
390  m_bmmLengths[i] = (unsigned int) tmpLengths[i];
391  }
392  }
393  }
394 
395  if ((*m_optionsMap).count(m_option_fft_compute)) {
396  m_fftCompute = (*m_optionsMap)[m_option_fft_compute].as<bool>();
397  }
398 
399  if ((*m_optionsMap).count(m_option_fft_paramId)) {
400  m_fftParamId = (*m_optionsMap)[m_option_fft_paramId].as<unsigned int>();
401  }
402 
403  if ((*m_optionsMap).count(m_option_fft_size)) {
404  m_fftSize = (*m_optionsMap)[m_option_fft_size].as<unsigned int>();
405  }
406 
407  if ((*m_optionsMap).count(m_option_fft_testInversion)) {
408  m_fftTestInversion = (*m_optionsMap)[m_option_fft_testInversion].as<bool>();
409  }
410 
411  if ((*m_optionsMap).count(m_option_fft_write)) {
412  m_fftWrite = (*m_optionsMap)[m_option_fft_write].as<bool>();
413  }
414 
415  if ((*m_optionsMap).count(m_option_psd_compute)) {
416  m_psdCompute = (*m_optionsMap)[m_option_psd_compute].as<bool>();
417  }
418 
419  if ((*m_optionsMap).count(m_option_psd_numBlocks)) {
420  m_psdNumBlocks = (*m_optionsMap)[m_option_psd_numBlocks].as<unsigned int>();
421  }
422 
423  if ((*m_optionsMap).count(m_option_psd_hopSizeRatio)) {
424  m_psdHopSizeRatio = (*m_optionsMap)[m_option_psd_hopSizeRatio].as<double>();
425  }
426 
427  if ((*m_optionsMap).count(m_option_psd_paramId)) {
428  m_psdParamId = (*m_optionsMap)[m_option_psd_paramId].as<unsigned int>();
429  }
430 
431  if ((*m_optionsMap).count(m_option_psd_write)) {
432  m_psdWrite = (*m_optionsMap)[m_option_psd_write].as<bool>();
433  }
434 
435  if ((*m_optionsMap).count(m_option_psdAtZero_compute)) {
436  m_psdAtZeroCompute = (*m_optionsMap)[m_option_psdAtZero_compute].as<bool>();
437  }
438 
439  if ((*m_optionsMap).count(m_option_psdAtZero_numBlocks)) {
440  m_psdAtZeroNumBlocks.clear();
441  std::vector<double> tmpNumBlocks(0,0.);
442  std::string inputString = (*m_optionsMap)[m_option_psdAtZero_numBlocks].as<std::string>();
443  MiscReadDoublesFromString(inputString,tmpNumBlocks);
444  //if (m_env->subDisplayFile()) {
445  // *m_env->subDisplayFile() << "In SequenceStatisticalOptions::getMyOptionValues(): numBlocks for psdAtZero = ";
446  // for (unsigned int i = 0; i < tmpNumBlocks.size(); ++i) {
447  // *m_env->subDisplayFile() << " " << numBlocks[i];
448  // }
449  // *m_env->subDisplayFile() << std::endl;
450  //}
451 
452  if (tmpNumBlocks.size() > 0) {
453  m_psdAtZeroNumBlocks.resize(tmpNumBlocks.size(),0);
454  for (unsigned int i = 0; i < m_psdAtZeroNumBlocks.size(); ++i) {
455  m_psdAtZeroNumBlocks[i] = (unsigned int) tmpNumBlocks[i];
456  }
457  }
458  }
459 
460  if ((*m_optionsMap).count(m_option_psdAtZero_hopSizeRatio)) {
461  m_psdAtZeroHopSizeRatio = (*m_optionsMap)[m_option_psdAtZero_hopSizeRatio].as<double>();
462  }
463 
464  if ((*m_optionsMap).count(m_option_psdAtZero_display)) {
465  m_psdAtZeroDisplay = (*m_optionsMap)[m_option_psdAtZero_display].as<bool>();
466  }
467 
468  if ((*m_optionsMap).count(m_option_psdAtZero_write)) {
469  m_psdAtZeroWrite = (*m_optionsMap)[m_option_psdAtZero_write].as<bool>();
470  }
471 
472  if ((*m_optionsMap).count(m_option_geweke_compute)) {
473  m_gewekeCompute = (*m_optionsMap)[m_option_geweke_compute].as<bool>();
474  }
475 
476  if ((*m_optionsMap).count(m_option_geweke_naRatio)) {
477  m_gewekeNaRatio = (*m_optionsMap)[m_option_geweke_naRatio].as<double>();
478  }
479 
480  if ((*m_optionsMap).count(m_option_geweke_nbRatio)) {
481  m_gewekeNbRatio = (*m_optionsMap)[m_option_geweke_nbRatio].as<double>();
482  }
483 
484  if ((*m_optionsMap).count(m_option_geweke_display)) {
485  m_gewekeDisplay = (*m_optionsMap)[m_option_geweke_display].as<bool>();
486  }
487 
488  if ((*m_optionsMap).count(m_option_geweke_write)) {
489  m_gewekeWrite = (*m_optionsMap)[m_option_geweke_write].as<bool>();
490  }
491 
492  if ((*m_optionsMap).count(m_option_meanStacc_compute)) {
493  m_meanStaccCompute = (*m_optionsMap)[m_option_meanStacc_compute].as<bool>();
494  }
495 
496  if ((*m_optionsMap).count(m_option_hist_compute)) {
497  m_histCompute = (*m_optionsMap)[m_option_hist_compute].as<bool>();
498  }
499 
500  if ((*m_optionsMap).count(m_option_hist_numInternalBins)) {
501  m_histNumInternalBins = (*m_optionsMap)[m_option_hist_numInternalBins].as<unsigned int>();
502  }
503 
504  if ((*m_optionsMap).count(m_option_cdfStacc_compute)) {
505  m_cdfStaccCompute = (*m_optionsMap)[m_option_cdfStacc_compute].as<bool>();
506  }
507 
508  if ((*m_optionsMap).count(m_option_cdfStacc_numEvalPositions)) {
509  m_cdfStaccNumEvalPositions = (*m_optionsMap)[m_option_cdfStacc_numEvalPositions].as<unsigned int>();
510  }
511 #endif
512  if ((*m_optionsMap).count(m_option_autoCorr_computeViaDef)) {
513  m_autoCorrComputeViaDef = (*m_optionsMap)[m_option_autoCorr_computeViaDef].as<bool>();
514  }
515 
516  if ((*m_optionsMap).count(m_option_autoCorr_computeViaFft)) {
517  m_autoCorrComputeViaFft = (*m_optionsMap)[m_option_autoCorr_computeViaFft].as<bool>();
518  }
519 
520  if ((*m_optionsMap).count(m_option_autoCorr_secondLag)) {
521  m_autoCorrSecondLag = (*m_optionsMap)[m_option_autoCorr_secondLag].as<unsigned int>();
522  }
523 
524  if ((*m_optionsMap).count(m_option_autoCorr_lagSpacing)) {
525  m_autoCorrLagSpacing = (*m_optionsMap)[m_option_autoCorr_lagSpacing].as<unsigned int>();
526  }
527 
528  if ((*m_optionsMap).count(m_option_autoCorr_numLags)) {
529  m_autoCorrNumLags = (*m_optionsMap)[m_option_autoCorr_numLags].as<unsigned int>();
530  }
531 
532  if ((*m_optionsMap).count(m_option_autoCorr_display)) {
533  m_autoCorrDisplay = (*m_optionsMap)[m_option_autoCorr_display].as<bool>();
534  }
535 
536  if ((*m_optionsMap).count(m_option_autoCorr_write)) {
537  m_autoCorrWrite = (*m_optionsMap)[m_option_autoCorr_write].as<bool>();
538  }
539 
540  if ((*m_optionsMap).count(m_option_kde_compute)) {
541  m_kdeCompute = (*m_optionsMap)[m_option_kde_compute].as<bool>();
542  }
543 
544  if ((*m_optionsMap).count(m_option_kde_numEvalPositions)) {
545  m_kdeNumEvalPositions = (*m_optionsMap)[m_option_kde_numEvalPositions].as<unsigned int>();
546  }
547 
548  if ((*m_optionsMap).count(m_option_covMatrix_compute)) {
549  m_covMatrixCompute = (*m_optionsMap)[m_option_covMatrix_compute].as<bool>();
550  }
551 
552  if ((*m_optionsMap).count(m_option_corrMatrix_compute)) {
553  m_corrMatrixCompute = (*m_optionsMap)[m_option_corrMatrix_compute].as<bool>();
554  }
555 }
556 
557 void
559 {
561 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
563  m_bmmRun = src.m_bmmRun;
567  m_fftSize = src.m_fftSize;
569  m_fftWrite = src.m_fftWrite;
574  m_psdWrite = src.m_psdWrite;
590 #endif
602 
603  return;
604 }
605 
606 SequenceStatisticalOptions::SequenceStatisticalOptions( const BaseEnvironment& env, const std::string& prefix)
609  :
610  m_ov (),
611  m_prefix ((std::string)(prefix) + "stats_"),
612  m_env (env),
613  m_optionsDesc (new boost::program_options::options_description("Chain statistical options")),
614  m_option_help (m_prefix + "help" ),
615  m_option_initialDiscardedPortions (m_prefix + "initialDiscardedPortions" ),
616 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
617  m_option_mean_monitorPeriod (m_prefix + "mean_monitorPeriod" ),
618  m_option_bmm_run (m_prefix + "bmm_run" ),
619  m_option_bmm_lengths (m_prefix + "bmm_lengths" ),
620  m_option_bmm_display (m_prefix + "bmm_display" ),
621  m_option_bmm_write (m_prefix + "bmm_write" ),
622  m_option_fft_compute (m_prefix + "fft_compute" ),
623  m_option_fft_paramId (m_prefix + "fft_paramId" ),
624  m_option_fft_size (m_prefix + "fft_size" ),
625  m_option_fft_testInversion (m_prefix + "fft_testInversion" ),
626  m_option_fft_write (m_prefix + "fft_write" ),
627  m_option_psd_compute (m_prefix + "psd_compute" ),
628  m_option_psd_numBlocks (m_prefix + "psd_numBlocks" ),
629  m_option_psd_hopSizeRatio (m_prefix + "psd_hopSizeRatio" ),
630  m_option_psd_paramId (m_prefix + "psd_paramId" ),
631  m_option_psd_write (m_prefix + "psd_write" ),
632  m_option_psdAtZero_compute (m_prefix + "psdAtZero_compute" ),
633  m_option_psdAtZero_numBlocks (m_prefix + "psdAtZero_numBlocks" ),
634  m_option_psdAtZero_hopSizeRatio (m_prefix + "psdAtZero_hopSizeRatio" ),
635  m_option_psdAtZero_display (m_prefix + "psdAtZero_display" ),
636  m_option_psdAtZero_write (m_prefix + "psdAtZero_write" ),
637  m_option_geweke_compute (m_prefix + "geweke_compute" ),
638  m_option_geweke_naRatio (m_prefix + "geweke_naRatio" ),
639  m_option_geweke_nbRatio (m_prefix + "geweke_nbRatio" ),
640  m_option_geweke_display (m_prefix + "geweke_display" ),
641  m_option_geweke_write (m_prefix + "geweke_write" ),
642  m_option_meanStacc_compute (m_prefix + "meanStacc_compute" ),
643  m_option_hist_compute (m_prefix + "hist_compute" ),
644  m_option_hist_numInternalBins (m_prefix + "hist_numInternalBins" ),
645  m_option_cdfStacc_compute (m_prefix + "cdfStacc_compute" ),
646  m_option_cdfStacc_numEvalPositions(m_prefix + "cdfStacc_numEvalPositions"),
647 #endif
648  m_option_autoCorr_computeViaDef (m_prefix + "autoCorr_computeViaDef" ),
649  m_option_autoCorr_computeViaFft (m_prefix + "autoCorr_computeViaFft" ),
650  m_option_autoCorr_secondLag (m_prefix + "autoCorr_secondLag" ),
651  m_option_autoCorr_lagSpacing (m_prefix + "autoCorr_lagSpacing" ),
652  m_option_autoCorr_numLags (m_prefix + "autoCorr_numLags" ),
653  m_option_autoCorr_display (m_prefix + "autoCorr_display" ),
654  m_option_autoCorr_write (m_prefix + "autoCorr_write" ),
655  m_option_kde_compute (m_prefix + "kde_compute" ),
656  m_option_kde_numEvalPositions (m_prefix + "kde_numEvalPositions" ),
657  m_option_covMatrix_compute (m_prefix + "covMatrix_compute" ),
658  m_option_corrMatrix_compute (m_prefix + "corrMatrix_compute" )
659 {
660  queso_deprecated();
661 
662  if (m_env.subDisplayFile()) {
663  *m_env.subDisplayFile() << "Entering SequenceStatisticalOptions::constructor(1)"
664  << ", prefix = " << m_prefix
665  << std::endl;
666  }
667 
668  queso_require_not_equal_to_msg(m_env.optionsInputFileName(), "", "this constructor is incompatible with the abscense of an options input file");
669 
671  m_env.scanInputFileForMyOptions(*m_optionsDesc);
673 
674  if (m_env.subDisplayFile()) {
675  *m_env.subDisplayFile() << "After reading values of options with prefix '" << m_prefix
676  << "', state of SequenceStatisticalOptions object is:"
677  << "\n" << *this
678  << std::endl;
679  }
680 
681  if (m_env.subDisplayFile()) {
682  *m_env.subDisplayFile() << "Leaving SequenceStatisticalOptions::constructor(1)"
683  << ", prefix = " << m_prefix
684  << std::endl;
685  }
686 }
687 
688 SequenceStatisticalOptions::SequenceStatisticalOptions( const BaseEnvironment& env, const std::string& prefix,
691  const SsOptionsValues& alternativeOptionsValues)
692  :
693  m_ov (alternativeOptionsValues),
694  m_prefix ((std::string)(prefix) + "stats_"),
695  m_env (env),
696  m_optionsDesc (NULL),
697  m_option_help (m_prefix + "help" ),
698  m_option_initialDiscardedPortions (m_prefix + "initialDiscardedPortions" ),
699 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
700  m_option_mean_monitorPeriod (m_prefix + "mean_monitorPeriod" ),
701  m_option_bmm_run (m_prefix + "bmm_run" ),
702  m_option_bmm_lengths (m_prefix + "bmm_lengths" ),
703  m_option_bmm_display (m_prefix + "bmm_display" ),
704  m_option_bmm_write (m_prefix + "bmm_write" ),
705  m_option_fft_compute (m_prefix + "fft_compute" ),
706  m_option_fft_paramId (m_prefix + "fft_paramId" ),
707  m_option_fft_size (m_prefix + "fft_size" ),
708  m_option_fft_testInversion (m_prefix + "fft_testInversion" ),
709  m_option_fft_write (m_prefix + "fft_write" ),
710  m_option_psd_compute (m_prefix + "psd_compute" ),
711  m_option_psd_numBlocks (m_prefix + "psd_numBlocks" ),
712  m_option_psd_hopSizeRatio (m_prefix + "psd_hopSizeRatio" ),
713  m_option_psd_paramId (m_prefix + "psd_paramId" ),
714  m_option_psd_write (m_prefix + "psd_write" ),
715  m_option_psdAtZero_compute (m_prefix + "psdAtZero_compute" ),
716  m_option_psdAtZero_numBlocks (m_prefix + "psdAtZero_numBlocks" ),
717  m_option_psdAtZero_hopSizeRatio (m_prefix + "psdAtZero_hopSizeRatio" ),
718  m_option_psdAtZero_display (m_prefix + "psdAtZero_display" ),
719  m_option_psdAtZero_write (m_prefix + "psdAtZero_write" ),
720  m_option_geweke_compute (m_prefix + "geweke_compute" ),
721  m_option_geweke_naRatio (m_prefix + "geweke_naRatio" ),
722  m_option_geweke_nbRatio (m_prefix + "geweke_nbRatio" ),
723  m_option_geweke_display (m_prefix + "geweke_display" ),
724  m_option_geweke_write (m_prefix + "geweke_write" ),
725  m_option_meanStacc_compute (m_prefix + "meanStacc_compute" ),
726  m_option_hist_compute (m_prefix + "hist_compute" ),
727  m_option_hist_numInternalBins (m_prefix + "hist_numInternalBins" ),
728  m_option_cdfStacc_compute (m_prefix + "cdfStacc_compute" ),
729  m_option_cdfStacc_numEvalPositions(m_prefix + "cdfStacc_numEvalPositions"),
730 #endif
731  m_option_autoCorr_computeViaDef (m_prefix + "autoCorr_computeViaDef" ),
732  m_option_autoCorr_computeViaFft (m_prefix + "autoCorr_computeViaFft" ),
733  m_option_autoCorr_secondLag (m_prefix + "autoCorr_secondLag" ),
734  m_option_autoCorr_lagSpacing (m_prefix + "autoCorr_lagSpacing" ),
735  m_option_autoCorr_numLags (m_prefix + "autoCorr_numLags" ),
736  m_option_autoCorr_display (m_prefix + "autoCorr_display" ),
737  m_option_autoCorr_write (m_prefix + "autoCorr_write" ),
738  m_option_kde_compute (m_prefix + "kde_compute" ),
739  m_option_kde_numEvalPositions (m_prefix + "kde_numEvalPositions" ),
740  m_option_covMatrix_compute (m_prefix + "covMatrix_compute" ),
741  m_option_corrMatrix_compute (m_prefix + "corrMatrix_compute" )
742 {
743  queso_deprecated();
744 
745  if (m_env.subDisplayFile()) {
746  *m_env.subDisplayFile() << "Entering SequenceStatisticalOptions::constructor(2)"
747  << ", prefix = " << m_prefix
748  << std::endl;
749  }
750 
751  queso_require_equal_to_msg(m_env.optionsInputFileName(), "", "this constructor is incompatible with the existence of an options input file");
752 
753  if (m_env.subDisplayFile()) {
754  *m_env.subDisplayFile() << "After setting values of options with prefix '" << m_prefix
755  << "', state of SequenceStatisticalOptions object is:"
756  << "\n" << *this
757  << std::endl;
758  }
759 
760  if (m_env.subDisplayFile()) {
761  *m_env.subDisplayFile() << "Leaving SequenceStatisticalOptions::constructor(2)"
762  << ", prefix = " << m_prefix
763  << std::endl;
764  }
765 }
766 
768 {
769  queso_deprecated();
770 
771  if (m_optionsDesc) delete m_optionsDesc;
772 }
773 
774 void
776  boost::program_options::options_description& optionsDesc) const
777 {
778  queso_deprecated();
779 
780  optionsDesc.add_options()
781  (m_option_help.c_str(), "produce help message for chain statistical options" )
782  (m_option_initialDiscardedPortions.c_str(), boost::program_options::value<std::string >()->default_value(UQ_SEQUENCE_INITIAL_DISCARDED_PORTIONS_ODV ), "list of initial discarded portions for chain statistics" )
783 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
784  (m_option_mean_monitorPeriod.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_MEAN_MONITOR_PERIOD_ODV ), "period for monitoring mean" )
785  (m_option_bmm_run.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_BMM_RUN_ODV ), "compute variance of sample mean with batch means method" )
786  (m_option_bmm_lengths.c_str(), boost::program_options::value<std::string >()->default_value(UQ_SEQUENCE_BMM_LENGTHS_ODV ), "list of batch lenghts for BMM" )
787  (m_option_fft_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_FFT_COMPUTE_ODV ), "compute fft" )
788  (m_option_fft_paramId.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_FFT_PARAM_ID_ODV ), "parameter id for fft computations" )
789  (m_option_fft_size.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_FFT_SIZE_ODV ), "fft size" )
790  (m_option_fft_testInversion.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_FFT_TEST_INVERSION_ODV ), "test fft inversion" )
791  (m_option_fft_write.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_FFT_WRITE_ODV ), "write fft" )
792  (m_option_psd_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_PSD_COMPUTE_ODV ), "compute psd" )
793  (m_option_psd_numBlocks.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_PSD_NUM_BLOCKS_ODV ), "number of blocks for computation of psd" )
794  (m_option_psd_hopSizeRatio.c_str(), boost::program_options::value<double >()->default_value(UQ_SEQUENCE_PSD_HOP_SIZE_RATIO_ODV ), "hop size ratio for psd" )
795  (m_option_psd_paramId.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_PSD_PARAM_ID_ODV ), "parameter id for psd computations" )
796  (m_option_psd_write.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_PSD_WRITE_ODV ), "write psd" )
797  (m_option_psdAtZero_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_COMPUTE_ODV ), "compute power spectral densities" )
798  (m_option_psdAtZero_numBlocks.c_str(), boost::program_options::value<std::string >()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_NUM_BLOCKS_ODV ), "list of numbers of blocks for computation of psd at zero" )
799  (m_option_psdAtZero_hopSizeRatio.c_str(), boost::program_options::value<double >()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_HOP_SIZE_RATIO_ODV ), "hop size ratio for psd at zero" )
800  (m_option_psdAtZero_display.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_DISPLAY_ODV ), "display computed psd at frequency zero on screen" )
801  (m_option_psdAtZero_write.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_WRITE_ODV ), "write computed psd at frequency zero to the output file" )
802  (m_option_geweke_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_GEWEKE_COMPUTE_ODV ), "compute Geweke coefficients" )
803  (m_option_geweke_naRatio.c_str(), boost::program_options::value<double >()->default_value(UQ_SEQUENCE_GEWEKE_NA_RATIO_ODV ), "ratio NA for Geweke" )
804  (m_option_geweke_nbRatio.c_str(), boost::program_options::value<double >()->default_value(UQ_SEQUENCE_GEWEKE_NB_RATIO_ODV ), "ratio NB for Geweke" )
805  (m_option_geweke_display.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_GEWEKE_DISPLAY_ODV ), "display computed Geweke on screen" )
806  (m_option_geweke_write.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_GEWEKE_WRITE_ODV ), "write computed Geweke to the output file" )
807  (m_option_meanStacc_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_MEAN_STACC_COMPUTE_ODV ), "compute statistical accuracy of mean" )
808  (m_option_hist_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_HIST_COMPUTE_ODV ), "compute histograms" )
809  (m_option_hist_numInternalBins.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_HIST_NUM_INTERNAL_BINS_ODV ), "number of internal bins" )
810  (m_option_cdfStacc_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_CDF_STACC_COMPUTE_ODV ), "compute statisical accuracy of cdf" )
811  (m_option_cdfStacc_numEvalPositions.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_CDF_STACC_NUM_EVAL_POSITIONS_ODV ), "number of evaluations points for statistical accuracy of cdf" )
812 #endif
813  (m_option_autoCorr_computeViaDef.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_DEF_ODV ), "compute correlations via definition" )
814  (m_option_autoCorr_computeViaFft.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_FFT_ODV ), "compute correlations via fft" )
815  (m_option_autoCorr_secondLag.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_AUTO_CORR_SECOND_LAG_ODV ), "second lag for computation of autocorrelations" )
816  (m_option_autoCorr_lagSpacing.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_AUTO_CORR_LAG_SPACING_ODV ), "lag spacing for computation of autocorrelations" )
817  (m_option_autoCorr_numLags.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_AUTO_CORR_NUM_LAGS_ODV ), "number of lags for computation of autocorrelations" )
818  (m_option_autoCorr_display.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_DISPLAY_ODV ), "display computed autocorrelations on the screen" )
819  (m_option_autoCorr_write.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_AUTO_CORR_WRITE_ODV ), "write computed autocorrelations to the output file" )
820  (m_option_kde_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_KDE_COMPUTE_ODV ), "compute kernel density estimators" )
821  (m_option_kde_numEvalPositions.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_SEQUENCE_KDE_NUM_EVAL_POSITIONS_ODV ), "number of evaluation positions" )
822  (m_option_covMatrix_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_COV_MATRIX_COMPUTE_ODV ), "compute covariance matrix" )
823  (m_option_corrMatrix_compute.c_str(), boost::program_options::value<bool >()->default_value(UQ_SEQUENCE_CORR_MATRIX_COMPUTE_ODV ), "compute correlation matrix" )
824  ;
825 
826  return;
827 }
828 
829 void
831  boost::program_options::options_description& optionsDesc)
832 {
833  queso_deprecated();
834 
835  if (m_env.allOptionsMap().count(m_option_help)) {
836  if (m_env.subDisplayFile()) {
837  *m_env.subDisplayFile() << optionsDesc
838  << std::endl;
839  }
840  }
841 
842  if (m_env.allOptionsMap().count(m_option_initialDiscardedPortions)) {
844  std::vector<double> tmpPortions(0,0.);
845  std::string inputString = m_env.allOptionsMap()[m_option_initialDiscardedPortions].as<std::string>();
846  MiscReadDoublesFromString(inputString,tmpPortions);
847  //if (m_env.subDisplayFile()) {
848  // *m_env.subDisplayFile() << "In SequenceStatisticalOptions::getMyOptionValues(): percents = ";
849  // for (unsigned int i = 0; i < tmpPortions.size(); ++i) {
850  // *m_env.subDisplayFile() << " " << tmpPortions[i];
851  // }
852  // *m_env.subDisplayFile() << std::endl;
853  //}
854 
855  if (tmpPortions.size() > 0) {
856  m_ov.m_initialDiscardedPortions.resize(tmpPortions.size(),0.);
857  for (unsigned int i = 0; i < m_ov.m_initialDiscardedPortions.size(); ++i) {
858  m_ov.m_initialDiscardedPortions[i] = tmpPortions[i];
859  }
860  }
861  }
862 
863 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
864  if (m_env.allOptionsMap().count(m_option_mean_monitorPeriod)) {
865  m_ov.m_meanMonitorPeriod = m_env.allOptionsMap()[m_option_mean_monitorPeriod].as<unsigned int>();
866  }
867 
868  if (m_env.allOptionsMap().count(m_option_bmm_run)) {
869  m_ov.m_bmmRun = m_env.allOptionsMap()[m_option_bmm_run].as<bool>();
870  }
871 
872  if (m_env.allOptionsMap().count(m_option_bmm_lengths)) {
873  m_ov.m_bmmLengths.clear();
874  std::vector<double> tmpLengths(0,0.);
875  std::string inputString = m_env.allOptionsMap()[m_option_bmm_lengths].as<std::string>();
876  MiscReadDoublesFromString(inputString,tmpLengths);
877  //if (m_env.subDisplayFile()) {
878  // *m_env.subDisplayFile() << "In SequenceStatisticalOptions::getMyOptionValues(): lengths for BMM = ";
879  // for (unsigned int i = 0; i < tmpLengths.size(); ++i) {
880  // *m_env.subDisplayFile() << " " << tmpLengths[i];
881  // }
882  // *m_env.subDisplayFile() << std::endl;
883  //}
884 
885  if (tmpLengths.size() > 0) {
886  m_ov.m_bmmLengths.resize(tmpLengths.size(),0);
887  for (unsigned int i = 0; i < m_ov.m_bmmLengths.size(); ++i) {
888  m_ov.m_bmmLengths[i] = (unsigned int) tmpLengths[i];
889  }
890  }
891  }
892 
893  if (m_env.allOptionsMap().count(m_option_fft_compute)) {
894  m_ov.m_fftCompute = m_env.allOptionsMap()[m_option_fft_compute].as<bool>();
895  }
896 
897  if (m_env.allOptionsMap().count(m_option_fft_paramId)) {
898  m_ov.m_fftParamId = m_env.allOptionsMap()[m_option_fft_paramId].as<unsigned int>();
899  }
900 
901  if (m_env.allOptionsMap().count(m_option_fft_size)) {
902  m_ov.m_fftSize = m_env.allOptionsMap()[m_option_fft_size].as<unsigned int>();
903  }
904 
905  if (m_env.allOptionsMap().count(m_option_fft_testInversion)) {
906  m_ov.m_fftTestInversion = m_env.allOptionsMap()[m_option_fft_testInversion].as<bool>();
907  }
908 
909  if (m_env.allOptionsMap().count(m_option_fft_write)) {
910  m_ov.m_fftWrite = m_env.allOptionsMap()[m_option_fft_write].as<bool>();
911  }
912 
913  if (m_env.allOptionsMap().count(m_option_psd_compute)) {
914  m_ov.m_psdCompute = m_env.allOptionsMap()[m_option_psd_compute].as<bool>();
915  }
916 
917  if (m_env.allOptionsMap().count(m_option_psd_numBlocks)) {
918  m_ov.m_psdNumBlocks = m_env.allOptionsMap()[m_option_psd_numBlocks].as<unsigned int>();
919  }
920 
921  if (m_env.allOptionsMap().count(m_option_psd_hopSizeRatio)) {
922  m_ov.m_psdHopSizeRatio = m_env.allOptionsMap()[m_option_psd_hopSizeRatio].as<double>();
923  }
924 
925  if (m_env.allOptionsMap().count(m_option_psd_paramId)) {
926  m_ov.m_psdParamId = m_env.allOptionsMap()[m_option_psd_paramId].as<unsigned int>();
927  }
928 
929  if (m_env.allOptionsMap().count(m_option_psd_write)) {
930  m_ov.m_psdWrite = m_env.allOptionsMap()[m_option_psd_write].as<bool>();
931  }
932 
933  if (m_env.allOptionsMap().count(m_option_psdAtZero_compute)) {
934  m_ov.m_psdAtZeroCompute = m_env.allOptionsMap()[m_option_psdAtZero_compute].as<bool>();
935  }
936 
937  if (m_env.allOptionsMap().count(m_option_psdAtZero_numBlocks)) {
938  m_ov.m_psdAtZeroNumBlocks.clear();
939  std::vector<double> tmpNumBlocks(0,0.);
940  std::string inputString = m_env.allOptionsMap()[m_option_psdAtZero_numBlocks].as<std::string>();
941  MiscReadDoublesFromString(inputString,tmpNumBlocks);
942  //if (m_env.subDisplayFile()) {
943  // *m_env.subDisplayFile() << "In SequenceStatisticalOptions::getMyOptionValues(): numBlocks for psdAtZero = ";
944  // for (unsigned int i = 0; i < tmpNumBlocks.size(); ++i) {
945  // *m_env.subDisplayFile() << " " << numBlocks[i];
946  // }
947  // *m_env.subDisplayFile() << std::endl;
948  //}
949 
950  if (tmpNumBlocks.size() > 0) {
951  m_ov.m_psdAtZeroNumBlocks.resize(tmpNumBlocks.size(),0);
952  for (unsigned int i = 0; i < m_ov.m_psdAtZeroNumBlocks.size(); ++i) {
953  m_ov.m_psdAtZeroNumBlocks[i] = (unsigned int) tmpNumBlocks[i];
954  }
955  }
956  }
957 
958  if (m_env.allOptionsMap().count(m_option_psdAtZero_hopSizeRatio)) {
959  m_ov.m_psdAtZeroHopSizeRatio = m_env.allOptionsMap()[m_option_psdAtZero_hopSizeRatio].as<double>();
960  }
961 
962  if (m_env.allOptionsMap().count(m_option_psdAtZero_display)) {
963  m_ov.m_psdAtZeroDisplay = m_env.allOptionsMap()[m_option_psdAtZero_display].as<bool>();
964  }
965 
966  if (m_env.allOptionsMap().count(m_option_psdAtZero_write)) {
967  m_ov.m_psdAtZeroWrite = m_env.allOptionsMap()[m_option_psdAtZero_write].as<bool>();
968  }
969 
970  if (m_env.allOptionsMap().count(m_option_geweke_compute)) {
971  m_ov.m_gewekeCompute = m_env.allOptionsMap()[m_option_geweke_compute].as<bool>();
972  }
973 
974  if (m_env.allOptionsMap().count(m_option_geweke_naRatio)) {
975  m_ov.m_gewekeNaRatio = m_env.allOptionsMap()[m_option_geweke_naRatio].as<double>();
976  }
977 
978  if (m_env.allOptionsMap().count(m_option_geweke_nbRatio)) {
979  m_ov.m_gewekeNbRatio = m_env.allOptionsMap()[m_option_geweke_nbRatio].as<double>();
980  }
981 
982  if (m_env.allOptionsMap().count(m_option_geweke_display)) {
983  m_ov.m_gewekeDisplay = m_env.allOptionsMap()[m_option_geweke_display].as<bool>();
984  }
985 
986  if (m_env.allOptionsMap().count(m_option_geweke_write)) {
987  m_ov.m_gewekeWrite = m_env.allOptionsMap()[m_option_geweke_write].as<bool>();
988  }
989 
990  if (m_env.allOptionsMap().count(m_option_meanStacc_compute)) {
991  m_ov.m_meanStaccCompute = m_env.allOptionsMap()[m_option_meanStacc_compute].as<bool>();
992  }
993 
994  if (m_env.allOptionsMap().count(m_option_hist_compute)) {
995  m_ov.m_histCompute = m_env.allOptionsMap()[m_option_hist_compute].as<bool>();
996  }
997 
998  if (m_env.allOptionsMap().count(m_option_hist_numInternalBins)) {
999  m_ov.m_histNumInternalBins = m_env.allOptionsMap()[m_option_hist_numInternalBins].as<unsigned int>();
1000  }
1001 
1002  if (m_env.allOptionsMap().count(m_option_cdfStacc_compute)) {
1003  m_ov.m_cdfStaccCompute = m_env.allOptionsMap()[m_option_cdfStacc_compute].as<bool>();
1004  }
1005 
1006  if (m_env.allOptionsMap().count(m_option_cdfStacc_numEvalPositions)) {
1007  m_ov.m_cdfStaccNumEvalPositions = m_env.allOptionsMap()[m_option_cdfStacc_numEvalPositions].as<unsigned int>();
1008  }
1009 #endif
1010  if (m_env.allOptionsMap().count(m_option_autoCorr_computeViaDef)) {
1011  m_ov.m_autoCorrComputeViaDef = m_env.allOptionsMap()[m_option_autoCorr_computeViaDef].as<bool>();
1012  }
1013 
1014  if (m_env.allOptionsMap().count(m_option_autoCorr_computeViaFft)) {
1015  m_ov.m_autoCorrComputeViaFft = m_env.allOptionsMap()[m_option_autoCorr_computeViaFft].as<bool>();
1016  }
1017 
1018  if (m_env.allOptionsMap().count(m_option_autoCorr_secondLag)) {
1019  m_ov.m_autoCorrSecondLag = m_env.allOptionsMap()[m_option_autoCorr_secondLag].as<unsigned int>();
1020  }
1021 
1022  if (m_env.allOptionsMap().count(m_option_autoCorr_lagSpacing)) {
1023  m_ov.m_autoCorrLagSpacing = m_env.allOptionsMap()[m_option_autoCorr_lagSpacing].as<unsigned int>();
1024  }
1025 
1026  if (m_env.allOptionsMap().count(m_option_autoCorr_numLags)) {
1027  m_ov.m_autoCorrNumLags = m_env.allOptionsMap()[m_option_autoCorr_numLags].as<unsigned int>();
1028  }
1029 
1030  if (m_env.allOptionsMap().count(m_option_autoCorr_display)) {
1031  m_ov.m_autoCorrDisplay = m_env.allOptionsMap()[m_option_autoCorr_display].as<bool>();
1032  }
1033 
1034  if (m_env.allOptionsMap().count(m_option_autoCorr_write)) {
1035  m_ov.m_autoCorrWrite = m_env.allOptionsMap()[m_option_autoCorr_write].as<bool>();
1036  }
1037 
1038  if (m_env.allOptionsMap().count(m_option_kde_compute)) {
1039  m_ov.m_kdeCompute = m_env.allOptionsMap()[m_option_kde_compute].as<bool>();
1040  }
1041 
1042  if (m_env.allOptionsMap().count(m_option_kde_numEvalPositions)) {
1043  m_ov.m_kdeNumEvalPositions = m_env.allOptionsMap()[m_option_kde_numEvalPositions].as<unsigned int>();
1044  }
1045 
1046  if (m_env.allOptionsMap().count(m_option_covMatrix_compute)) {
1047  m_ov.m_covMatrixCompute = m_env.allOptionsMap()[m_option_covMatrix_compute].as<bool>();
1048  }
1049 
1050  if (m_env.allOptionsMap().count(m_option_corrMatrix_compute)) {
1051  m_ov.m_corrMatrixCompute = m_env.allOptionsMap()[m_option_corrMatrix_compute].as<bool>();
1052  }
1053 
1054  return;
1055 }
1056 
1057 const std::vector<double>&
1059 {
1060  queso_deprecated();
1061 
1063 }
1064 
1065 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
1066 unsigned int
1068 {
1069  queso_deprecated();
1070 
1071  return m_ov.m_meanMonitorPeriod;
1072 }
1073 
1074 bool
1076 {
1077  queso_deprecated();
1078 
1079  return m_ov.m_bmmRun;
1080 }
1081 
1082 const std::vector<unsigned int>&
1084 {
1085  queso_deprecated();
1086 
1087  return m_ov.m_bmmLengths;
1088 }
1089 
1090 bool
1092 {
1093  queso_deprecated();
1094 
1095  return m_ov.m_bmmDisplay;
1096 }
1097 
1098 bool
1100 {
1101  queso_deprecated();
1102 
1103  return m_ov.m_bmmWrite;
1104 }
1105 
1106 bool
1108 {
1109  queso_deprecated();
1110 
1111  return m_ov.m_fftCompute;
1112 }
1113 
1114 unsigned int
1116 {
1117  queso_deprecated();
1118 
1119  return m_ov.m_fftParamId;
1120 }
1121 
1122 unsigned int
1124 {
1125  queso_deprecated();
1126 
1127  return m_ov.m_fftSize;
1128 }
1129 
1130 bool
1132 {
1133  queso_deprecated();
1134 
1135  return m_ov.m_fftTestInversion;
1136 }
1137 
1138 bool
1140 {
1141  queso_deprecated();
1142 
1143  return m_ov.m_fftWrite;
1144 }
1145 
1146 bool
1148 {
1149  queso_deprecated();
1150 
1151  return m_ov.m_psdCompute;
1152 }
1153 
1154 unsigned int
1156 {
1157  queso_deprecated();
1158 
1159  return m_ov.m_psdNumBlocks;
1160 }
1161 
1162 double
1164 {
1165  queso_deprecated();
1166 
1167  return m_ov.m_psdHopSizeRatio;
1168 }
1169 
1170 unsigned int
1172 {
1173  queso_deprecated();
1174 
1175  return m_ov.m_psdParamId;
1176 }
1177 
1178 bool
1180 {
1181  queso_deprecated();
1182 
1183  return m_ov.m_psdWrite;
1184 }
1185 
1186 bool
1188 {
1189  queso_deprecated();
1190 
1191  return m_ov.m_psdAtZeroCompute;
1192 }
1193 
1194 const std::vector<unsigned int>&
1196 {
1197  queso_deprecated();
1198 
1199  return m_ov.m_psdAtZeroNumBlocks;
1200 }
1201 
1202 double
1204 {
1205  queso_deprecated();
1206 
1208 }
1209 
1210 bool
1212 {
1213  queso_deprecated();
1214 
1215  return m_ov.m_psdAtZeroDisplay;
1216 }
1217 
1218 bool
1220 {
1221  queso_deprecated();
1222 
1223  return m_ov.m_psdAtZeroWrite;
1224 }
1225 
1226 bool
1228 {
1229  queso_deprecated();
1230 
1231  return m_ov.m_gewekeCompute;
1232 }
1233 
1234 double
1236 {
1237  queso_deprecated();
1238 
1239  return m_ov.m_gewekeNaRatio;
1240 }
1241 
1242 double
1244 {
1245  queso_deprecated();
1246 
1247  return m_ov.m_gewekeNbRatio;
1248 }
1249 
1250 bool
1252 {
1253  queso_deprecated();
1254 
1255  return m_ov.m_gewekeDisplay;
1256 }
1257 
1258 bool
1260 {
1261  queso_deprecated();
1262 
1263  return m_ov.m_gewekeWrite;
1264 }
1265 
1266 bool
1268 {
1269  queso_deprecated();
1270 
1271  return m_ov.m_meanStaccCompute;
1272 }
1273 
1274 bool
1276 {
1277  queso_deprecated();
1278 
1279  return m_ov.m_histCompute;
1280 }
1281 
1282 unsigned int
1284 {
1285  queso_deprecated();
1286 
1287  return m_ov.m_histNumInternalBins;
1288 }
1289 
1290 bool
1292 {
1293  queso_deprecated();
1294 
1295  return m_ov.m_cdfStaccCompute;
1296 }
1297 
1298 unsigned int
1300 {
1301  queso_deprecated();
1302 
1304 }
1305 #endif
1306 bool
1308 {
1309  queso_deprecated();
1310 
1312 }
1313 
1314 bool
1316 {
1317  queso_deprecated();
1318 
1320 }
1321 
1322 unsigned int
1324 {
1325  queso_deprecated();
1326 
1327  return m_ov.m_autoCorrSecondLag;
1328 }
1329 
1330 unsigned int
1332 {
1333  queso_deprecated();
1334 
1335  return m_ov.m_autoCorrLagSpacing;
1336 }
1337 
1338 unsigned int
1340 {
1341  queso_deprecated();
1342 
1343  return m_ov.m_autoCorrNumLags;
1344 }
1345 
1346 bool
1348 {
1349  queso_deprecated();
1350 
1351  return m_ov.m_autoCorrDisplay;
1352 }
1353 
1354 bool
1356 {
1357  queso_deprecated();
1358 
1359  return m_ov.m_autoCorrWrite;
1360 }
1361 
1362 bool
1364 {
1365  queso_deprecated();
1366 
1367  return m_ov.m_kdeCompute;
1368 }
1369 
1370 unsigned int
1372 {
1373  queso_deprecated();
1374 
1375  return m_ov.m_kdeNumEvalPositions;
1376 }
1377 
1378 bool
1380 {
1381  queso_deprecated();
1382 
1383  return m_ov.m_covMatrixCompute;
1384 }
1385 
1386 bool
1388 {
1389  queso_deprecated();
1390 
1391  return m_ov.m_corrMatrixCompute;
1392 }
1393 
1394 void
1395 SequenceStatisticalOptions::print(std::ostream& os) const
1396 {
1397  queso_deprecated();
1398 
1399  os << "\n" << m_option_initialDiscardedPortions << " = ";
1400  for (unsigned int i = 0; i < m_ov.m_initialDiscardedPortions.size(); ++i) {
1401  os << m_ov.m_initialDiscardedPortions[i] << " ";
1402  }
1403  os
1404 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
1406  << "\n" << m_option_bmm_run << " = " << m_ov.m_bmmRun
1407  << "\n" << m_option_bmm_lengths << " = ";
1408  for (unsigned int i = 0; i < m_ov.m_bmmLengths.size(); ++i) {
1409  os << m_ov.m_bmmLengths[i] << " ";
1410  }
1411  os << "\n" << m_option_fft_compute << " = " << m_ov.m_fftCompute
1412  << "\n" << m_option_fft_paramId << " = " << m_ov.m_fftParamId
1413  << "\n" << m_option_fft_size << " = " << m_ov.m_fftSize
1414  << "\n" << m_option_fft_testInversion << " = " << m_ov.m_fftTestInversion
1415  << "\n" << m_option_fft_write << " = " << m_ov.m_fftWrite
1416  << "\n" << m_option_psd_compute << " = " << m_ov.m_psdCompute
1417  << "\n" << m_option_psd_paramId << " = " << m_ov.m_psdParamId
1418  << "\n" << m_option_psd_numBlocks << " = " << m_ov.m_psdNumBlocks
1419  << "\n" << m_option_psd_hopSizeRatio << " = " << m_ov.m_psdHopSizeRatio
1420  << "\n" << m_option_psd_write << " = " << m_ov.m_psdWrite
1421  << "\n" << m_option_psdAtZero_compute << " = " << m_ov.m_psdAtZeroCompute
1422  << "\n" << m_option_psdAtZero_numBlocks << " = ";
1423  for (unsigned int i = 0; i < m_ov.m_psdAtZeroNumBlocks.size(); ++i) {
1424  os << m_ov.m_psdAtZeroNumBlocks[i] << " ";
1425  }
1427  << "\n" << m_option_psdAtZero_display << " = " << m_ov.m_psdAtZeroDisplay
1428  << "\n" << m_option_psdAtZero_write << " = " << m_ov.m_psdAtZeroWrite
1429  << "\n" << m_option_geweke_compute << " = " << m_ov.m_gewekeCompute
1430  << "\n" << m_option_geweke_naRatio << " = " << m_ov.m_gewekeNaRatio
1431  << "\n" << m_option_geweke_nbRatio << " = " << m_ov.m_gewekeNbRatio
1432  << "\n" << m_option_geweke_display << " = " << m_ov.m_gewekeDisplay
1433  << "\n" << m_option_geweke_write << " = " << m_ov.m_gewekeWrite
1434  << "\n" << m_option_meanStacc_compute << " = " << m_ov.m_meanStaccCompute
1435  << "\n" << m_option_hist_compute << " = " << m_ov.m_histCompute
1437  << "\n" << m_option_cdfStacc_compute << " = " << m_ov.m_cdfStaccCompute
1439 #endif
1444  << "\n" << m_option_autoCorr_numLags << " = " << m_ov.m_autoCorrNumLags
1445  << "\n" << m_option_autoCorr_display << " = " << m_ov.m_autoCorrDisplay
1446  << "\n" << m_option_autoCorr_write << " = " << m_ov.m_autoCorrWrite
1447  << "\n" << m_option_kde_compute << " = " << m_ov.m_kdeCompute
1449  << "\n" << m_option_covMatrix_compute << " = " << m_ov.m_covMatrixCompute
1451  << std::endl;
1452 
1453  return;
1454 }
1455 
1456 std::ostream&
1457 operator<<(std::ostream& os, const SequenceStatisticalOptions& obj)
1458 {
1459  queso_deprecated();
1460 
1461  obj.print(os);
1462 
1463  return os;
1464 }
1465 
1466 } // End namespace QUESO
1467 
1468 #endif // ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
BoostInputOptionsParser * m_parser
std::string m_option_autoCorr_computeViaFft
std::string m_option_kde_numEvalPositions
std::ostream & operator<<(std::ostream &os, const SequenceStatisticalOptions &obj)
unsigned int autoCorrSecondLag() const
Returns the second lag of the autocorrelation. Access to private attribute m_autoCorrSecondLag.
std::string m_option_fft_testInversion
std::string m_option_cdfStacc_numEvalPositions
unsigned int autoCorrLagSpacing() const
Returns the spacing of the autocorrelation. Access to private attribute m_autoCorrLagSpacing.
SsOptionsValues & operator=(const SsOptionsValues &rhs)
Assignment operator; it copies rhs to this.
A templated class that stores statistical options (optionally read from an input file) ...
std::string m_option_psdAtZero_compute
const std::vector< double > & initialDiscardedPortions() const
Finds the initially discarded portion of the chain. Access to private attribute m_initialDiscardedPor...
std::string m_option_initialDiscardedPortions
bool corrMatrixCompute() const
Finds the correlation matrix. Access to private attribute m_corrMatrixCompute.
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"))
bool covMatrixCompute() const
Finds the covariance matrix. Access to private attribute m_covMatrixCompute.
std::vector< unsigned int > m_bmmLengths
std::string m_option_meanStacc_compute
unsigned int kdeNumEvalPositions() const
Returns number of evaluation positions for KDE. Access to private attribute m_kdeNumEvalPositions.
void print(std::ostream &os) const
Prints the initial discarded portion of the chain; and, optionally, other attributes of the chain...
std::string m_option_psdAtZero_hopSizeRatio
void copy(const SsOptionsValues &src)
Copies the option values from src to this.
unsigned int m_cdfStaccNumEvalPositions
std::string m_option_psdAtZero_numBlocks
const std::vector< unsigned int > & bmmLengths() const
unsigned int autoCorrNumLags() const
Returns the number of lags of the autocorrelation. Access to private attribute m_autoCorrNumLags.
bool m_corrMatrixCompute
Whether or not compute correlation matrix.
std::vector< double > m_initialDiscardedPortions
Stores the initial discarded portion of the chain.
std::string m_option_hist_numInternalBins
std::string m_option_psdAtZero_display
virtual ~SsOptionsValues()
Destructor.
const std::vector< unsigned int > & psdAtZeroNumBlocks() const
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
Definition: Miscellaneous.C:40
bool autoCorrComputeViaDef() const
Compute autocorrelation via definition. Access to private attribute m_autoCorrComputeViaDef.
std::string m_option_mean_monitorPeriod
std::vector< unsigned int > m_psdAtZeroNumBlocks
std::string m_option_autoCorr_computeViaDef
unsigned int m_kdeNumEvalPositions
Number of positions to evaluate kde.
boost::program_options::options_description * m_optionsDesc
unsigned int m_autoCorrLagSpacing
Lag spacing of the autocorrelation.
unsigned int cdfStaccNumEvalPositions() const
bool m_covMatrixCompute
Whether or not compute covariance matrix.
bool m_kdeCompute
Whether or not compute kernel density estimate (kde).
bool m_autoCorrWrite
Whether or not write autocorrelation to file.
bool m_autoCorrDisplay
Whether or not display autocorrelation.
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"))
SequenceStatisticalOptions(const BaseEnvironment &env, const std::string &prefix)
Constructor: reads options from the input file.
unsigned int m_autoCorrSecondLag
Second lag of the autocorrelation.
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Defines the options for the chain.
bool autoCorrDisplay() const
Displays autocorrelation. Access to private attribute m_autoCorrDisplay.
bool m_autoCorrComputeViaDef
Whether or not compute autocorrelation via definition.
std::string m_option_covMatrix_compute
unsigned int m_autoCorrNumLags
Number of lags of the autocorrelation.
bool m_autoCorrComputeViaFft
Whether or not compute autocorrelation via FFT.
bool autoCorrComputeViaFft() const
Compute autocorrelation via FFT. Access to private attribute m_autoCorrComputeViaFft.
std::string m_option_autoCorr_secondLag
bool kdeCompute() const
Computes KDE. Access to private attribute m_kdeCompute.
std::string m_option_corrMatrix_compute
bool autoCorrWrite() const
Writes autocorrelation. Access to private attribute m_autoCorrWrite.
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Reads the chain options.
SsOptionsValues()
Default constructor.
std::string m_option_autoCorr_lagSpacing
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:54 for queso-0.57.1 by  doxygen 1.8.5