queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
VectorSequence.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,2009,2010,2011,2012 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_VECTOR_SEQUENCE_H
26 #define UQ_VECTOR_SEQUENCE_H
27 
28 #undef UQ_CODE_HAS_MONITORS
29 
30 #include <queso/VectorSpace.h>
31 #include <queso/BoxSubset.h>
32 #include <queso/ScalarSequence.h>
33 #include <queso/SequenceStatisticalOptions.h>
34 #include <queso/ArrayOfOneDGrids.h>
35 #include <queso/ArrayOfOneDTables.h>
36 #include <queso/2dArrayOfStuff.h>
37 #include <sys/time.h>
38 #include <fstream>
39 
40 namespace QUESO {
41 
42 class GslVector;
43 class GslMatrix;
44 
55 template <class V = GslVector, class M = GslMatrix>
57 {
58 public:
60 
63  unsigned int subSequenceSize,
64  const std::string& name);
66  virtual ~BaseVectorSequence();
68 
70 
71  virtual unsigned int subSequenceSize () const = 0;
73 
75 
76  unsigned int unifiedSequenceSize () const;
77 
79  unsigned int vectorSizeLocal () const;
80 
82  unsigned int vectorSizeGlobal () const;
83 
85  const VectorSpace<V,M>& vectorSpace () const;
86 
88 
90  const std::string& name () const;
91 
93  void setName (const std::string& newName);
94 
96  void clear ();
97 
99  const V& subMinPlain () const;
100 
102  const V& unifiedMinPlain () const;
103 
105  const V& subMaxPlain () const;
106 
108  const V& unifiedMaxPlain () const;
109 
111  const V& subMeanPlain () const;
112 
114  const V& unifiedMeanPlain () const;
115 
117  const V& subMedianPlain () const;
118 
120  const V& unifiedMedianPlain () const;
121 
123  const V& subSampleVariancePlain () const;
124 
126  const V& unifiedSampleVariancePlain () const;
127 
129  const BoxSubset<V,M>& subBoxPlain () const;
130 
132  const BoxSubset<V,M>& unifiedBoxPlain () const;
133 
135 
139  void deleteStoredVectors ();
140 
142 
143  void append (const BaseVectorSequence<V,M>& src,
144  unsigned int initialPos,
145  unsigned int numPos);
147  double subPositionsOfMaximum (const ScalarSequence<double>& subCorrespondingScalarValues,
149 
151 
161  double unifiedPositionsOfMaximum (const ScalarSequence<double>& subCorrespondingScalarValues,
163 
164 
166 
167  virtual void resizeSequence (unsigned int newSubSequenceSize) = 0;
168 
170 
171  virtual void resetValues (unsigned int initialPos, unsigned int numPos) = 0;
172 
174 
175  virtual void erasePositions (unsigned int initialPos, unsigned int numPos) = 0;
176 
177 
179  virtual void getPositionValues (unsigned int posId, V& vec) const = 0;
180 
182 
183  virtual void setPositionValues (unsigned int posId, const V& vec) = 0;
184 
186 
187  void setGaussian (const V& meanVec, const V& stdDevVec);
188 
190 
191  void setUniform (const V& aVec, const V& bVec );
192 
194  virtual void subMeanExtra (unsigned int initialPos,
195  unsigned int numPos,
196  V& meanVec) const = 0;
197 
199  virtual void unifiedMeanExtra (unsigned int initialPos,
200  unsigned int numPos,
201  V& unifiedMeanVec) const = 0;
203  virtual void subMedianExtra (unsigned int initialPos,
204  unsigned int numPos,
205  V& medianVec) const = 0;
207  virtual void unifiedMedianExtra (unsigned int initialPos,
208  unsigned int localNumPos,
209  V& unifiedMedianVec) const = 0;
211  virtual void subSampleVarianceExtra (unsigned int initialPos,
212  unsigned int numPos,
213  const V& meanVec,
214  V& samVec) const = 0;
216  virtual void unifiedSampleVarianceExtra (unsigned int initialPos,
217  unsigned int numPos,
218  const V& unifiedMeanVec,
219  V& unifiedSamVec) const = 0;
221  virtual void subPopulationVariance (unsigned int initialPos,
222  unsigned int numPos,
223  const V& meanVec,
224  V& popVec) const = 0;
226  virtual void unifiedPopulationVariance (unsigned int initialPos,
227  unsigned int numPos,
228  const V& unifiedMeanVec,
229  V& unifiedPopVec) const = 0;
230 
232 
236  virtual void autoCovariance (unsigned int initialPos,
237  unsigned int numPos,
238  const V& meanVec,
239  unsigned int lag,
240  V& covVec) const = 0;
242  virtual void autoCorrViaDef (unsigned int initialPos,
243  unsigned int numPos,
244  unsigned int lag,
245  V& corrVec) const = 0;
247  virtual void autoCorrViaFft (unsigned int initialPos,
248  unsigned int numPos,
249  const std::vector<unsigned int>& lags,
250  std::vector<V*>& corrVecs) const = 0;
252  virtual void autoCorrViaFft (unsigned int initialPos,
253  unsigned int numPos,
254  unsigned int numSum,
255  V& autoCorrsSumVec) const = 0;
256 
257 
259  virtual void subMinMaxExtra (unsigned int initialPos,
260  unsigned int numPos,
261  V& minVec,
262  V& maxVec) const = 0;
264  virtual void unifiedMinMaxExtra (unsigned int initialPos,
265  unsigned int numPos,
266  V& unifiedMinVec,
267  V& unifiedMaxVec) const = 0;
269 
274  virtual void subHistogram (unsigned int initialPos,
275  const V& minVec,
276  const V& maxVec,
277  std::vector<V*>& centersForAllBins,
278  std::vector<V*>& quanttsForAllBins) const = 0;
280  virtual void unifiedHistogram (unsigned int initialPos,
281  const V& unifiedMinVec,
282  const V& unifiedMaxVec,
283  std::vector<V*>& unifiedCentersForAllBins,
284  std::vector<V*>& unifiedQuanttsForAllBins) const = 0;
285 
287  virtual void subInterQuantileRange (unsigned int initialPos,
288  V& iqrVec) const = 0;
290  virtual void unifiedInterQuantileRange (unsigned int initialPos,
291  V& unifiedIqrVec) const = 0;
292 
294 
302  virtual void subScalesForKde (unsigned int initialPos,
303  const V& iqrVec,
304  unsigned int kdeDimension,
305  V& scaleVec) const = 0;
307  virtual void unifiedScalesForKde (unsigned int initialPos,
308  const V& unifiedIqrVec,
309  unsigned int kdeDimension,
310  V& unifiedScaleVec) const = 0;
312 
316  virtual void subGaussian1dKde (unsigned int initialPos,
317  const V& scaleVec,
318  const std::vector<V*>& evaluationParamVecs,
319  std::vector<V*>& densityVecs) const = 0;
321  virtual void unifiedGaussian1dKde (unsigned int initialPos,
322  const V& unifiedScaleVec,
323  const std::vector<V*>& unifiedEvaluationParamVecs,
324  std::vector<V*>& unifiedDensityVecs) const = 0;
326  virtual void subWriteContents (unsigned int initialPos,
327  unsigned int numPos,
328  const std::string& fileName,
329  const std::string& fileType,
330  const std::set<unsigned int>& allowedSubEnvIds) const = 0;
332  virtual void subWriteContents (unsigned int initialPos,
333  unsigned int numPos,
334  std::ofstream& ofsvar,
335  const std::string& fileType) const = 0;
337  virtual void unifiedWriteContents (const std::string& fileName,
338  const std::string& fileType) const = 0;
340  virtual void unifiedReadContents (const std::string& fileName,
341  const std::string& fileType,
342  const unsigned int subSequenceSize) = 0;
344  virtual void select (const std::vector<unsigned int>& idsOfUniquePositions) = 0;
345 
347  virtual void filter (unsigned int initialPos,
348  unsigned int spacing) = 0;
350  void computeFilterParams (std::ofstream* passedOfs,
351  unsigned int & initialPos,
352  unsigned int & spacing);
354  virtual double estimateConvBrooksGelman (unsigned int initialPos,
355  unsigned int numPos) const = 0;
357  virtual void extractScalarSeq (unsigned int initialPos,
358  unsigned int spacing,
359  unsigned int numPos,
360  unsigned int paramId,
361  ScalarSequence<double>& scalarSeq) const = 0;
362 
363 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
364  virtual void subUniformlySampledCdf (const V& numEvaluationPointsVec,
365  ArrayOfOneDGrids <V,M>& cdfGrids,
366  ArrayOfOneDTables<V,M>& cdfValues) const = 0;
367  virtual void unifiedUniformlySampledCdf (const V& numEvaluationPointsVec,
368  ArrayOfOneDGrids <V,M>& unifiedCdfGrids,
369  ArrayOfOneDTables<V,M>& unifieddfValues) const = 0;
370  virtual void bmm (unsigned int initialPos,
371  unsigned int batchLength,
372  V& bmmVec) const = 0;
373  virtual void fftForward (unsigned int initialPos,
374  unsigned int fftSize,
375  unsigned int paramId,
376  std::vector<std::complex<double> >& fftResult) const = 0;
377 //virtual void fftInverse (unsigned int fftSize) = 0;
378  virtual void psd (unsigned int initialPos,
379  unsigned int numBlocks,
380  double hopSizeRatio,
381  unsigned int paramId,
382  std::vector<double>& psdResult) const = 0;
383  virtual void psdAtZero (unsigned int initialPos,
384  unsigned int numBlocks,
385  double hopSizeRatio,
386  V& psdVec) const = 0;
387  virtual void geweke (unsigned int initialPos,
388  double ratioNa,
389  double ratioNb,
390  V& gewVec) const = 0;
391  virtual void meanStacc (unsigned int initialPos,
392  V& meanStaccVec) const = 0;
393  virtual void subCdfStacc (unsigned int initialPos,
394  const std::vector<V*>& evalPositionsVecs, std::vector<V*>& cdfStaccVecs) const = 0;
395 #endif //QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
396 
397 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
398  void computeHistCdfstaccKde (const SequenceStatisticalOptions& statisticalOptions,
399  std::ofstream* passedOfs);
400 
401  void computeStatistics (const SequenceStatisticalOptions& statisticalOptions,
402  std::ofstream* passedOfs);
403 
404  void computeHistCdfstaccKde (const SsOptionsValues& statisticalOptions,
405  std::ofstream* passedOfs);
406 
407  void computeStatistics (const SsOptionsValues& statisticalOptions,
408  std::ofstream* passedOfs);
409 #endif //QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
410 
411 #ifdef UQ_ALSO_COMPUTE_MDFS_WITHOUT_KDE
412  virtual void subUniformlySampledMdf (const V& numEvaluationPointsVec,
413  ArrayOfOneDGrids <V,M>& mdfGrids,
414  ArrayOfOneDTables<V,M>& mdfValues) const = 0;
415 #endif //UQ_ALSO_COMPUTE_MDFS_WITHOUT_KDE
416 
418 
419 protected:
421 
422  void copy (const BaseVectorSequence<V,M>& src);
423 
425  virtual void extractRawData (unsigned int initialPos,
426  unsigned int spacing,
427  unsigned int numPos,
428  unsigned int paramId,
429  std::vector<double>& rawData) const = 0;
430 
433  std::string m_name;
434 
436  mutable V* m_subMinPlain;
437  mutable V* m_unifiedMinPlain;
438  mutable V* m_subMaxPlain;
439  mutable V* m_unifiedMaxPlain;
440  mutable V* m_subMeanPlain;
441  mutable V* m_unifiedMeanPlain;
442  mutable V* m_subMedianPlain;
448 
449 
450 #ifdef UQ_CODE_HAS_MONITORS
451  virtual void subMeanMonitorAlloc (unsigned int numberOfMonitorPositions) = 0;
452  virtual void subMeanInter0MonitorAlloc (unsigned int numberOfMonitorPositions) = 0;
453  virtual void unifiedMeanMonitorAlloc (unsigned int numberOfMonitorPositions) = 0;
454 
455  virtual void subMeanMonitorRun (unsigned int monitorPosition,
456  V& subMeanVec,
457  V& subMeanCltStd) = 0;
458  virtual void subMeanInter0MonitorRun (unsigned int monitorPosition,
459  V& subMeanInter0Mean,
460  V& subMeanInter0Clt95,
461  V& subMeanInter0Empirical90,
462  V& subMeanInter0Min,
463  V& subMeanInter0Max) = 0;
464  virtual void unifiedMeanMonitorRun (unsigned int monitorPosition,
465  V& unifiedMeanVec,
466  V& unifiedMeanCltStd) = 0;
467 
468  virtual void subMeanMonitorStore (unsigned int i,
469  unsigned int monitorPosition,
470  const V& subMeanVec,
471  const V& subMeanCltStd) = 0;
472  virtual void subMeanInter0MonitorStore (unsigned int i,
473  unsigned int monitorPosition,
474  const V& subMeanInter0Mean,
475  const V& subMeanInter0Clt95,
476  const V& subMeanInter0Empirical90,
477  const V& subMeanInter0Min,
478  const V& subMeanInter0Max) = 0;
479  virtual void unifiedMeanMonitorStore (unsigned int i,
480  unsigned int monitorPosition,
481  V& unifiedMeanVec,
482  V& unifiedMeanCltStd) = 0;
483 
484  virtual void subMeanMonitorWrite (std::ofstream& ofs) = 0;
485  virtual void subMeanInter0MonitorWrite (std::ofstream& ofs) = 0;
486  virtual void unifiedMeanMonitorWrite (std::ofstream& ofs) = 0;
487 
488  virtual void subMeanMonitorFree () = 0;
489  virtual void subMeanInter0MonitorFree () = 0;
490  virtual void unifiedMeanMonitorFree () = 0;
491 
492  void computeMeanEvolution (const SequenceStatisticalOptions& statisticalOptions,
493  std::ofstream* passedOfs);
494 
495  void computeMeanEvolution (const SsOptionsValues& statisticalOptions,
496  std::ofstream* passedOfs);
497 #endif
498 
499 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
500  void computeBMM (const SequenceStatisticalOptions& statisticalOptions,
501  const std::vector<unsigned int>& initialPosForStatistics,
502  std::ofstream* passedOfs);
503  void computeFFT (const SequenceStatisticalOptions& statisticalOptions,
504  const std::vector<unsigned int>& initialPosForStatistics,
505  std::ofstream* passedOfs);
506  void computePSD (const SequenceStatisticalOptions& statisticalOptions,
507  const std::vector<unsigned int>& initialPosForStatistics,
508  std::ofstream* passedOfs);
509  void computePSDAtZero (const SequenceStatisticalOptions& statisticalOptions,
510  const std::vector<unsigned int>& initialPosForStatistics,
511  std::ofstream* passedOfs);
512  void computeGeweke (const SequenceStatisticalOptions& statisticalOptions,
513  const std::vector<unsigned int>& initialPosForStatistics,
514  std::ofstream* passedOfs);
515  void computeMeanStacc (const SequenceStatisticalOptions& statisticalOptions,
516  const std::vector<unsigned int>& initialPosForStatistics,
517  std::ofstream* passedOfs);
518 
519  void computeBMM (const SsOptionsValues& statisticalOptions,
520  const std::vector<unsigned int>& initialPosForStatistics,
521  std::ofstream* passedOfs);
522  void computeFFT (const SsOptionsValues& statisticalOptions,
523  const std::vector<unsigned int>& initialPosForStatistics,
524  std::ofstream* passedOfs);
525  void computePSD (const SsOptionsValues& statisticalOptions,
526  const std::vector<unsigned int>& initialPosForStatistics,
527  std::ofstream* passedOfs);
528  void computePSDAtZero (const SsOptionsValues& statisticalOptions,
529  const std::vector<unsigned int>& initialPosForStatistics,
530  std::ofstream* passedOfs);
531  void computeGeweke (const SsOptionsValues& statisticalOptions,
532  const std::vector<unsigned int>& initialPosForStatistics,
533  std::ofstream* passedOfs);
534  void computeMeanStacc (const SsOptionsValues& statisticalOptions,
535  const std::vector<unsigned int>& initialPosForStatistics,
536  std::ofstream* passedOfs);
537 #endif
538 
539 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
540  void computeMeanVars (const SequenceStatisticalOptions& statisticalOptions,
541  std::ofstream* passedOfs,
542  V* subMeanPtr,
543  V* subMedianPtr,
544  V* subSampleVarPtr,
545  V* subPopulVarPtr);
546  void computeAutoCorrViaDef (const SequenceStatisticalOptions& statisticalOptions,
547  const std::vector<unsigned int>& initialPosForStatistics,
548  const std::vector<unsigned int>& lagsForCorrs,
549  std::ofstream* passedOfs);
550  void computeAutoCorrViaFFT (const SequenceStatisticalOptions& statisticalOptions,
551  const std::vector<unsigned int>& initialPosForStatistics,
552  const std::vector<unsigned int>& lagsForCorrs,
553  std::ofstream* passedOfs);
554  void computeCovCorrMatrices (const SequenceStatisticalOptions& statisticalOptions,
555  std::ofstream* passedOfs);
556  void computeMeanVars (const SsOptionsValues& statisticalOptions,
557  std::ofstream* passedOfs,
558  V* subMeanPtr,
559  V* subMedianPtr,
560  V* subSampleVarPtr,
561  V* subPopulVarPtr);
562  void computeAutoCorrViaDef (const SsOptionsValues& statisticalOptions,
563  const std::vector<unsigned int>& initialPosForStatistics,
564  const std::vector<unsigned int>& lagsForCorrs,
565  std::ofstream* passedOfs);
566  void computeAutoCorrViaFFT (const SsOptionsValues& statisticalOptions,
567  const std::vector<unsigned int>& initialPosForStatistics,
568  const std::vector<unsigned int>& lagsForCorrs,
569  std::ofstream* passedOfs);
570  void computeCovCorrMatrices (const SsOptionsValues& statisticalOptions,
571  std::ofstream* passedOfs);
572 #endif
573 
574 };
575 
576 // --------------------------------------------------
577 // Additional methods --------------------------------
578 // (outside class declaration) ----------------------
579 //---------------------------------------------------
580 template <class P_V, class P_M, class Q_V, class Q_M>
581 void
583  const BaseVectorSequence<P_V,P_M>& subPSeq,
584  const BaseVectorSequence<Q_V,Q_M>& subQSeq,
585  unsigned int subNumSamples,
586  P_M& pqCovMatrix,
587  P_M& pqCorrMatrix);
588 
589 } // End namespace QUESO
590 
591 #endif // UQ_VECTOR_SEQUENCE_H
virtual void subMeanMonitorWrite(std::ofstream &ofs)=0
virtual void subWriteContents(unsigned int initialPos, unsigned int numPos, const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds) const =0
Writes info of the sub-sequence to a file. See template specialization.
Class to accommodate arrays of one-dimensional grid.
virtual void unifiedMedianExtra(unsigned int initialPos, unsigned int localNumPos, V &unifiedMedianVec) const =0
Finds the median value of the unified sequence, considering numPos positions starting at position ini...
void copy(const BaseVectorSequence< V, M > &src)
Copies vector sequence src to this.
virtual void subMeanExtra(unsigned int initialPos, unsigned int numPos, V &meanVec) const =0
Finds the mean value of the sub-sequence, considering numPos positions starting at position initialPo...
virtual void autoCorrViaFft(unsigned int initialPos, unsigned int numPos, const std::vector< unsigned int > &lags, std::vector< V * > &corrVecs) const =0
Calculates autocorrelation via Fast Fourier transforms (FFT). See template specialization.
virtual void unifiedMinMaxExtra(unsigned int initialPos, unsigned int numPos, V &unifiedMinVec, V &unifiedMaxVec) const =0
Finds the minimum and the maximum values of the unified sequence, considering numPos positions starti...
virtual unsigned int subSequenceSize() const =0
Size of the sub-sequence of vectors. See template specialization.
virtual void fftForward(unsigned int initialPos, unsigned int fftSize, unsigned int paramId, std::vector< std::complex< double > > &fftResult) const =0
virtual void subMeanMonitorFree()=0
virtual void unifiedMeanMonitorStore(unsigned int i, unsigned int monitorPosition, V &unifiedMeanVec, V &unifiedMeanCltStd)=0
void computeAutoCorrViaDef(const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, const std::vector< unsigned int > &lagsForCorrs, std::ofstream *passedOfs)
virtual void geweke(unsigned int initialPos, double ratioNa, double ratioNb, V &gewVec) const =0
virtual void subUniformlySampledCdf(const V &numEvaluationPointsVec, ArrayOfOneDGrids< V, M > &cdfGrids, ArrayOfOneDTables< V, M > &cdfValues) const =0
A class representing a vector space.
Definition: VectorSet.h:49
void setName(const std::string &newName)
Changes the name of the sequence of vectors.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:198
const V & subMeanPlain() const
Finds the mean value of the sub-sequence.
virtual void erasePositions(unsigned int initialPos, unsigned int numPos)=0
Erase numPos positions in the sequence, starting at position initialPos.
void computeBMM(const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs)
A templated class that stores statistical options (optionally read from an input file) ...
unsigned int unifiedSequenceSize() const
Calculates the size of the unified sequence of vectors.
virtual void subMinMaxExtra(unsigned int initialPos, unsigned int numPos, V &minVec, V &maxVec) const =0
Finds the minimum and the maximum values of the sub-sequence, considering numPos positions starting a...
virtual void subInterQuantileRange(unsigned int initialPos, V &iqrVec) const =0
Returns the interquartile range of the values in the sub-sequence. See template specialization.
virtual void autoCovariance(unsigned int initialPos, unsigned int numPos, const V &meanVec, unsigned int lag, V &covVec) const =0
Calculates the autocovariance. See template specialization.
virtual void unifiedMeanExtra(unsigned int initialPos, unsigned int numPos, V &unifiedMeanVec) const =0
Finds the mean value of the unified sequence of numPos positions starting at position initialPos...
virtual void subMeanInter0MonitorStore(unsigned int i, unsigned int monitorPosition, const V &subMeanInter0Mean, const V &subMeanInter0Clt95, const V &subMeanInter0Empirical90, const V &subMeanInter0Min, const V &subMeanInter0Max)=0
void computeStatistics(const SequenceStatisticalOptions &statisticalOptions, std::ofstream *passedOfs)
Class to accommodate arrays of one-dimensional tables.
virtual void unifiedSampleVarianceExtra(unsigned int initialPos, unsigned int numPos, const V &unifiedMeanVec, V &unifiedSamVec) const =0
Finds the sample variance of the unified sequence, considering numPos positions starting at position ...
void clear()
Reset the values and the size of the sequence of vectors.
virtual void subSampleVarianceExtra(unsigned int initialPos, unsigned int numPos, const V &meanVec, V &samVec) const =0
Finds the sample variance of the sub-sequence, considering numPos positions starting at position init...
void append(const BaseVectorSequence< V, M > &src, unsigned int initialPos, unsigned int numPos)
Appends the vector src to this vector.
const V & unifiedSampleVariancePlain() const
Finds the variance of a sample of the unified sequence.
virtual void unifiedMeanMonitorFree()=0
void setUniform(const V &aVec, const V &bVec)
Sets the values of the sequence as a uniform distribution between the values given by vectors aVec an...
virtual void extractScalarSeq(unsigned int initialPos, unsigned int spacing, unsigned int numPos, unsigned int paramId, ScalarSequence< double > &scalarSeq) const =0
Extracts a sequence of scalars of size numPos, starting at position initialPos, given spacing spacing...
const V & subSampleVariancePlain() const
Finds the variance of a sample of the sub-sequence.
void computeFilterParams(std::ofstream *passedOfs, unsigned int &initialPos, unsigned int &spacing)
Computes the filtering parameters spacing for the sequence of vectors.
unsigned int vectorSizeGlobal() const
Global dimension (size) of the vector space.
virtual void unifiedMeanMonitorWrite(std::ofstream &ofs)=0
virtual void subMeanMonitorRun(unsigned int monitorPosition, V &subMeanVec, V &subMeanCltStd)=0
void deleteStoredVectors()
Deletes all the stored vectors.
virtual void unifiedScalesForKde(unsigned int initialPos, const V &unifiedIqrVec, unsigned int kdeDimension, V &unifiedScaleVec) const =0
Selects the scales (bandwidth) for the kernel density estimation, considering the unified sequence...
double subPositionsOfMaximum(const ScalarSequence< double > &subCorrespondingScalarValues, BaseVectorSequence< V, M > &subPositionsOfMaximum)
Finds the positions where the maximum element occurs in the sub-sequence.
virtual void subGaussian1dKde(unsigned int initialPos, const V &scaleVec, const std::vector< V * > &evaluationParamVecs, std::vector< V * > &densityVecs) const =0
Gaussian kernel for the KDE estimate of the sub-sequence. See template specialization.
void computeGeweke(const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs)
virtual void unifiedPopulationVariance(unsigned int initialPos, unsigned int numPos, const V &unifiedMeanVec, V &unifiedPopVec) const =0
Finds the population variance of the unified-sequence, considering numPos positions starting at posit...
virtual void meanStacc(unsigned int initialPos, V &meanStaccVec) const =0
void computeCovCorrMatrices(const SequenceStatisticalOptions &statisticalOptions, std::ofstream *passedOfs)
virtual void unifiedMeanMonitorAlloc(unsigned int numberOfMonitorPositions)=0
void computeMeanEvolution(const SequenceStatisticalOptions &statisticalOptions, std::ofstream *passedOfs)
virtual void unifiedWriteContents(const std::string &fileName, const std::string &fileType) const =0
Writes info of the unified sequence to a file. See template specialization.
const VectorSpace< V, M > & m_vectorSpace
BoxSubset< V, M > * m_unifiedBoxPlain
const V & unifiedMedianPlain() const
Finds the median value of the unified sequence.
virtual void resetValues(unsigned int initialPos, unsigned int numPos)=0
Reset the values of the sequence. See template specialization.
virtual void subMeanInter0MonitorFree()=0
const std::string & name() const
Access to protected attribute m_name: name of the sequence of vectors.
Class representing a subset of a vector space shaped like a hypercube.
Definition: BoxSubset.h:44
virtual void subPopulationVariance(unsigned int initialPos, unsigned int numPos, const V &meanVec, V &popVec) const =0
Finds the population variance of the sub-sequence, considering numPos positions starting at position ...
virtual void bmm(unsigned int initialPos, unsigned int batchLength, V &bmmVec) const =0
Base class for handling vector and array samples (sequence of vectors or arrays). ...
virtual void getPositionValues(unsigned int posId, V &vec) const =0
Gets the values of the sequence at position posId and stores them at vec. See template specialization...
void computeHistCdfstaccKde(const SequenceStatisticalOptions &statisticalOptions, std::ofstream *passedOfs)
void computePSDAtZero(const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs)
void computeFFT(const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs)
const V & subMaxPlain() const
Finds the maximum value of the sub-sequence.
virtual void resizeSequence(unsigned int newSubSequenceSize)=0
Resize the sequence. See template specialization.
virtual void select(const std::vector< unsigned int > &idsOfUniquePositions)=0
Select positions in the sequence of vectors. See template specialization.
BoxSubset< V, M > * m_subBoxPlain
const BoxSubset< V, M > & subBoxPlain() const
Finds a box subset of the sub-sequence (given by its min and max values calculated via subMinPlain an...
virtual void unifiedReadContents(const std::string &fileName, const std::string &fileType, const unsigned int subSequenceSize)=0
Reads info of the unified sequence from a file. See template specialization.
virtual ~BaseVectorSequence()
Destructor.
virtual void subUniformlySampledMdf(const V &numEvaluationPointsVec, ArrayOfOneDGrids< V, M > &mdfGrids, ArrayOfOneDTables< V, M > &mdfValues) const =0
void computeMeanVars(const SequenceStatisticalOptions &statisticalOptions, std::ofstream *passedOfs, V *subMeanPtr, V *subMedianPtr, V *subSampleVarPtr, V *subPopulVarPtr)
void computeMeanStacc(const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs)
virtual void unifiedInterQuantileRange(unsigned int initialPos, V &unifiedIqrVec) const =0
Returns the interquartile range of the values in the unified sequence. See template specialization...
void setGaussian(const V &meanVec, const V &stdDevVec)
Sets the values of the sequence as a Gaussian distribution of mean given by meanVec and standard devi...
virtual void subMeanInter0MonitorWrite(std::ofstream &ofs)=0
virtual void unifiedMeanMonitorRun(unsigned int monitorPosition, V &unifiedMeanVec, V &unifiedMeanCltStd)=0
const VectorSpace< V, M > & vectorSpace() const
Vector space; access to protected attribute VectorSpace&lt;V,M&gt;&amp; m_vectorSpace.
const V & unifiedMinPlain() const
Finds the minimum value of the unified sequence.
const V & subMinPlain() const
Finds the minimum value of the sub-sequence.
virtual void subMeanMonitorAlloc(unsigned int numberOfMonitorPositions)=0
virtual void subMeanInter0MonitorRun(unsigned int monitorPosition, V &subMeanInter0Mean, V &subMeanInter0Clt95, V &subMeanInter0Empirical90, V &subMeanInter0Min, V &subMeanInter0Max)=0
virtual double estimateConvBrooksGelman(unsigned int initialPos, unsigned int numPos) const =0
Estimates convergence rate using Brooks &amp; Gelman method. See template specialization.
virtual void filter(unsigned int initialPos, unsigned int spacing)=0
Filters positions in the sequence of vectors, starting at initialPos, and with spacing given by spaci...
virtual void unifiedHistogram(unsigned int initialPos, const V &unifiedMinVec, const V &unifiedMaxVec, std::vector< V * > &unifiedCentersForAllBins, std::vector< V * > &unifiedQuanttsForAllBins) const =0
Calculates the histogram of the unified sequence. See template specialization.
virtual void subCdfStacc(unsigned int initialPos, const std::vector< V * > &evalPositionsVecs, std::vector< V * > &cdfStaccVecs) const =0
virtual void autoCorrViaDef(unsigned int initialPos, unsigned int numPos, unsigned int lag, V &corrVec) const =0
Calculates autocorrelation via definition. See template specialization.
virtual void subMeanMonitorStore(unsigned int i, unsigned int monitorPosition, const V &subMeanVec, const V &subMeanCltStd)=0
const V & subMedianPlain() const
Finds the median value of the sub-sequence.
void computePSD(const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs)
virtual void subHistogram(unsigned int initialPos, const V &minVec, const V &maxVec, std::vector< V * > &centersForAllBins, std::vector< V * > &quanttsForAllBins) const =0
Calculates the histogram of the sub-sequence. See template specialization.
virtual void setPositionValues(unsigned int posId, const V &vec)=0
Set the values in vec at position posId of the sequence. See template specialization.
BaseVectorSequence(const VectorSpace< V, M > &vectorSpace, unsigned int subSequenceSize, const std::string &name)
Default constructor.
virtual void subScalesForKde(unsigned int initialPos, const V &iqrVec, unsigned int kdeDimension, V &scaleVec) const =0
Selects the scales (bandwidth, scaleVec) for the kernel density estimation, considering only the sub-...
virtual void extractRawData(unsigned int initialPos, unsigned int spacing, unsigned int numPos, unsigned int paramId, std::vector< double > &rawData) const =0
Extracts the raw data. See template specialization.
const V & unifiedMaxPlain() const
Finds the maximum value of the unified sequence.
virtual void subMedianExtra(unsigned int initialPos, unsigned int numPos, V &medianVec) const =0
Finds the median value of the sub-sequence, considering numPos positions starting at position initial...
unsigned int vectorSizeLocal() const
Local dimension (size) of the vector space.
virtual void unifiedGaussian1dKde(unsigned int initialPos, const V &unifiedScaleVec, const std::vector< V * > &unifiedEvaluationParamVecs, std::vector< V * > &unifiedDensityVecs) const =0
Gaussian kernel for the KDE estimate of the unified sequence. See template specialization.
const BaseEnvironment & m_env
virtual void subMeanInter0MonitorAlloc(unsigned int numberOfMonitorPositions)=0
const V & unifiedMeanPlain() const
Finds the mean value of the unified sequence.
virtual void psdAtZero(unsigned int initialPos, unsigned int numBlocks, double hopSizeRatio, V &psdVec) const =0
virtual void psd(unsigned int initialPos, unsigned int numBlocks, double hopSizeRatio, unsigned int paramId, std::vector< double > &psdResult) const =0
virtual void unifiedUniformlySampledCdf(const V &numEvaluationPointsVec, ArrayOfOneDGrids< V, M > &unifiedCdfGrids, ArrayOfOneDTables< V, M > &unifieddfValues) const =0
void computeAutoCorrViaFFT(const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, const std::vector< unsigned int > &lagsForCorrs, std::ofstream *passedOfs)
double unifiedPositionsOfMaximum(const ScalarSequence< double > &subCorrespondingScalarValues, BaseVectorSequence< V, M > &unifiedPositionsOfMaximum)
Finds the positions where the maximum element occurs in the unified sequence.
void ComputeCovCorrMatricesBetweenVectorSequences(const BaseVectorSequence< P_V, P_M > &subPSeq, const BaseVectorSequence< Q_V, Q_M > &subQSeq, unsigned int subNumSamples, P_M &pqCovMatrix, P_M &pqCorrMatrix)
const BoxSubset< V, M > & unifiedBoxPlain() const
Finds a box subset of the unified-sequence (given by the min and max values of the unified sequence c...
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