queso-0.53.0
|
Base class for handling vector and array samples (sequence of vectors or arrays). More...
#include <VectorSequence.h>
Public Member Functions | |
Constructor/Destructor methods | |
BaseVectorSequence (const VectorSpace< V, M > &vectorSpace, unsigned int subSequenceSize, const std::string &name) | |
Default constructor. More... | |
virtual | ~BaseVectorSequence () |
Destructor. More... | |
Sequence methods | |
virtual unsigned int | subSequenceSize () const =0 |
Size of the sub-sequence of vectors. See template specialization. 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... | |
virtual void | resizeSequence (unsigned int newSubSequenceSize)=0 |
Resize the sequence. See template specialization. More... | |
virtual void | resetValues (unsigned int initialPos, unsigned int numPos)=0 |
Reset the values of the sequence. See template specialization. More... | |
virtual void | erasePositions (unsigned int initialPos, unsigned int numPos)=0 |
Erase numPos positions in the sequence, starting at position initialPos . More... | |
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. More... | |
virtual void | setPositionValues (unsigned int posId, const V &vec)=0 |
Set the values in vec at position posId of the sequence. See template specialization. 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 | autoCovariance (unsigned int initialPos, unsigned int numPos, const V &meanVec, unsigned int lag, V &covVec) const =0 |
Calculates the autocovariance. See template specialization. More... | |
virtual void | autoCorrViaDef (unsigned int initialPos, unsigned int numPos, unsigned int lag, V &corrVec) const =0 |
Calculates autocorrelation via definition. See template specialization. More... | |
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. More... | |
virtual void | autoCorrViaFft (unsigned int initialPos, unsigned int numPos, unsigned int numSum, V &autoCorrsSumVec) const =0 |
Calculates autocorrelation via Fast Fourier transforms (FFT). 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... | |
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. More... | |
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. More... | |
virtual void | select (const std::vector< unsigned int > &idsOfUniquePositions)=0 |
Select positions in the sequence of vectors. See template specialization. More... | |
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 spacing . 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 | 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 . See template specialization. More... | |
Protected Member Functions | |
void | copy (const BaseVectorSequence< V, M > &src) |
Copies vector sequence src to this . More... | |
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. More... | |
Protected Attributes | |
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 |
Base class for handling vector and array samples (sequence of vectors or arrays).
This class handles either vector or array samples generated by an algorithm, as well as operations that can be carried over them, e.g., calculation of means, correlation and covariance matrices.
Definition at line 56 of file VectorSequence.h.
QUESO::BaseVectorSequence< V, M >::BaseVectorSequence | ( | const VectorSpace< V, M > & | vectorSpace, |
unsigned int | subSequenceSize, | ||
const std::string & | name | ||
) |
Default constructor.
Definition at line 34 of file VectorSequence.C.
|
virtual |
Destructor.
Definition at line 60 of file VectorSequence.C.
void QUESO::BaseVectorSequence< V, M >::append | ( | const BaseVectorSequence< V, M > & | src, |
unsigned int | initialPos, | ||
unsigned int | numPos | ||
) |
Appends the vector src
to this
vector.
This routine deletes all stored computed vectors
Definition at line 354 of file VectorSequence.C.
References QUESO::BaseVectorSequence< V, M >::getPositionValues(), queso_require_greater_equal_msg, QUESO::BaseVectorSequence< V, M >::subSequenceSize(), and QUESO::BaseVectorSequence< V, M >::vectorSpace().
Referenced by QUESO::MLSampling< P_V, P_M >::generateBalLinkedChains_all(), and QUESO::MLSampling< P_V, P_M >::generateUnbLinkedChains_all().
|
pure virtual |
Calculates autocorrelation via definition. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, and QUESO::ArrayOfSequences< V, M >.
|
pure virtual |
Calculates autocorrelation via Fast Fourier transforms (FFT). See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, and QUESO::ArrayOfSequences< V, M >.
|
pure virtual |
Calculates autocorrelation via Fast Fourier transforms (FFT). See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, and QUESO::ArrayOfSequences< V, M >.
|
pure virtual |
Calculates the autocovariance. See template specialization.
The autocovariance is the covariance of a variable with itself at some other time. It is calculated over a sequence of vectors 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/
Implemented in QUESO::SequenceOfVectors< V, M >, and QUESO::ArrayOfSequences< V, M >.
void QUESO::BaseVectorSequence< V, M >::clear | ( | ) |
Reset the values and the size of the sequence of vectors.
Definition at line 133 of file VectorSequence.C.
Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence(), and QUESO::MLSampling< P_V, P_M >::generateSequence_Step02_inter0().
void QUESO::BaseVectorSequence< V, M >::computeFilterParams | ( | std::ofstream * | passedOfs, |
unsigned int & | initialPos, | ||
unsigned int & | spacing | ||
) |
Computes the filtering parameters spacing
for the sequence of vectors.
Definition at line 614 of file VectorSequence.C.
References queso_require_msg.
Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence(), and QUESO::MLSampling< P_V, P_M >::generateSequence_Step11_inter0().
|
protected |
Copies vector sequence src
to this
.
This routine deletes all stored computed vectors
Definition at line 651 of file VectorSequence.C.
References QUESO::BaseVectorSequence< V, M >::m_name, QUESO::BaseVectorSequence< V, M >::m_vectorSpace, and queso_require_equal_to_msg.
Referenced by QUESO::SequenceOfVectors< V, M >::copy().
void QUESO::BaseVectorSequence< V, M >::deleteStoredVectors | ( | ) |
Deletes all the stored vectors.
It deletes all stored vectors and assigns NULL value to the pointers: m_subMinPlain, m_unifiedMinPlain, m_subMaxPlain, m_unifiedMaxPlain, m_subMeanPlain, m_unifiedMeanPlain, m_subMedianPlain, m_unifiedMedianPlain, m_subBoxPlain, m_unifiedBoxPlain, m_subSampleVariancePlain, m_unifiedSampleVariancePlain.
Definition at line 298 of file VectorSequence.C.
Referenced by QUESO::ArrayOfSequences< V, M >::erasePositions(), QUESO::SequenceOfVectors< V, M >::erasePositions(), QUESO::ArrayOfSequences< V, M >::resetValues(), QUESO::SequenceOfVectors< V, M >::resetValues(), QUESO::ArrayOfSequences< V, M >::resizeSequence(), QUESO::SequenceOfVectors< V, M >::resizeSequence(), QUESO::ArrayOfSequences< V, M >::setGaussian(), QUESO::ArrayOfSequences< V, M >::setPositionValues(), QUESO::SequenceOfVectors< V, M >::setPositionValues(), and QUESO::ArrayOfSequences< V, M >::setUniform().
|
pure virtual |
Erase numPos
positions in the sequence, starting at position initialPos
.
This routine deletes all stored computed vectors
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, QUESO::SequenceOfVectors< Q_V, Q_M >, and QUESO::ArrayOfSequences< V, M >.
|
pure virtual |
Estimates convergence rate using Brooks & Gelman method. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, and QUESO::SequenceOfVectors< Q_V, Q_M >.
Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain().
|
protectedpure virtual |
Extracts the raw data. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, QUESO::SequenceOfVectors< Q_V, Q_M >, and QUESO::ArrayOfSequences< V, M >.
|
pure virtual |
Extracts a sequence of scalars of size numPos
, starting at position initialPos
, given spacing spacing
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, QUESO::SequenceOfVectors< Q_V, Q_M >, and QUESO::ArrayOfSequences< V, M >.
|
pure virtual |
Filters positions in the sequence of vectors, starting at initialPos
, and with spacing given by spacing
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, QUESO::SequenceOfVectors< Q_V, Q_M >, and QUESO::ArrayOfSequences< V, M >.
Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence().
|
pure virtual |
Gets the values of the sequence at position posId
and stores them at vec
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, and QUESO::ArrayOfSequences< V, M >.
Referenced by QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualGenerateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::adapt(), QUESO::BaseVectorSequence< V, M >::append(), QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::BaseVectorSequence< V, M >::unifiedPositionsOfMaximum(), and QUESO::MetropolisHastingsSG< P_V, P_M >::updateAdaptedCovMatrix().
const std::string & QUESO::BaseVectorSequence< V, M >::name | ( | ) | const |
Access to protected attribute m_name:
name of the sequence of vectors.
This method is used, for instance, to recover the name of a sequence of vector samples, such as the 'rawChain' for the raw chain of samples used in an Monte Carlo algorithm.
Definition at line 118 of file VectorSequence.C.
Referenced by QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualGenerateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence(), QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::internGenerateSequence(), and QUESO::MetropolisHastingsSG< P_V, P_M >::writeInfo().
|
pure virtual |
Reset the values of the sequence. See template specialization.
This routine deletes all stored computed vectors
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, QUESO::SequenceOfVectors< Q_V, Q_M >, and QUESO::ArrayOfSequences< V, M >.
|
pure virtual |
Resize the sequence. See template specialization.
This routine deletes all stored computed vectors
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, QUESO::SequenceOfVectors< Q_V, Q_M >, and QUESO::ArrayOfSequences< V, M >.
Referenced by QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualGenerateSequence(), QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualReadSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain(), QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::BaseVectorSequence< V, M >::subPositionsOfMaximum(), and QUESO::BaseVectorSequence< V, M >::unifiedPositionsOfMaximum().
|
pure virtual |
Select positions in the sequence of vectors. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, QUESO::SequenceOfVectors< Q_V, Q_M >, and QUESO::ArrayOfSequences< V, M >.
void QUESO::BaseVectorSequence< 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 584 of file VectorSequence.C.
void QUESO::BaseVectorSequence< V, M >::setName | ( | const std::string & | newName | ) |
Changes the name of the sequence of vectors.
Definition at line 125 of file VectorSequence.C.
Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence(), QUESO::MLSampling< P_V, P_M >::generateSequence_Level0_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step02_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step11_inter0(), and QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::internGenerateSequence().
|
pure virtual |
Set the values in vec
at position posId
of the sequence. See template specialization.
This routine deletes all stored computed vectors
Implemented in QUESO::SequenceOfVectors< V, M >, and QUESO::ArrayOfSequences< V, M >.
Referenced by QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualGenerateSequence(), QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualReadSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain(), QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::BaseVectorSequence< V, M >::subPositionsOfMaximum(), and QUESO::BaseVectorSequence< V, M >::unifiedPositionsOfMaximum().
void QUESO::BaseVectorSequence< 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 599 of file VectorSequence.C.
const BoxSubset< V, M > & QUESO::BaseVectorSequence< V, M >::subBoxPlain | ( | ) | const |
Finds a box subset of the sub-sequence (given by its min and max values calculated via subMinPlain and subMaxPlain).
Definition at line 270 of file VectorSequence.C.
|
pure virtual |
Gaussian kernel for the KDE estimate of the sub-sequence. See template specialization.
Computes a probability density estimate of the sample in this
sub-sequence, starting at position initialPos
. densityVecs
is the vector of density values evaluated at the points in evaluationParamVecs
. The estimate is based on Gaussian (normal) kernel function, using a window parameter (scaleVec
).
Implemented in QUESO::SequenceOfVectors< V, M >.
|
pure virtual |
Calculates the histogram of the sub-sequence. See template specialization.
The IQR is a robust estimate of the spread of the data, since changes in the upper and lower 25% of the data do not affect it. If there are outliers in the data, then the IQR is more representative than the standard deviation as an estimate of the spread of the body of the data. The IQR is less efficient than the standard deviation as an estimate of the spread when the data is all from the normal distribution. (from Matlab)
Implemented in QUESO::SequenceOfVectors< V, M >.
|
pure virtual |
Returns the interquartile range of the values in the sub-sequence. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
const V & QUESO::BaseVectorSequence< V, M >::subMaxPlain | ( | ) | const |
Finds the maximum value of the sub-sequence.
Definition at line 172 of file VectorSequence.C.
Referenced by QUESO::SimulationModel< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationModel().
|
pure virtual |
Finds the mean value of the sub-sequence, considering numPos
positions starting at position initialPos
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::updateAdaptedCovMatrix().
const V & QUESO::BaseVectorSequence< V, M >::subMeanPlain | ( | ) | const |
Finds the mean value of the sub-sequence.
Definition at line 198 of file VectorSequence.C.
Referenced by QUESO::SimulationModel< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationModel(), and QUESO::MetropolisHastingsSG< P_V, P_M >::updateAdaptedCovMatrix().
|
pure virtual |
Finds the median value of the sub-sequence, considering numPos
positions starting at position initialPos
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
const V & QUESO::BaseVectorSequence< V, M >::subMedianPlain | ( | ) | const |
Finds the median value of the sub-sequence.
Definition at line 222 of file VectorSequence.C.
|
pure virtual |
Finds the minimum and the maximum values of the sub-sequence, considering numPos
positions starting at position initialPos
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
const V & QUESO::BaseVectorSequence< V, M >::subMinPlain | ( | ) | const |
Finds the minimum value of the sub-sequence.
Definition at line 146 of file VectorSequence.C.
Referenced by QUESO::SimulationModel< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationModel().
|
pure virtual |
Finds the population variance of the sub-sequence, considering numPos
positions starting at position initialPos
and of mean meanVec
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
double QUESO::BaseVectorSequence< V, M >::subPositionsOfMaximum | ( | const ScalarSequence< double > & | subCorrespondingScalarValues, |
BaseVectorSequence< V, M > & | subPositionsOfMaximum | ||
) |
Finds the positions where the maximum element occurs in the sub-sequence.
Definition at line 377 of file VectorSequence.C.
References queso_require_equal_to_msg, QUESO::BaseVectorSequence< V, M >::resizeSequence(), QUESO::BaseVectorSequence< V, M >::setPositionValues(), QUESO::ScalarSequence< T >::subMaxPlain(), and QUESO::ScalarSequence< T >::subSequenceSize().
Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence().
|
pure virtual |
Finds the sample variance of the sub-sequence, considering numPos
positions starting at position initialPos
and of mean meanVec
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
const V & QUESO::BaseVectorSequence< V, M >::subSampleVariancePlain | ( | ) | const |
Finds the variance of a sample of the sub-sequence.
Definition at line 246 of file VectorSequence.C.
|
pure virtual |
Selects the scales (bandwidth, scaleVec
) for the kernel density estimation, considering only the sub-sequence. See template specialization.
The bandwidth of the kernel is a free parameter which exhibits a strong influence on the resulting estimate. Silverman (1986) suggests the following normal-based estimates: S1 = 1.06 × (standard deviation) × n^{-1/5} S2 = 0.79 × (iqrVec
) × n^{-1/5}, where iqrVec
is the interquartile range scaleVec
= 0.90 × minimum(standard deviation, iqrVec
/1.34) × n^{-1/5}. These estimates are popular due to their simplicity, and are used in QUESO with the adaptation of the exponent oven the sample size n (-1/5) with -1/(4 + kdeDimension
) where kdeDimension
is the KDE dimension.
Implemented in QUESO::SequenceOfVectors< V, M >.
|
pure virtual |
Size of the sub-sequence of vectors. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, QUESO::SequenceOfVectors< Q_V, Q_M >, and QUESO::ArrayOfSequences< V, M >.
Referenced by QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualGenerateSequence(), QUESO::BaseVectorSequence< V, M >::append(), QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain(), QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence(), QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::internGenerateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::updateAdaptedCovMatrix(), and QUESO::MetropolisHastingsSG< P_V, P_M >::writeInfo().
|
pure virtual |
Writes info of the sub-sequence to a file. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, and QUESO::SequenceOfVectors< Q_V, Q_M >.
Referenced by QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualGenerateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence(), and QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::internGenerateSequence().
|
pure virtual |
Writes info of the sub-sequence to a file. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, and QUESO::SequenceOfVectors< Q_V, Q_M >.
const BoxSubset< V, M > & QUESO::BaseVectorSequence< 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).
Definition at line 284 of file VectorSequence.C.
|
pure virtual |
Gaussian kernel for the KDE estimate of the unified sequence. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
|
pure virtual |
Calculates the histogram of the unified sequence. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
|
pure virtual |
Returns the interquartile range of the values in the unified sequence. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
const V & QUESO::BaseVectorSequence< V, M >::unifiedMaxPlain | ( | ) | const |
Finds the maximum value of the unified sequence.
Definition at line 185 of file VectorSequence.C.
|
pure virtual |
Finds the mean value of the unified sequence of numPos
positions starting at position initialPos
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
Referenced by QUESO::ComputeCovCorrMatricesBetweenVectorSequences().
const V & QUESO::BaseVectorSequence< V, M >::unifiedMeanPlain | ( | ) | const |
Finds the mean value of the unified sequence.
Definition at line 210 of file VectorSequence.C.
Referenced by QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::predictVUsAtGridPoint(), and QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::predictWsAtGridPoint().
|
pure virtual |
Finds the median value of the unified sequence, considering numPos
positions starting at position initialPos
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
const V & QUESO::BaseVectorSequence< V, M >::unifiedMedianPlain | ( | ) | const |
Finds the median value of the unified sequence.
Definition at line 234 of file VectorSequence.C.
|
pure virtual |
Finds the minimum and the maximum values of the unified sequence, considering numPos
positions starting at position initialPos
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
const V & QUESO::BaseVectorSequence< V, M >::unifiedMinPlain | ( | ) | const |
Finds the minimum value of the unified sequence.
Definition at line 159 of file VectorSequence.C.
|
pure virtual |
Finds the population variance of the unified-sequence, considering numPos
positions starting at position initialPos
and of mean meanVec
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
double QUESO::BaseVectorSequence< V, M >::unifiedPositionsOfMaximum | ( | const ScalarSequence< double > & | subCorrespondingScalarValues, |
BaseVectorSequence< V, M > & | unifiedPositionsOfMaximum | ||
) |
Finds the positions where the maximum element occurs in the unified sequence.
this | The underlying sequence of vectors |
subCorrespondingScalarValues | For a given process, a scalar sequence where element i corresponds to element i of this . |
unifiedPositionsOfMaximum | Upon returning, on process 0 on chain 0, this will contain states that correspond to the unique maximum value in subCorrespondingScalarValues over all processes. |
subCorrespondingScalarValues
over all processes. Definition at line 421 of file VectorSequence.C.
References QUESO::BaseVectorSequence< V, M >::getPositionValues(), queso_require_equal_to_msg, RawValue_MPI_DOUBLE, RawValue_MPI_INT, RawValue_MPI_MAX, RawValue_MPI_SUM, QUESO::BaseVectorSequence< V, M >::resizeSequence(), QUESO::BaseVectorSequence< V, M >::setPositionValues(), QUESO::ScalarSequence< T >::subMaxPlain(), and QUESO::ScalarSequence< T >::subSequenceSize().
Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence().
|
pure virtual |
Reads info of the unified sequence from a file. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, QUESO::SequenceOfVectors< Q_V, Q_M >, and QUESO::ArrayOfSequences< V, M >.
Referenced by QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::actualReadSequence(), and QUESO::MetropolisHastingsSG< P_V, P_M >::readFullChain().
|
pure virtual |
Finds the sample variance of the unified sequence, considering numPos
positions starting at position initialPos
and of mean meanVec
. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
Referenced by QUESO::ComputeCovCorrMatricesBetweenVectorSequences().
const V & QUESO::BaseVectorSequence< V, M >::unifiedSampleVariancePlain | ( | ) | const |
Finds the variance of a sample of the unified sequence.
Definition at line 258 of file VectorSequence.C.
|
pure virtual |
Selects the scales (bandwidth) for the kernel density estimation, considering the unified sequence. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >.
unsigned int QUESO::BaseVectorSequence< V, M >::unifiedSequenceSize | ( | ) | const |
Calculates the size of the unified sequence of vectors.
TODO: this procedure does not support parallel vectors yet.
Definition at line 70 of file VectorSequence.C.
References queso_require_msg, RawValue_MPI_SUM, and RawValue_MPI_UNSIGNED.
Referenced by QUESO::MLSampling< P_V, P_M >::checkpointML(), and QUESO::MLSampling< P_V, P_M >::generateSequence_Step02_inter0().
|
pure virtual |
Writes info of the unified sequence to a file. See template specialization.
Implemented in QUESO::SequenceOfVectors< V, M >, QUESO::SequenceOfVectors< S_V, S_M >, QUESO::SequenceOfVectors< P_V, P_M >, QUESO::SequenceOfVectors< Q_V, Q_M >, and QUESO::ArrayOfSequences< V, M >.
Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence(), and QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::internGenerateSequence().
unsigned int QUESO::BaseVectorSequence< V, M >::vectorSizeGlobal | ( | ) | const |
Global dimension (size) of the vector space.
Definition at line 104 of file VectorSequence.C.
unsigned int QUESO::BaseVectorSequence< V, M >::vectorSizeLocal | ( | ) | const |
Local dimension (size) of the vector space.
Definition at line 97 of file VectorSequence.C.
Referenced by QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::generateSequence(), and QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence().
const VectorSpace< V, M > & QUESO::BaseVectorSequence< V, M >::vectorSpace | ( | ) | const |
Vector space; access to protected attribute VectorSpace<V,M>& m_vectorSpace.
Definition at line 111 of file VectorSequence.C.
Referenced by QUESO::BaseVectorSequence< V, M >::append(), and QUESO::ComputeCovCorrMatricesBetweenVectorSequences().
|
protected |
Definition at line 431 of file VectorSequence.h.
Referenced by QUESO::ArrayOfSequences< V, M >::ArrayOfSequences().
|
mutableprotected |
Definition at line 435 of file VectorSequence.h.
|
protected |
Definition at line 433 of file VectorSequence.h.
Referenced by QUESO::BaseVectorSequence< V, M >::copy().
|
mutableprotected |
Definition at line 446 of file VectorSequence.h.
|
mutableprotected |
Definition at line 438 of file VectorSequence.h.
|
mutableprotected |
Definition at line 440 of file VectorSequence.h.
|
mutableprotected |
Definition at line 442 of file VectorSequence.h.
|
mutableprotected |
Definition at line 436 of file VectorSequence.h.
|
mutableprotected |
Definition at line 444 of file VectorSequence.h.
|
mutableprotected |
Definition at line 447 of file VectorSequence.h.
|
mutableprotected |
Definition at line 439 of file VectorSequence.h.
|
mutableprotected |
Definition at line 441 of file VectorSequence.h.
|
mutableprotected |
Definition at line 443 of file VectorSequence.h.
|
mutableprotected |
Definition at line 437 of file VectorSequence.h.
|
mutableprotected |
Definition at line 445 of file VectorSequence.h.
|
protected |
Definition at line 432 of file VectorSequence.h.
Referenced by QUESO::BaseVectorSequence< V, M >::copy().