queso-0.57.1
|
Class for handling array samples (arrays of scalar sequences). More...
#include <ArrayOfSequences.h>
Public Member Functions | |
Constructor/Destructor methods | |
ArrayOfSequences (const VectorSpace< V, M > &vectorSpace, unsigned int subSequenceSize, const std::string &name) | |
Default constructor. More... | |
~ArrayOfSequences () | |
Destructor. More... | |
Sequence methods | |
unsigned int | subSequenceSize () const |
Size of the sub-sequence of arrays. More... | |
void | resizeSequence (unsigned int newSubSequenceSize) |
Resizes the sequence. More... | |
void | resetValues (unsigned int initialPos, unsigned int numPos) |
Resets a total of numPos values of the sequence starting at position initialPos . More... | |
void | erasePositions (unsigned int initialPos, unsigned int numPos) |
Erases numPos elements of the sequence starting at position initialPos . More... | |
void | getPositionValues (unsigned int posId, V &vec) const |
Gets the values of the sequence at position posId and stores them at vec . More... | |
void | setPositionValues (unsigned int posId, const V &vec) |
Set the values of vec at position posId of the sequence. More... | |
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 deviation by stdDevVec . More... | |
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 and bVec . More... | |
void | mean (unsigned int initialPos, unsigned int numPos, V &meanVec) const |
Finds the mean value of the sub-sequence, considering numPos positions starting at position initialPos . More... | |
void | unifiedMean (unsigned int initialPos, unsigned int numPos, V &unifiedMeanVec) const |
Finds the mean value of the unified sequence of numPos positions starting at position initialPos . See template specialization. More... | |
void | sampleVariance (unsigned int initialPos, unsigned int numPos, const V &meanVec, V &samVec) const |
Finds the sample variance of the sub-sequence, considering numPos positions starting at position initialPos and of mean meanVec . More... | |
void | unifiedSampleVariance (unsigned int initialPos, unsigned int numPos, const V &meanVec, V &samVec) const |
Finds the sample variance of the unified sequence, considering numPos positions starting at position initialPos and of mean meanVec . More... | |
void | populationVariance (unsigned int initialPos, unsigned int numPos, const V &meanVec, V &popVec) const |
Finds the population variance of the sub-sequence, considering numPos positions starting at position initialPos and of mean meanVec . More... | |
void | autoCovariance (unsigned int initialPos, unsigned int numPos, const V &meanVec, unsigned int lag, V &covVec) const |
Calculates the autocovariance. More... | |
void | autoCorrViaDef (unsigned int initialPos, unsigned int numPos, unsigned int lag, V &corrVec) const |
Calculates autocorrelation via definition. More... | |
void | autoCorrViaFft (unsigned int initialPos, unsigned int numPos, const std::vector< unsigned int > &lags, std::vector< V * > &corrVecs) const |
void | autoCorrViaFft (unsigned int initialPos, unsigned int numPos, unsigned int numSum, V &autoCorrsSumVec) const |
void | minMax (unsigned int initialPos, V &minVec, V &maxVec) const |
Given an initial position initialPos , finds the minimum and the maximum values of the sequence. More... | |
void | histogram (unsigned int initialPos, const V &minVec, const V &maxVec, std::vector< V * > ¢ersForAllBins, std::vector< V * > &quanttsForAllBins) const |
Calculates the histogram of the sequence. More... | |
void | interQuantileRange (unsigned int initialPos, V &iqrs) const |
Returns the interquartile range of the values in the sequence. More... | |
void | scalesForKDE (unsigned int initialPos, const V &iqrs, unsigned int kdeDimension, V &scales) const |
Selects the scales (bandwidth, scaleVec ) for the kernel density estimation, of the sequence. More... | |
void | gaussianKDE (const V &evaluationParamVec, V &densityVec) const |
Gaussian kernel for the KDE estimate of the sequence. More... | |
void | gaussianKDE (unsigned int initialPos, const V &scales, const std::vector< V * > &evaluationParamVecs, std::vector< V * > &densityVecs) const |
TODO: Gaussian kernel for the KDE of the sequence. More... | |
void | writeContents (std::ofstream &ofsvar) const |
Write contents of the chain to a file. More... | |
void | unifiedWriteContents (std::ofstream &ofsvar) const |
Writes info of the unified sequence to a file. More... | |
void | unifiedWriteContents (const std::string &fileName, const std::string &fileType) const |
Writes info of the unified sequence to a file. More... | |
void | unifiedReadContents (const std::string &fileName, const std::string &fileType, const unsigned int subSequenceSize) |
Reads the unified sequence from a file. More... | |
void | select (const std::vector< unsigned int > &idsOfUniquePositions) |
Select positions in the sequence of vectors. More... | |
void | filter (unsigned int initialPos, unsigned int spacing) |
Filters positions in the sequence of vectors, starting at initialPos , and with spacing given by spacing . More... | |
void | extractScalarSeq (unsigned int initialPos, unsigned int spacing, unsigned int numPos, unsigned int paramId, ScalarSequence< double > &scalarSeq) const |
Extracts a sequence of scalars of size numPos , from position paramId of the array of sequences. More... | |
void | uniformlySampledMdf (const V &numEvaluationPointsVec, ArrayOfOneDGrids< V, M > &mdfGrids, ArrayOfOneDTables< V, M > &mdfValues) const |
void | uniformlySampledCdf (const V &numEvaluationPointsVec, ArrayOfOneDGrids< V, M > &cdfGrids, ArrayOfOneDTables< V, M > &cdfValues) const |
void | bmm (unsigned int initialPos, unsigned int batchLength, V &bmmVec) const |
void | fftForward (unsigned int initialPos, unsigned int fftSize, unsigned int paramId, std::vector< std::complex< double > > &resultData) const |
void | psd (unsigned int initialPos, unsigned int numBlocks, double hopSizeRatio, unsigned int paramId, std::vector< double > &psdResult) const |
void | psdAtZero (unsigned int initialPos, unsigned int numBlocks, double hopSizeRatio, V &psdVec) const |
void | geweke (unsigned int initialPos, double ratioNa, double ratioNb, V &gewVec) const |
Public Member Functions inherited from QUESO::BaseVectorSequence< V, M > | |
BaseVectorSequence (const VectorSpace< V, M > &vectorSpace, unsigned int subSequenceSize, const std::string &name) | |
Default constructor. More... | |
virtual | ~BaseVectorSequence () |
Destructor. More... | |
unsigned int | unifiedSequenceSize () const |
Calculates the size of the unified sequence of vectors. More... | |
unsigned int | vectorSizeLocal () const |
Local dimension (size) of the vector space. More... | |
unsigned int | vectorSizeGlobal () const |
Global dimension (size) of the vector space. More... | |
const VectorSpace< V, M > & | vectorSpace () const |
Vector space; access to protected attribute VectorSpace<V,M>& m_vectorSpace. More... | |
const std::string & | name () const |
Access to protected attribute m_name: name of the sequence of vectors. More... | |
void | setName (const std::string &newName) |
Changes the name of the sequence of vectors. More... | |
void | clear () |
Reset the values and the size of the sequence of vectors. More... | |
const V & | subMinPlain () const |
Finds the minimum value of the sub-sequence. More... | |
const V & | unifiedMinPlain () const |
Finds the minimum value of the unified sequence. More... | |
const V & | subMaxPlain () const |
Finds the maximum value of the sub-sequence. More... | |
const V & | unifiedMaxPlain () const |
Finds the maximum value of the unified sequence. More... | |
const V & | subMeanPlain () const |
Finds the mean value of the sub-sequence. More... | |
const V & | unifiedMeanPlain () const |
Finds the mean value of the unified sequence. More... | |
const V & | subMedianPlain () const |
Finds the median value of the sub-sequence. More... | |
const V & | unifiedMedianPlain () const |
Finds the median value of the unified sequence. More... | |
const V & | subSampleVariancePlain () const |
Finds the variance of a sample of the sub-sequence. More... | |
const V & | unifiedSampleVariancePlain () const |
Finds the variance of a sample of the unified sequence. More... | |
const BoxSubset< V, M > & | subBoxPlain () const |
Finds a box subset of the sub-sequence (given by its min and max values calculated via subMinPlain and subMaxPlain). More... | |
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 calculated via unifiedMinPlain and unifiedMaxPlain). More... | |
void | deleteStoredVectors () |
Deletes all the stored vectors. More... | |
void | append (const BaseVectorSequence< V, M > &src, unsigned int initialPos, unsigned int numPos) |
Appends the vector src to this vector. More... | |
double | subPositionsOfMaximum (const ScalarSequence< double > &subCorrespondingScalarValues, BaseVectorSequence< V, M > &subPositionsOfMaximum) |
Finds the positions where the maximum element occurs in the sub-sequence. More... | |
double | unifiedPositionsOfMaximum (const ScalarSequence< double > &subCorrespondingScalarValues, BaseVectorSequence< V, M > &unifiedPositionsOfMaximum) |
Finds the positions where the maximum element occurs in the unified sequence. More... | |
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 deviation by stdDevVec . More... | |
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 and bVec . More... | |
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 initialPos . See template specialization. More... | |
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 . See template specialization. More... | |
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 initialPos . See template specialization. More... | |
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 initialPos . See template specialization. More... | |
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 initialPos and of mean meanVec . See template specialization. More... | |
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 initialPos and of mean meanVec . See template specialization. More... | |
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 initialPos and of mean meanVec . See template specialization. More... | |
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 position initialPos and of mean meanVec . See template specialization. More... | |
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 at position initialPos . See template specialization. More... | |
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 starting at position initialPos . See template specialization. More... | |
virtual void | subHistogram (unsigned int initialPos, const V &minVec, const V &maxVec, std::vector< V * > ¢ersForAllBins, std::vector< V * > &quanttsForAllBins) const =0 |
Calculates the histogram of the sub-sequence. See template specialization. More... | |
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. More... | |
virtual void | subInterQuantileRange (unsigned int initialPos, V &iqrVec) const =0 |
Returns the interquartile range of the values in the sub-sequence. See template specialization. More... | |
virtual void | unifiedInterQuantileRange (unsigned int initialPos, V &unifiedIqrVec) const =0 |
Returns the interquartile range of the values in the unified sequence. See template specialization. More... | |
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-sequence. See template specialization. More... | |
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. See template specialization. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual void | subWriteContents (unsigned int initialPos, unsigned int numPos, std::ofstream &ofsvar, const std::string &fileType) const =0 |
Writes info of the sub-sequence to a file. See template specialization. More... | |
void | computeFilterParams (std::ofstream *passedOfs, unsigned int &initialPos, unsigned int &spacing) |
Computes the filtering parameters spacing for the sequence of vectors. More... | |
virtual double | estimateConvBrooksGelman (unsigned int initialPos, unsigned int numPos) const =0 |
Estimates convergence rate using Brooks & Gelman method. See template specialization. More... | |
virtual void | subUniformlySampledCdf (const V &numEvaluationPointsVec, ArrayOfOneDGrids< V, M > &cdfGrids, ArrayOfOneDTables< V, M > &cdfValues) const =0 |
virtual void | unifiedUniformlySampledCdf (const V &numEvaluationPointsVec, ArrayOfOneDGrids< V, M > &unifiedCdfGrids, ArrayOfOneDTables< V, M > &unifieddfValues) const =0 |
virtual void | meanStacc (unsigned int initialPos, V &meanStaccVec) const =0 |
virtual void | subCdfStacc (unsigned int initialPos, const std::vector< V * > &evalPositionsVecs, std::vector< V * > &cdfStaccVecs) const =0 |
void | computeHistCdfstaccKde (const SequenceStatisticalOptions &statisticalOptions, std::ofstream *passedOfs) |
void | computeStatistics (const SequenceStatisticalOptions &statisticalOptions, std::ofstream *passedOfs) |
void | computeHistCdfstaccKde (const SsOptionsValues &statisticalOptions, std::ofstream *passedOfs) |
void | computeStatistics (const SsOptionsValues &statisticalOptions, std::ofstream *passedOfs) |
virtual void | subUniformlySampledMdf (const V &numEvaluationPointsVec, ArrayOfOneDGrids< V, M > &mdfGrids, ArrayOfOneDTables< V, M > &mdfValues) const =0 |
Private Member Functions | |
void | extractRawData (unsigned int initialPos, unsigned int spacing, unsigned int numPos, unsigned int paramId, std::vector< double > &rawData) const |
Extracts the raw data. More... | |
Private Attributes | |
DistArray< ScalarSequence < double > * > | m_scalarSequences |
Sequence of scalars. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from QUESO::BaseVectorSequence< V, M > | |
void | copy (const BaseVectorSequence< V, M > &src) |
Copies vector sequence src to this . More... | |
virtual void | subMeanMonitorAlloc (unsigned int numberOfMonitorPositions)=0 |
virtual void | subMeanInter0MonitorAlloc (unsigned int numberOfMonitorPositions)=0 |
virtual void | unifiedMeanMonitorAlloc (unsigned int numberOfMonitorPositions)=0 |
virtual void | subMeanMonitorRun (unsigned int monitorPosition, V &subMeanVec, V &subMeanCltStd)=0 |
virtual void | subMeanInter0MonitorRun (unsigned int monitorPosition, V &subMeanInter0Mean, V &subMeanInter0Clt95, V &subMeanInter0Empirical90, V &subMeanInter0Min, V &subMeanInter0Max)=0 |
virtual void | unifiedMeanMonitorRun (unsigned int monitorPosition, V &unifiedMeanVec, V &unifiedMeanCltStd)=0 |
virtual void | subMeanMonitorStore (unsigned int i, unsigned int monitorPosition, const V &subMeanVec, const V &subMeanCltStd)=0 |
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 |
virtual void | unifiedMeanMonitorStore (unsigned int i, unsigned int monitorPosition, V &unifiedMeanVec, V &unifiedMeanCltStd)=0 |
virtual void | subMeanMonitorWrite (std::ofstream &ofs)=0 |
virtual void | subMeanInter0MonitorWrite (std::ofstream &ofs)=0 |
virtual void | unifiedMeanMonitorWrite (std::ofstream &ofs)=0 |
virtual void | subMeanMonitorFree ()=0 |
virtual void | subMeanInter0MonitorFree ()=0 |
virtual void | unifiedMeanMonitorFree ()=0 |
void | computeMeanEvolution (const SequenceStatisticalOptions &statisticalOptions, std::ofstream *passedOfs) |
void | computeMeanEvolution (const SsOptionsValues &statisticalOptions, std::ofstream *passedOfs) |
void | computeBMM (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) |
void | computePSD (const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs) |
void | computePSDAtZero (const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs) |
void | computeGeweke (const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs) |
void | computeMeanStacc (const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs) |
void | computeBMM (const SsOptionsValues &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs) |
void | computeFFT (const SsOptionsValues &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs) |
void | computePSD (const SsOptionsValues &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs) |
void | computePSDAtZero (const SsOptionsValues &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs) |
void | computeGeweke (const SsOptionsValues &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs) |
void | computeMeanStacc (const SsOptionsValues &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, std::ofstream *passedOfs) |
void | computeMeanVars (const SequenceStatisticalOptions &statisticalOptions, std::ofstream *passedOfs, V *subMeanPtr, V *subMedianPtr, V *subSampleVarPtr, V *subPopulVarPtr) |
void | computeAutoCorrViaDef (const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, const std::vector< unsigned int > &lagsForCorrs, std::ofstream *passedOfs) |
void | computeAutoCorrViaFFT (const SequenceStatisticalOptions &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, const std::vector< unsigned int > &lagsForCorrs, std::ofstream *passedOfs) |
void | computeCovCorrMatrices (const SequenceStatisticalOptions &statisticalOptions, std::ofstream *passedOfs) |
void | computeMeanVars (const SsOptionsValues &statisticalOptions, std::ofstream *passedOfs, V *subMeanPtr, V *subMedianPtr, V *subSampleVarPtr, V *subPopulVarPtr) |
void | computeAutoCorrViaDef (const SsOptionsValues &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, const std::vector< unsigned int > &lagsForCorrs, std::ofstream *passedOfs) |
void | computeAutoCorrViaFFT (const SsOptionsValues &statisticalOptions, const std::vector< unsigned int > &initialPosForStatistics, const std::vector< unsigned int > &lagsForCorrs, std::ofstream *passedOfs) |
void | computeCovCorrMatrices (const SsOptionsValues &statisticalOptions, std::ofstream *passedOfs) |
Protected Attributes inherited from QUESO::BaseVectorSequence< V, M > | |
const BaseEnvironment & | m_env |
const VectorSpace< V, M > & | m_vectorSpace |
std::string | m_name |
Fft< double > * | m_fftObj |
V * | m_subMinPlain |
V * | m_unifiedMinPlain |
V * | m_subMaxPlain |
V * | m_unifiedMaxPlain |
V * | m_subMeanPlain |
V * | m_unifiedMeanPlain |
V * | m_subMedianPlain |
V * | m_unifiedMedianPlain |
V * | m_subSampleVariancePlain |
V * | m_unifiedSampleVariancePlain |
BoxSubset< V, M > * | m_subBoxPlain |
BoxSubset< V, M > * | m_unifiedBoxPlain |
Class for handling array samples (arrays of scalar sequences).
This class handles array of sequences (samples) generated by an algorithm, as well as operations that can be carried over them, e.g., calculation of means, correlation and covariance matrices. It is derived from and implements BaseVectorSequence<V,M>.
Definition at line 47 of file ArrayOfSequences.h.
QUESO::ArrayOfSequences< V, M >::ArrayOfSequences | ( | const VectorSpace< V, M > & | vectorSpace, |
unsigned int | subSequenceSize, | ||
const std::string & | name | ||
) |
Default constructor.
Definition at line 32 of file ArrayOfSequences.C.
References QUESO::BaseVectorSequence< V, M >::m_env, QUESO::ArrayOfSequences< V, M >::m_scalarSequences, and QUESO::ArrayOfSequences< V, M >::subSequenceSize().
QUESO::ArrayOfSequences< V, M >::~ArrayOfSequences | ( | ) |
Destructor.
Definition at line 63 of file ArrayOfSequences.C.
|
virtual |
Calculates autocorrelation via definition.
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 310 of file ArrayOfSequences.C.
|
virtual |
Calculates autocorrelation via Fast Fourier transforms (FFT). TODO: Implement me!
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 338 of file ArrayOfSequences.C.
|
virtual |
Calculates autocorrelation via Fast Fourier transforms (FFT). TODO: Implement me!
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 347 of file ArrayOfSequences.C.
References QUESO::ScalarSequence< T >::autoCorrViaFft().
|
virtual |
Calculates the autocovariance.
The autocovariance is the covariance of a variable with itself at some other time. It is calculated over a sequence of arrays with initial position initialPos
, considering numPos
positions, a lag of lag
, with mean given by meanVec
. The results are saved in the output vector covVec/
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 268 of file ArrayOfSequences.C.
References QUESO::ArrayOfSequences< V, M >::m_scalarSequences.
|
virtual |
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 678 of file ArrayOfSequences.C.
|
virtual |
Erases numPos
elements of the sequence starting at position initialPos
.
This routine deletes all stored computed vectors
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 106 of file ArrayOfSequences.C.
References QUESO::BaseVectorSequence< V, M >::deleteStoredVectors(), and QUESO::ScalarSequence< T >::erasePositions().
|
privatevirtual |
Extracts the raw data.
Extracts the data from sequence of array at position paramId
, with spacing spacing
, and saves is in rawData
. The vector rawData
will have size numPos
. Note that, in fact, spacing
= 1.
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 622 of file ArrayOfSequences.C.
References QUESO::ArrayOfSequences< V, M >::m_scalarSequences.
|
virtual |
Extracts a sequence of scalars of size numPos
, from position paramId
of the array of sequences.
In this method, the parameter initialPos
is unused and the parameter spacing
is always equal to one
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 596 of file ArrayOfSequences.C.
References QUESO::ArrayOfSequences< V, M >::m_scalarSequences, and QUESO::ScalarSequence< T >::resizeSequence().
|
virtual |
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 739 of file ArrayOfSequences.C.
|
virtual |
Filters positions in the sequence of vectors, starting at initialPos
, and with spacing given by spacing
.
TODO: implement me!
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 589 of file ArrayOfSequences.C.
void QUESO::ArrayOfSequences< V, M >::gaussianKDE | ( | const V & | evaluationParamVec, |
V & | densityVec | ||
) | const |
Gaussian kernel for the KDE estimate of the sequence.
TODO: implement me!
Definition at line 497 of file ArrayOfSequences.C.
void QUESO::ArrayOfSequences< V, M >::gaussianKDE | ( | unsigned int | initialPos, |
const V & | scales, | ||
const std::vector< V * > & | evaluationParamVecs, | ||
std::vector< V * > & | densityVecs | ||
) | const |
TODO: Gaussian kernel for the KDE of the sequence.
\[ \hat{f}(x) = \frac{1}{nh} \sum_{j=1}^n K\Big(\frac{x-x_j}{h}\Big),\]
where \( K \) is a Gaussian kernel.Definition at line 504 of file ArrayOfSequences.C.
References QUESO::MiscGaussianDensity().
|
virtual |
Gets the values of the sequence at position posId
and stores them at vec
.
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 122 of file ArrayOfSequences.C.
References QUESO::ArrayOfSequences< V, M >::m_scalarSequences.
|
virtual |
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 791 of file ArrayOfSequences.C.
References QUESO::ScalarSequence< T >::psd().
void QUESO::ArrayOfSequences< V, M >::histogram | ( | unsigned int | initialPos, |
const V & | minVec, | ||
const V & | maxVec, | ||
std::vector< V * > & | centersForAllBins, | ||
std::vector< V * > & | quanttsForAllBins | ||
) | const |
Calculates the histogram of the sequence.
TODO: implement me!
Definition at line 393 of file ArrayOfSequences.C.
References QUESO::queso_require_equal_to_msg.
void QUESO::ArrayOfSequences< V, M >::interQuantileRange | ( | unsigned int | initialPos, |
V & | iqrs | ||
) | const |
Returns the interquartile range of the values in the sequence.
TODO: implement me!
Definition at line 433 of file ArrayOfSequences.C.
void QUESO::ArrayOfSequences< V, M >::mean | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
V & | meanVec | ||
) | const |
Finds the mean value of the sub-sequence, considering numPos
positions starting at position initialPos
.
Definition at line 172 of file ArrayOfSequences.C.
References QUESO::ArrayOfSequences< V, M >::m_scalarSequences, and QUESO::ScalarSequence< T >::subMeanExtra().
void QUESO::ArrayOfSequences< V, M >::minMax | ( | unsigned int | initialPos, |
V & | minVec, | ||
V & | maxVec | ||
) | const |
Given an initial position initialPos
, finds the minimum and the maximum values of the sequence.
Definition at line 378 of file ArrayOfSequences.C.
References QUESO::ArrayOfSequences< V, M >::m_scalarSequences, and QUESO::ScalarSequence< T >::subMinMaxExtra().
void QUESO::ArrayOfSequences< V, M >::populationVariance | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
const V & | meanVec, | ||
V & | popVec | ||
) | const |
Finds the population variance of the sub-sequence, considering numPos
positions starting at position initialPos
and of mean meanVec
.
Definition at line 231 of file ArrayOfSequences.C.
References QUESO::ArrayOfSequences< V, M >::m_scalarSequences.
|
virtual |
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 748 of file ArrayOfSequences.C.
|
virtual |
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 758 of file ArrayOfSequences.C.
References QUESO::ScalarSequence< T >::psd().
|
virtual |
Resets a total of numPos
values of the sequence starting at position initialPos
.
This routine deletes all stored computed vectors
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 93 of file ArrayOfSequences.C.
References QUESO::BaseVectorSequence< V, M >::deleteStoredVectors().
|
virtual |
Resizes the sequence.
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 80 of file ArrayOfSequences.C.
References QUESO::BaseVectorSequence< V, M >::deleteStoredVectors().
void QUESO::ArrayOfSequences< V, M >::sampleVariance | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
const V & | meanVec, | ||
V & | samVec | ||
) | const |
Finds the sample variance of the sub-sequence, considering numPos
positions starting at position initialPos
and of mean meanVec
.
Definition at line 194 of file ArrayOfSequences.C.
References QUESO::ArrayOfSequences< V, M >::m_scalarSequences.
void QUESO::ArrayOfSequences< V, M >::scalesForKDE | ( | unsigned int | initialPos, |
const V & | iqrs, | ||
unsigned int | kdeDimension, | ||
V & | scales | ||
) | const |
Selects the scales (bandwidth, scaleVec
) for the kernel density estimation, of the sequence.
TODO: implement me!
Definition at line 461 of file ArrayOfSequences.C.
|
virtual |
Select positions in the sequence of vectors.
TODO: implement me!
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 582 of file ArrayOfSequences.C.
void QUESO::ArrayOfSequences< V, M >::setGaussian | ( | const V & | meanVec, |
const V & | stdDevVec | ||
) |
Sets the values of the sequence as a Gaussian distribution of mean given by meanVec
and standard deviation by stdDevVec
.
This routine deletes all stored computed vectors
Definition at line 146 of file ArrayOfSequences.C.
References QUESO::BaseVectorSequence< V, M >::deleteStoredVectors(), and QUESO::ScalarSequence< T >::setGaussian().
|
virtual |
Set the values of vec
at position posId
of the sequence.
This routine deletes all stored computed vectors
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 133 of file ArrayOfSequences.C.
References QUESO::BaseVectorSequence< V, M >::deleteStoredVectors().
void QUESO::ArrayOfSequences< V, M >::setUniform | ( | const V & | aVec, |
const V & | bVec | ||
) |
Sets the values of the sequence as a uniform distribution between the values given by vectors aVec
and bVec
.
This routine deletes all stored computed vectors
Definition at line 159 of file ArrayOfSequences.C.
References QUESO::BaseVectorSequence< V, M >::deleteStoredVectors(), and QUESO::ScalarSequence< T >::setUniform().
|
virtual |
Size of the sub-sequence of arrays.
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 72 of file ArrayOfSequences.C.
References QUESO::ArrayOfSequences< V, M >::m_scalarSequences.
Referenced by QUESO::ArrayOfSequences< V, M >::ArrayOfSequences().
void QUESO::ArrayOfSequences< V, M >::unifiedMean | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
V & | unifiedMeanVec | ||
) | const |
Finds the mean value of the unified sequence of numPos
positions starting at position initialPos
. See template specialization.
|
virtual |
Reads the unified sequence from a file.
TODO: implement me!
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 573 of file ArrayOfSequences.C.
void QUESO::ArrayOfSequences< V, M >::unifiedSampleVariance | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
const V & | meanVec, | ||
V & | samVec | ||
) | const |
Finds the sample variance of the unified sequence, considering numPos
positions starting at position initialPos
and of mean meanVec
.
void QUESO::ArrayOfSequences< V, M >::unifiedWriteContents | ( | std::ofstream & | ofsvar | ) | const |
Writes info of the unified sequence to a file.
TODO: implement me!
Definition at line 558 of file ArrayOfSequences.C.
|
virtual |
Writes info of the unified sequence to a file.
TODO: implement me!
Implements QUESO::BaseVectorSequence< V, M >.
Definition at line 565 of file ArrayOfSequences.C.
void QUESO::ArrayOfSequences< V, M >::uniformlySampledCdf | ( | const V & | numEvaluationPointsVec, |
ArrayOfOneDGrids< V, M > & | cdfGrids, | ||
ArrayOfOneDTables< V, M > & | cdfValues | ||
) | const |
Definition at line 649 of file ArrayOfSequences.C.
References QUESO::ArrayOfSequences< V, M >::m_scalarSequences, QUESO::ArrayOfOneDTables< V, M >::setOneDTable(), QUESO::ArrayOfOneDGrids< V, M >::setUniformGrids(), and QUESO::ScalarSequence< T >::subUniformlySampledCdf().
void QUESO::ArrayOfSequences< V, M >::uniformlySampledMdf | ( | const V & | numEvaluationPointsVec, |
ArrayOfOneDGrids< V, M > & | mdfGrids, | ||
ArrayOfOneDTables< V, M > & | mdfValues | ||
) | const |
void QUESO::ArrayOfSequences< V, M >::writeContents | ( | std::ofstream & | ofsvar | ) | const |
Write contents of the chain to a file.
Definition at line 536 of file ArrayOfSequences.C.
|
private |
Sequence of scalars.
Definition at line 264 of file ArrayOfSequences.h.
Referenced by QUESO::ArrayOfSequences< V, M >::ArrayOfSequences(), QUESO::ArrayOfSequences< V, M >::autoCovariance(), QUESO::ArrayOfSequences< V, M >::extractRawData(), QUESO::ArrayOfSequences< V, M >::extractScalarSeq(), QUESO::ArrayOfSequences< V, M >::getPositionValues(), QUESO::ArrayOfSequences< V, M >::mean(), QUESO::ArrayOfSequences< V, M >::minMax(), QUESO::ArrayOfSequences< V, M >::populationVariance(), QUESO::ArrayOfSequences< V, M >::sampleVariance(), QUESO::ArrayOfSequences< V, M >::subSequenceSize(), and QUESO::ArrayOfSequences< V, M >::uniformlySampledCdf().