queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
ScalarSequence.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_SCALAR_SEQUENCE_H
26 #define UQ_SCALAR_SEQUENCE_H
27 
28 #include <queso/Fft.h>
29 #include <queso/UniformOneDGrid.h>
30 #include <queso/Environment.h>
31 #include <queso/Miscellaneous.h>
32 #include <queso/Defines.h>
33 #include <vector>
34 #include <complex>
35 #include <sys/time.h>
36 
37 #define SCALAR_SEQUENCE_INIT_MPI_MSG 1
38 #define SCALAR_SEQUENCE_SIZE_MPI_MSG 1
39 #define SCALAR_SEQUENCE_DATA_MPI_MSG 1
40 
41 namespace QUESO {
42 
53 template <class T = double>
55 {
56 public:
58 
59  typedef typename std::vector<T>::iterator seqScalarPositionIteratorTypedef;
60  typedef typename std::vector<T>::const_iterator seqScalarPositionConstIteratorTypedef;
62 
66  unsigned int subSequenceSize,
67  const std::string& name);
71 
73 
77 
79 
80  const T& operator[] (unsigned int posId) const;
82 
84 
85  T& operator[] (unsigned int posId);
87 
89 
90  const BaseEnvironment& env () const;
92 
94  const std::string& name () const;
95 
97  void setName (const std::string& newName);
98 
100 
101  void clear ();
102 
104  unsigned int subSequenceSize () const;
105 
107  unsigned int unifiedSequenceSize (bool useOnlyInter0Comm) const;
108 
110 
111  void resizeSequence (unsigned int newSequenceSize);
112 
114 
115  void resetValues (unsigned int initialPos, unsigned int );
116 
118 
119  void erasePositions (unsigned int initialPos, unsigned int numPos);
120 
122  void getUnifiedContentsAtProc0Only(bool useOnlyInter0Comm,
123  std::vector<T>& outputVec) const;
124 
126  const T& subMinPlain () const;
127 
129  const T& unifiedMinPlain (bool useOnlyInter0Comm) const;
130 
132  const T& subMaxPlain () const;
133 
135  const T& unifiedMaxPlain (bool useOnlyInter0Comm) const;
136 
138  const T& subMeanPlain () const;
139 
141  const T& unifiedMeanPlain (bool useOnlyInter0Comm) const;
142 
144  const T& subMedianPlain () const;
145 
147  const T& unifiedMedianPlain (bool useOnlyInter0Comm) const;
148 
150  const T& subSampleVariancePlain () const;
151 
153  const T& unifiedSampleVariancePlain (bool useOnlyInter0Comm) const;
154 
156  void deleteStoredScalars ();
157 
159 
160  void setGaussian (const T& mean, const T& stdDev);
161 
163 
164  void setUniform (const T& a, const T& b );
165 
167  void subUniformlySampledCdf (unsigned int numIntervals,
168  T& minDomainValue,
169  T& maxDomainValue,
170  std::vector<T>& cdfValues) const;
171 
173  void unifiedUniformlySampledCdf (bool useOnlyInter0Comm,
174  unsigned int numIntervals,
175  T& unifiedMinDomainValue,
176  T& unifiedMaxDomainValue,
177  std::vector<T>& unifiedCdfValues) const;
179  void subBasicCdf (unsigned int numIntervals,
180  UniformOneDGrid<T>*& gridValues,
181  std::vector<T>& cdfValues) const;
183  void subWeightCdf (unsigned int numIntervals,
184  std::vector<T>& gridValues,
185  std::vector<T>& cdfValues) const;
186 
188  void subWeightCdf (unsigned int numIntervals,
189  UniformOneDGrid<T>*& gridValues,
190  std::vector<T>& cdfValues) const;
191 
193  T subMeanExtra (unsigned int initialPos,
194  unsigned int numPos) const;
195 
197  T unifiedMeanExtra (bool useOnlyInter0Comm,
198  unsigned int initialPos,
199  unsigned int localNumPos) const;
200 
202  T subMedianExtra (unsigned int initialPos,
203  unsigned int numPos) const;
204 
206  T unifiedMedianExtra (bool useOnlyInter0Comm,
207  unsigned int initialPos,
208  unsigned int localNumPos) const;
209 
211 
216  T subSampleVarianceExtra (unsigned int initialPos,
217  unsigned int numPos,
218  const T& meanValue) const;
220 
221  T unifiedSampleVarianceExtra (bool useOnlyInter0Comm,
222  unsigned int initialPos,
223  unsigned int localNumPos,
224  const T& unifiedMeanValue) const;
226  T subSampleStd (unsigned int initialPos,
227  unsigned int numPos,
228  const T& meanValue) const;
230  T unifiedSampleStd (bool useOnlyInter0Comm,
231  unsigned int initialPos,
232  unsigned int localNumPos,
233  const T& unifiedMeanValue) const;
235 
241  T subPopulationVariance (unsigned int initialPos,
242  unsigned int numPos,
243  const T& meanValue) const;
245 
246  T unifiedPopulationVariance (bool useOnlyInter0Comm,
247  unsigned int initialPos,
248  unsigned int numPos,
249  const T& unifiedMeanValue) const;
251 
255  T autoCovariance (unsigned int initialPos,
256  unsigned int numPos,
257  const T& meanValue,
258  unsigned int lag) const;
259 
261 
266  T autoCorrViaDef (unsigned int initialPos,
267  unsigned int numPos,
268  unsigned int lag) const;
269 
271  void autoCorrViaFft (unsigned int initialPos,
272  unsigned int numPos,
273  unsigned int maxLag,
274  std::vector<T>& autoCorrs) const;
275 
277  void autoCorrViaFft (unsigned int initialPos,
278  unsigned int numPos,
279  unsigned int numSum,
280  T& autoCorrsSum) const;
282  void subMinMaxExtra (unsigned int initialPos,
283  unsigned int numPos,
284  T& minValue,
285  T& maxValue) const;
287  void unifiedMinMaxExtra (bool useOnlyInter0Comm,
288  unsigned int initialPos,
289  unsigned int numPos,
290  T& unifiedMinValue,
291  T& unifiedMaxValue) const;
293 
297  void subHistogram (unsigned int initialPos,
298  const T& minHorizontalValue,
299  const T& maxHorizontalValue,
300  std::vector<T>& centers,
301  std::vector<unsigned int>& bins) const;
303  void unifiedHistogram (bool useOnlyInter0Comm,
304  unsigned int initialPos,
305  const T& unifiedMinHorizontalValue,
306  const T& unifiedMaxHorizontalValue,
307  std::vector<T>& unifiedCenters,
308  std::vector<unsigned int>& unifiedBins) const;
310 
314  void subBasicHistogram (unsigned int initialPos,
315  const T& minHorizontalValue,
316  const T& maxHorizontalValue,
317  UniformOneDGrid<T>*& gridValues,
318  std::vector<unsigned int>& bins) const;
320 
325  void subWeightHistogram (unsigned int initialPos,
326  const T& minHorizontalValue,
327  const T& maxHorizontalValue,
328  UniformOneDGrid<T>*& gridValues,
329  std::vector<unsigned int>& bins) const;
331 
333  void subWeightHistogram (unsigned int initialPos,
334  const T& minHorizontalValue,
335  const T& maxHorizontalValue,
336  std::vector<T>& gridValues,
337  std::vector<unsigned int>& bins) const;
339  void subSort (unsigned int initialPos,
340  ScalarSequence<T>& sortedSequence) const;
342  void unifiedSort (bool useOnlyInter0Comm,
343  unsigned int initialPos,
344  ScalarSequence<T>& unifiedSortedSequence) const;
346 
351  T subInterQuantileRange (unsigned int initialPos) const;
352 
354  T unifiedInterQuantileRange (bool useOnlyInter0Comm,
355  unsigned int initialPos) const;
356 
358 
366  T subScaleForKde (unsigned int initialPos,
367  const T& iqrValue,
368  unsigned int kdeDimension) const;
369 
371  T unifiedScaleForKde (bool useOnlyInter0Comm,
372  unsigned int initialPos,
373  const T& unifiedIqrValue,
374  unsigned int kdeDimension) const;
376 
380  void subGaussian1dKde (unsigned int initialPos,
381  double scaleValue,
382  const std::vector<T>& evaluationPositions,
383  std::vector<double>& densityValues) const;
384 
386  void unifiedGaussian1dKde (bool useOnlyInter0Comm,
387  unsigned int initialPos,
388  double unifiedScaleValue,
389  const std::vector<T>& unifiedEvaluationPositions,
390  std::vector<double>& unifiedDensityValues) const;
391 
393 
394  void filter (unsigned int initialPos,
395  unsigned int spacing);
396 
398 
399  T brooksGelmanConvMeasure (bool useOnlyInter0Comm,
400  unsigned int initialPos,
401  unsigned int spacing) const;
402 
404 
405  void append (const ScalarSequence<T>& src,
406  unsigned int srcInitialPos,
407  unsigned int srcNumPos);
409  T subPositionsOfMaximum (const ScalarSequence<T>& subCorrespondingScalarValues,
412  T unifiedPositionsOfMaximum (const ScalarSequence<T>& subCorrespondingScalarValues,
414 
416 
420  void subWriteContents (unsigned int initialPos,
421  unsigned int numPos,
422  const std::string& fileName,
423  const std::string& fileType,
424  const std::set<unsigned int>& allowedSubEnvIds) const;
426 
427  void subWriteContents (unsigned int initialPos,
428  unsigned int numPos,
429  std::ofstream& ofs,
430  const std::string& fileType) const;
432 
433  void unifiedWriteContents (const std::string& fileName,
434  const std::string& fileType) const;
435 
437  void unifiedReadContents (const std::string& fileName,
438  const std::string& fileType,
439  const unsigned int subSequenceSize);
440 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
441  T bmm (unsigned int initialPos,
442  unsigned int batchLength) const;
443  void psd (unsigned int initialPos,
444  unsigned int numBlocks,
445  double hopSizeRatio,
446  std::vector<double>& psdSequence) const;
447  T geweke (unsigned int initialPos,
448  double ratioNa,
449  double ratioNb) const;
450  T meanStacc (unsigned int initialPos) const;
451  void subCdfPercentageRange (unsigned int initialPos,
452  unsigned int numPos,
453  double range, // \in [0,1]
454  T& lowerValue,
455  T& upperValue) const;
456  void unifiedCdfPercentageRange (bool useOnlyInter0Comm,
457  unsigned int initialPos,
458  unsigned int numPos,
459  double range, // \in [0,1]
460  T& lowerValue,
461  T& upperValue) const;
462 
463  void subCdfStacc (unsigned int initialPos,
464  std::vector<double>& cdfStaccValues,
465  std::vector<double>& cdfStaccValuesup,
466  std::vector<double>& cdfStaccValueslow,
467  const ScalarSequence<T>& sortedDataValues) const;
468  void subCdfStacc (unsigned int initialPos,
469  const std::vector<T>& evaluationPositions,
470  std::vector<double>& cdfStaccValues) const;
471  void subUniformlySampledMdf (unsigned int numIntervals,
472  T& minDomainValue,
473  T& maxDomainValue,
474  std::vector<T>& mdfValues) const;
475  T subMeanCltStd (unsigned int initialPos,
476  unsigned int numPos,
477  const T& meanValue) const;
478  T unifiedMeanCltStd (bool useOnlyInter0Comm,
479  unsigned int initialPos,
480  unsigned int localNumPos,
481  const T& unifiedMeanValue) const;
482 #endif
483 
484 private:
486 
487  void copy (const ScalarSequence<T>& src);
488 
490  void writeUnifiedMatlabHeader(std::ofstream & ofs, double sequenceSize) const;
491 
493  void writeSubMatlabHeader(std::ofstream & ofs, double sequenceSize) const;
494 
496  void writeTxtHeader(std::ofstream & ofs, double sequenceSize) const;
497 
499 
501  void extractScalarSeq (unsigned int initialPos,
502  unsigned int spacing,
503  unsigned int numPos,
504  ScalarSequence<T>& scalarSeq) const;
506 
509  void extractRawData (unsigned int initialPos,
510  unsigned int spacing,
511  unsigned int numPos,
512  std::vector<double>& rawData) const;
513 
515  std::vector<T>& rawData ();
516 
518  void subSort ();
519 
521  void parallelMerge (std::vector<T>& sortedBuffer,
522  const std::vector<T>& leafData,
523  unsigned int treeLevel) const;
524 
526  std::string m_name;
527  std::vector<T> m_seq;
528 
529  mutable T* m_subMinPlain;
530  mutable T* m_unifiedMinPlain;
531  mutable T* m_subMaxPlain;
532  mutable T* m_unifiedMaxPlain;
533  mutable T* m_subMeanPlain;
534  mutable T* m_unifiedMeanPlain;
535  mutable T* m_subMedianPlain;
539 };
540 
541 // --------------------------------------------------
542 // Additional methods -------------------------------
543 // (outside class declaration) ----------------------
544 //---------------------------------------------------
545 template <class T>
546 void
548  const ScalarSequence<T>& scalarSeq2,
549  unsigned int initialPos,
550  double scaleValue1,
551  double scaleValue2,
552  const std::vector<T>& evaluationPositions1,
553  const std::vector<T>& evaluationPositions2,
554  std::vector<double>& densityValues);
555 
556 //---------------------------------------------------
557 template <class T>
558 void
559 ComputeUnifiedGaussian2dKde(bool useOnlyInter0Comm, // INPUT
560  const ScalarSequence<T>& scalarSeq1, // INPUT
561  const ScalarSequence<T>& scalarSeq2, // INPUT
562  unsigned int initialPos, // INPUT
563  double unifiedScaleValue1, // INPUT
564  double unifiedScaleValue2, // INPUT
565  const std::vector<T>& unifiedEvaluationPositions1, // INPUT
566  const std::vector<T>& unifiedEvaluationPositions2, // INPUT
567  std::vector<double>& unifiedDensityValues); // OUTPUT
568 
569 // --------------------------------------------------
570 template <class T>
571 void
573  const ScalarSequence<T>& subPSeq,
574  const ScalarSequence<T>& subQSeq,
575  unsigned int subNumSamples,
576  T& covValue,
577  T& corrValue);
578 
579 } // End namespace QUESO
580 
581 #endif // UQ_SCALAR_SEQUENCE_H
T unifiedScaleForKde(bool useOnlyInter0Comm, unsigned int initialPos, const T &unifiedIqrValue, unsigned int kdeDimension) const
Selects the scales (bandwidth) for the kernel density estimation, considering the unified sequence...
const T & subMaxPlain() const
Finds the maximum value of the sub-sequence of scalars.
T subInterQuantileRange(unsigned int initialPos) const
Returns the interquartile range of the values in the sub-sequence.
const T & subMeanPlain() const
Finds the mean value of the sub-sequence of scalars.
ScalarSequence(const BaseEnvironment &env, unsigned int subSequenceSize, const std::string &name)
Default constructor.
void resizeSequence(unsigned int newSequenceSize)
Resizes the size of the sequence of scalars.
const T & unifiedMinPlain(bool useOnlyInter0Comm) const
Finds the minimum value of the unified sequence of scalars.
unsigned int unifiedSequenceSize(bool useOnlyInter0Comm) const
Size of the unified sequence of scalars.
~ScalarSequence()
Destructor.
const T & subMinPlain() const
Finds the minimum value of the sub-sequence of scalars.
ScalarSequence< T > & operator=(const ScalarSequence< T > &rhs)
Assignment operator; it copies rhs to this.
T unifiedMeanExtra(bool useOnlyInter0Comm, unsigned int initialPos, unsigned int localNumPos) const
Finds the mean value of the unified sequence of numPos positions starting at position initialPos...
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:198
void erasePositions(unsigned int initialPos, unsigned int numPos)
Erases numPos values of the sequence, starting at position initialPos.
T subMeanExtra(unsigned int initialPos, unsigned int numPos) const
Finds the mean value of the sub-sequence, considering numPos positions starting at position initialPo...
T unifiedSampleVarianceExtra(bool useOnlyInter0Comm, unsigned int initialPos, unsigned int localNumPos, const T &unifiedMeanValue) const
Finds the sample variance of the unified sequence, considering numPos positions starting at position ...
void unifiedGaussian1dKde(bool useOnlyInter0Comm, unsigned int initialPos, double unifiedScaleValue, const std::vector< T > &unifiedEvaluationPositions, std::vector< double > &unifiedDensityValues) const
Gaussian kernel for the KDE estimate of the unified sequence.
T brooksGelmanConvMeasure(bool useOnlyInter0Comm, unsigned int initialPos, unsigned int spacing) const
Estimates convergence rate using Brooks &amp; Gelman method.
void writeUnifiedMatlabHeader(std::ofstream &ofs, double sequenceSize) const
Helper function to write header info for matlab files from all chains.
const T & unifiedMeanPlain(bool useOnlyInter0Comm) const
Finds the mean value of the unified sequence of scalars.
void unifiedCdfPercentageRange(bool useOnlyInter0Comm, unsigned int initialPos, unsigned int numPos, double range, T &lowerValue, T &upperValue) const
T unifiedSampleStd(bool useOnlyInter0Comm, unsigned int initialPos, unsigned int localNumPos, const T &unifiedMeanValue) const
Finds the sample standard deviation of the unified sequence, considering localnumPos positions starti...
T subScaleForKde(unsigned int initialPos, const T &iqrValue, unsigned int kdeDimension) const
Selects the scales (output value) for the kernel density estimation, considering only the sub-sequenc...
void unifiedWriteContents(const std::string &fileName, const std::string &fileType) const
Writes the unified sequence to a file.
std::vector< T >::const_iterator seqScalarPositionConstIteratorTypedef
T unifiedPopulationVariance(bool useOnlyInter0Comm, unsigned int initialPos, unsigned int numPos, const T &unifiedMeanValue) const
Finds the population variance of the unified sequence, considering numPos positions starting at posit...
T unifiedMeanCltStd(bool useOnlyInter0Comm, unsigned int initialPos, unsigned int localNumPos, const T &unifiedMeanValue) const
T unifiedMedianExtra(bool useOnlyInter0Comm, unsigned int initialPos, unsigned int localNumPos) const
Finds the median value of the unified sequence, considering numPos positions starting at position ini...
void subHistogram(unsigned int initialPos, const T &minHorizontalValue, const T &maxHorizontalValue, std::vector< T > &centers, std::vector< unsigned int > &bins) const
Calculates the histogram of the sub-sequence.
void autoCorrViaFft(unsigned int initialPos, unsigned int numPos, unsigned int maxLag, std::vector< T > &autoCorrs) const
Calculates the autocorrelation via Fast Fourier transforms (FFT).
void subBasicHistogram(unsigned int initialPos, const T &minHorizontalValue, const T &maxHorizontalValue, UniformOneDGrid< T > *&gridValues, std::vector< unsigned int > &bins) const
Calculates the histogram of the sub-sequence.
void extractScalarSeq(unsigned int initialPos, unsigned int spacing, unsigned int numPos, ScalarSequence< T > &scalarSeq) const
Extracts a sequence of scalars.
void setGaussian(const T &mean, const T &stdDev)
Sets the values of the sequence as a Gaussian distribution of mean given by meanVec and standard devi...
std::vector< T > & rawData()
The sequence of scalars. Access to private attribute m_seq.
void psd(unsigned int initialPos, unsigned int numBlocks, double hopSizeRatio, std::vector< double > &psdSequence) const
T unifiedPositionsOfMaximum(const ScalarSequence< T > &subCorrespondingScalarValues, ScalarSequence< T > &unifiedPositionsOfMaximum)
Finds the positions where the maximum element occurs in the unified sequence.
void subCdfStacc(unsigned int initialPos, std::vector< double > &cdfStaccValues, std::vector< double > &cdfStaccValuesup, std::vector< double > &cdfStaccValueslow, const ScalarSequence< T > &sortedDataValues) const
void unifiedSort(bool useOnlyInter0Comm, unsigned int initialPos, ScalarSequence< T > &unifiedSortedSequence) const
Sorts the unified sequence of scalars.
void setUniform(const T &a, const T &b)
Sets the values of the sequence as a uniform distribution between the values given by vectors aVec an...
void subUniformlySampledMdf(unsigned int numIntervals, T &minDomainValue, T &maxDomainValue, std::vector< T > &mdfValues) const
void subSort()
Sorts the sequence of scalars in the private attribute m_seq.
std::vector< T >::iterator seqScalarPositionIteratorTypedef
void writeSubMatlabHeader(std::ofstream &ofs, double sequenceSize) const
Helper function to write header info for matlab files from one chain.
T subPopulationVariance(unsigned int initialPos, unsigned int numPos, const T &meanValue) const
Finds the population variance of the sub-sequence, considering numPos positions starting at position ...
void clear()
Clears the sequence of scalars.
void ComputeUnifiedGaussian2dKde(bool useOnlyInter0Comm, const ScalarSequence< T > &scalarSeq1, const ScalarSequence< T > &scalarSeq2, unsigned int initialPos, double unifiedScaleValue1, double unifiedScaleValue2, const std::vector< T > &unifiedEvaluationPositions1, const std::vector< T > &unifiedEvaluationPositions2, std::vector< double > &unifiedDensityValues)
void deleteStoredScalars()
Deletes all stored scalars.
void writeTxtHeader(std::ofstream &ofs, double sequenceSize) const
Helper function to write txt info for matlab files.
void unifiedHistogram(bool useOnlyInter0Comm, unsigned int initialPos, const T &unifiedMinHorizontalValue, const T &unifiedMaxHorizontalValue, std::vector< T > &unifiedCenters, std::vector< unsigned int > &unifiedBins) const
Calculates the histogram of the unified sequence.
const T & operator[](unsigned int posId) const
Access position posId of the sequence of scalars (const).
const T & subSampleVariancePlain() const
Finds the variance of a sample of the sub-sequence of scalars.
Class for handling scalar samples.
void subMinMaxExtra(unsigned int initialPos, unsigned int numPos, T &minValue, T &maxValue) const
Finds the minimum and the maximum values of the sub-sequence, considering numPos positions starting a...
std::vector< T > m_seq
void resetValues(unsigned int initialPos, unsigned int)
Sets numPos values of the sequence to zero, starting at position initialPos.
void subWeightHistogram(unsigned int initialPos, const T &minHorizontalValue, const T &maxHorizontalValue, UniformOneDGrid< T > *&gridValues, std::vector< unsigned int > &bins) const
Calculates the weighted histogram of the sub-sequence.
void filter(unsigned int initialPos, unsigned int spacing)
Filters positions in the sequence of vectors.
void extractRawData(unsigned int initialPos, unsigned int spacing, unsigned int numPos, std::vector< double > &rawData) const
Extracts the raw data.
const BaseEnvironment & m_env
T autoCovariance(unsigned int initialPos, unsigned int numPos, const T &meanValue, unsigned int lag) const
Calculates the autocovariance.
void ComputeCovCorrBetweenScalarSequences(const ScalarSequence< T > &subPSeq, const ScalarSequence< T > &subQSeq, unsigned int subNumSamples, T &covValue, T &corrValue)
void unifiedMinMaxExtra(bool useOnlyInter0Comm, unsigned int initialPos, unsigned int numPos, T &unifiedMinValue, T &unifiedMaxValue) const
Finds the minimum and the maximum values of the unified sequence, considering numPos positions starti...
T unifiedInterQuantileRange(bool useOnlyInter0Comm, unsigned int initialPos) const
Returns the interquartile range of the values in the unified sequence.
T bmm(unsigned int initialPos, unsigned int batchLength) const
void subWeightCdf(unsigned int numIntervals, std::vector< T > &gridValues, std::vector< T > &cdfValues) const
Finds the Weighted Cumulative Distribution Function (CDF) of the sub-sequence of scalars.
void subGaussian1dKde(unsigned int initialPos, double scaleValue, const std::vector< T > &evaluationPositions, std::vector< double > &densityValues) const
Gaussian kernel for the KDE estimate of the sub-sequence.
void unifiedUniformlySampledCdf(bool useOnlyInter0Comm, unsigned int numIntervals, T &unifiedMinDomainValue, T &unifiedMaxDomainValue, std::vector< T > &unifiedCdfValues) const
Uniformly samples from the CDF from the unified sequence.
const T & unifiedSampleVariancePlain(bool useOnlyInter0Comm) const
Finds the variance of a sample of the unified sequence of scalars.
T subMeanCltStd(unsigned int initialPos, unsigned int numPos, const T &meanValue) const
const T & unifiedMaxPlain(bool useOnlyInter0Comm) const
Finds the maximum value of the unified sequence of scalars.
void ComputeSubGaussian2dKde(const ScalarSequence< T > &scalarSeq1, const ScalarSequence< T > &scalarSeq2, unsigned int initialPos, double scaleValue1, double scaleValue2, const std::vector< T > &evaluationPositions1, const std::vector< T > &evaluationPositions2, std::vector< double > &densityValues)
void parallelMerge(std::vector< T > &sortedBuffer, const std::vector< T > &leafData, unsigned int treeLevel) const
Sorts/merges data in parallel using MPI.
T subMedianExtra(unsigned int initialPos, unsigned int numPos) const
Finds the median value of the sub-sequence, considering numPos positions starting at position initial...
void append(const ScalarSequence< T > &src, unsigned int srcInitialPos, unsigned int srcNumPos)
Appends the scalar sequence src to this sequence.
T meanStacc(unsigned int initialPos) const
Class for accommodating uniform one-dimensional grids.
T autoCorrViaDef(unsigned int initialPos, unsigned int numPos, unsigned int lag) const
Calculates the autocorrelation via definition.
const T & subMedianPlain() const
Finds the median value of the sub-sequence of scalars.
T subSampleStd(unsigned int initialPos, unsigned int numPos, const T &meanValue) const
Finds the sample standard deviation of the unified sequence, considering numPos positions starting at...
void subWriteContents(unsigned int initialPos, unsigned int numPos, const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds) const
Writes the sub-sequence to a file.
void subCdfPercentageRange(unsigned int initialPos, unsigned int numPos, double range, T &lowerValue, T &upperValue) const
void setName(const std::string &newName)
Sets a new name to the sequence of scalars.
const BaseEnvironment & env() const
Access to QUESO environment.
void getUnifiedContentsAtProc0Only(bool useOnlyInter0Comm, std::vector< T > &outputVec) const
Gets the unified contents of processor of rank equals to 0.
void subUniformlySampledCdf(unsigned int numIntervals, T &minDomainValue, T &maxDomainValue, std::vector< T > &cdfValues) const
Uniformly samples from the CDF from the sub-sequence.
void copy(const ScalarSequence< T > &src)
Copies the scalar sequence src to this.
void subBasicCdf(unsigned int numIntervals, UniformOneDGrid< T > *&gridValues, std::vector< T > &cdfValues) const
Finds the Cumulative Distribution Function (CDF) of the sub-sequence of scalars.
const T & unifiedMedianPlain(bool useOnlyInter0Comm) const
Finds the median value of the unified sequence of scalars.
T geweke(unsigned int initialPos, double ratioNa, double ratioNb) const
void unifiedReadContents(const std::string &fileName, const std::string &fileType, const unsigned int subSequenceSize)
Reads the unified sequence from a file.
T subPositionsOfMaximum(const ScalarSequence< T > &subCorrespondingScalarValues, ScalarSequence< T > &subPositionsOfMaximum)
Finds the positions where the maximum element occurs in the sub-sequence.
unsigned int subSequenceSize() const
Size of the sub-sequence of scalars.
T subSampleVarianceExtra(unsigned int initialPos, unsigned int numPos, const T &meanValue) const
Finds the sample variance of the sub-sequence, considering numPos positions starting at position init...
const std::string & name() const
Access to the name of the sequence of scalars.

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