queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
SequenceStatisticalOptions.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-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 #ifndef UQ_SEQUENCE_STATISTICAL_OPTIONS_H
26 #define UQ_SEQUENCE_STATISTICAL_OPTIONS_H
27 
28 #include <queso/Defines.h>
29 
30 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
31 
32 #include <queso/Environment.h>
33 #include <queso/BoostInputOptionsParser.h>
34 
35 #define UQ_SEQUENCE_INITIAL_DISCARDED_PORTIONS_ODV "0."
36 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
37 #define UQ_SEQUENCE_MEAN_MONITOR_PERIOD_ODV 0
38 #define UQ_SEQUENCE_BMM_RUN_ODV 0
39 #define UQ_SEQUENCE_BMM_LENGTHS_ODV "0"
40 #define UQ_SEQUENCE_BMM_DISPLAY_ODV 0
41 #define UQ_SEQUENCE_BMM_WRITE_ODV 0
42 #define UQ_SEQUENCE_FFT_COMPUTE_ODV 0
43 #define UQ_SEQUENCE_FFT_PARAM_ID_ODV 0
44 #define UQ_SEQUENCE_FFT_SIZE_ODV 2048
45 #define UQ_SEQUENCE_FFT_TEST_INVERSION_ODV 0
46 #define UQ_SEQUENCE_FFT_WRITE_ODV 0
47 #define UQ_SEQUENCE_PSD_COMPUTE_ODV 0
48 #define UQ_SEQUENCE_PSD_NUM_BLOCKS_ODV 8
49 #define UQ_SEQUENCE_PSD_HOP_SIZE_RATIO_ODV 0.
50 #define UQ_SEQUENCE_PSD_PARAM_ID_ODV 0
51 #define UQ_SEQUENCE_PSD_WRITE_ODV 0
52 #define UQ_SEQUENCE_PSD_AT_ZERO_COMPUTE_ODV 0
53 #define UQ_SEQUENCE_PSD_AT_ZERO_NUM_BLOCKS_ODV "8"
54 #define UQ_SEQUENCE_PSD_AT_ZERO_HOP_SIZE_RATIO_ODV .5
55 #define UQ_SEQUENCE_PSD_AT_ZERO_DISPLAY_ODV 0
56 #define UQ_SEQUENCE_PSD_AT_ZERO_WRITE_ODV 0
57 #define UQ_SEQUENCE_GEWEKE_COMPUTE_ODV 0
58 #define UQ_SEQUENCE_GEWEKE_NA_RATIO_ODV .1
59 #define UQ_SEQUENCE_GEWEKE_NB_RATIO_ODV .5
60 #define UQ_SEQUENCE_GEWEKE_DISPLAY_ODV 0
61 #define UQ_SEQUENCE_GEWEKE_WRITE_ODV 0
62 #define UQ_SEQUENCE_MEAN_STACC_COMPUTE_ODV 0
63 #define UQ_SEQUENCE_HIST_COMPUTE_ODV 0
64 #define UQ_SEQUENCE_HIST_NUM_INTERNAL_BINS_ODV 100
65 #define UQ_SEQUENCE_CDF_STACC_COMPUTE_ODV 0
66 #define UQ_SEQUENCE_CDF_STACC_NUM_EVAL_POSITIONS_ODV 50
67 #endif
68 #define UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_DEF_ODV 0
69 #define UQ_SEQUENCE_AUTO_CORR_COMPUTE_VIA_FFT_ODV 0
70 #define UQ_SEQUENCE_AUTO_CORR_SECOND_LAG_ODV 0
71 #define UQ_SEQUENCE_AUTO_CORR_LAG_SPACING_ODV 0
72 #define UQ_SEQUENCE_AUTO_CORR_NUM_LAGS_ODV 0
73 #define UQ_SEQUENCE_AUTO_CORR_DISPLAY_ODV 0
74 #define UQ_SEQUENCE_AUTO_CORR_WRITE_ODV 0
75 #define UQ_SEQUENCE_KDE_COMPUTE_ODV 0
76 #define UQ_SEQUENCE_KDE_NUM_EVAL_POSITIONS_ODV 100
77 #define UQ_SEQUENCE_COV_MATRIX_COMPUTE_ODV 0
78 #define UQ_SEQUENCE_CORR_MATRIX_COMPUTE_ODV 0
79 
80 namespace boost {
81  namespace program_options {
82  class options_description;
83  }
84 }
85 
95 {
96 public:
98 
99 
101  SsOptionsValues ();
102 
104 
105  SsOptionsValues(const BaseEnvironment * env, const char * prefix);
106 
108 
109  SsOptionsValues (const SsOptionsValues& src);
110 
112  virtual ~SsOptionsValues ();
114 
116 
120 
122 
123 
124  std::string m_prefix;
125 
127  std::vector<double> m_initialDiscardedPortions;
128 
131 
134 
136  unsigned int m_autoCorrSecondLag;
137 
139  unsigned int m_autoCorrLagSpacing;
140 
142  unsigned int m_autoCorrNumLags;
143 
146 
149 
152 
154  unsigned int m_kdeNumEvalPositions;
155 
158 
161 
162 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
163  unsigned int m_meanMonitorPeriod;
164 
165  bool m_bmmRun;
166  std::vector<unsigned int> m_bmmLengths;
169 
171  unsigned int m_fftParamId;
172  unsigned int m_fftSize;
175 
177  unsigned int m_psdNumBlocks;
179  unsigned int m_psdParamId;
181 
183  std::vector<unsigned int> m_psdAtZeroNumBlocks;
187 
193 
195 
197  unsigned int m_histNumInternalBins;
198 
201 #endif
202 
203  // end public attributes
204 private:
205  BoostInputOptionsParser * m_parser;
206 
207  std::string m_option_help;
209 
217  std::string m_option_kde_compute;
221 
222 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
224  std::string m_option_bmm_run;
225  std::string m_option_bmm_lengths;
226  std::string m_option_bmm_display;
227  std::string m_option_bmm_write;
228  std::string m_option_fft_compute;
229  std::string m_option_fft_paramId;
230  std::string m_option_fft_size;
232  std::string m_option_fft_write;
233  std::string m_option_psd_compute;
236  std::string m_option_psd_paramId;
237  std::string m_option_psd_write;
253 #endif
254 
256  void copy(const SsOptionsValues& src);
257 };
258 
259 //------------------------------------------------------------------------------------------------
260 
270 {
271 public:
273 
274 
277  SequenceStatisticalOptions(const BaseEnvironment& env,
278  const std::string& prefix);
279 
281 
283  SequenceStatisticalOptions(const BaseEnvironment& env,
284  const std::string& prefix,
285  const SsOptionsValues& alternativeOptionsValues);
289 
291 
292 
294  const std::vector<double>& initialDiscardedPortions() const;
295 
297  bool autoCorrComputeViaDef() const;
298 
300  bool autoCorrComputeViaFft() const;
301 
303  unsigned int autoCorrSecondLag () const;
304 
306  unsigned int autoCorrLagSpacing () const;
307 
309  unsigned int autoCorrNumLags () const;
310 
312  bool autoCorrDisplay () const;
313 
315  bool autoCorrWrite () const;
316 
318  bool kdeCompute () const;
319 
321  unsigned int kdeNumEvalPositions() const;
322 
324  bool covMatrixCompute () const;
325 
327  bool corrMatrixCompute() const;
329 
331 
332  void print(std::ostream& os) const;
335 
337 
340 
341 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
342 
343  unsigned int meanMonitorPeriod() const;
344 
345  bool bmmRun () const;
346  const std::vector<unsigned int>& bmmLengths() const;
347  bool bmmDisplay() const;
348  bool bmmWrite () const;
349 
350  bool fftCompute () const;
351  unsigned int fftParamId () const;
352  unsigned int fftSize () const;
353  bool fftTestInversion() const;
354  bool fftWrite () const;
355 
356  bool psdCompute () const;
357  unsigned int psdNumBlocks () const;
358  double psdHopSizeRatio() const;
359  unsigned int psdParamId () const;
360  bool psdWrite () const;
361 
362  bool psdAtZeroCompute () const;
363  const std::vector<unsigned int>& psdAtZeroNumBlocks () const;
364  double psdAtZeroHopSizeRatio() const;
365  bool psdAtZeroDisplay () const;
366  bool psdAtZeroWrite () const;
367 
368  bool gewekeCompute() const;
369  double gewekeNaRatio() const;
370  double gewekeNbRatio() const;
371  bool gewekeDisplay() const;
372  bool gewekeWrite () const;
373 
374  bool meanStaccCompute() const;
375 
376  bool histCompute () const;
377  unsigned int histNumInternalBins() const;
378 
379  bool cdfStaccCompute () const;
380  unsigned int cdfStaccNumEvalPositions() const;
381 #endif
382 
383 private:
385  void defineMyOptions (boost::program_options::options_description& optionsDesc) const;
386 
388  void getMyOptionValues(boost::program_options::options_description& optionsDesc);
389 
390  std::string m_prefix;
391  const BaseEnvironment& m_env;
392  boost::program_options::options_description* m_optionsDesc;
393 
394  std::string m_option_help;
396 
404  std::string m_option_kde_compute;
408 
409 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
411  std::string m_option_bmm_run;
412  std::string m_option_bmm_lengths;
413  std::string m_option_bmm_display;
414  std::string m_option_bmm_write;
415  std::string m_option_fft_compute;
416  std::string m_option_fft_paramId;
417  std::string m_option_fft_size;
419  std::string m_option_fft_write;
420  std::string m_option_psd_compute;
423  std::string m_option_psd_paramId;
424  std::string m_option_psd_write;
440 #endif
441 
442 };
443 
444 std::ostream& operator<<(std::ostream& os, const SequenceStatisticalOptions& obj);
445 
446 #endif // ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
447 
448 #endif // UQ_SEQUENCE_STATISTICAL_OPTIONS_H
449 
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.
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
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.
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