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

Generated on Thu Jun 11 2015 13:52:31 for queso-0.53.0 by  doxygen 1.8.5