queso-0.57.1
|
Class for handling scalar samples. More...
#include <ScalarSequence.h>
Public Types | |
Class typedefs | |
typedef std::vector< T >::iterator | seqScalarPositionIteratorTypedef |
typedef std::vector< T > ::const_iterator | seqScalarPositionConstIteratorTypedef |
Public Member Functions | |
Constructor/Destructor methods | |
ScalarSequence (const BaseEnvironment &env, unsigned int subSequenceSize, const std::string &name) | |
Default constructor. More... | |
~ScalarSequence () | |
Destructor. More... | |
Set methods | |
ScalarSequence< T > & | operator= (const ScalarSequence< T > &rhs) |
Assignment operator; it copies rhs to this . More... | |
Access methods | |
const T & | operator[] (unsigned int posId) const |
Access position posId of the sequence of scalars (const). More... | |
T & | operator[] (unsigned int posId) |
Access position posId of the sequence of scalars (non-const). More... | |
Sequence methods | |
const BaseEnvironment & | env () const |
Access to QUESO environment. More... | |
const std::string & | name () const |
Access to the name of the sequence of scalars. More... | |
void | setName (const std::string &newName) |
Sets a new name to the sequence of scalars. More... | |
void | clear () |
Clears the sequence of scalars. More... | |
unsigned int | subSequenceSize () const |
Size of the sub-sequence of scalars. More... | |
unsigned int | unifiedSequenceSize (bool useOnlyInter0Comm) const |
Size of the unified sequence of scalars. More... | |
void | resizeSequence (unsigned int newSequenceSize) |
Resizes the size of the sequence of scalars. More... | |
void | resetValues (unsigned int initialPos, unsigned int) |
Sets numPos values of the sequence to zero, starting at position initialPos . More... | |
void | erasePositions (unsigned int initialPos, unsigned int numPos) |
Erases numPos values of the sequence, starting at position initialPos . More... | |
void | getUnifiedContentsAtProc0Only (bool useOnlyInter0Comm, std::vector< T > &outputVec) const |
Gets the unified contents of processor of rank equals to 0. More... | |
const T & | subMinPlain () const |
Finds the minimum value of the sub-sequence of scalars. More... | |
const T & | unifiedMinPlain (bool useOnlyInter0Comm) const |
Finds the minimum value of the unified sequence of scalars. More... | |
const T & | subMaxPlain () const |
Finds the maximum value of the sub-sequence of scalars. More... | |
const T & | unifiedMaxPlain (bool useOnlyInter0Comm) const |
Finds the maximum value of the unified sequence of scalars. More... | |
const T & | subMeanPlain () const |
Finds the mean value of the sub-sequence of scalars. More... | |
const T & | unifiedMeanPlain (bool useOnlyInter0Comm) const |
Finds the mean value of the unified sequence of scalars. More... | |
const T & | subMedianPlain () const |
Finds the median value of the sub-sequence of scalars. More... | |
const T & | unifiedMedianPlain (bool useOnlyInter0Comm) const |
Finds the median value of the unified sequence of scalars. More... | |
const T & | subSampleVariancePlain () const |
Finds the variance of a sample of the sub-sequence of scalars. More... | |
const T & | unifiedSampleVariancePlain (bool useOnlyInter0Comm) const |
Finds the variance of a sample of the unified sequence of scalars. More... | |
void | deleteStoredScalars () |
Deletes all stored scalars. More... | |
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 deviation by stdDevVec . More... | |
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 and bVec . More... | |
void | subUniformlySampledCdf (unsigned int numIntervals, T &minDomainValue, T &maxDomainValue, std::vector< T > &cdfValues) const |
Uniformly samples from the CDF from the sub-sequence. More... | |
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. More... | |
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. More... | |
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. More... | |
void | subWeightCdf (unsigned int numIntervals, UniformOneDGrid< T > *&gridValues, std::vector< T > &cdfValues) const |
Finds the Weighted Cumulative Distribution Function (CDF) of the sub-sequence of scalars. More... | |
T | subMeanExtra (unsigned int initialPos, unsigned int numPos) const |
Finds the mean value of the sub-sequence, considering numPos positions starting at position initialPos . More... | |
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 . More... | |
T | subMedianExtra (unsigned int initialPos, unsigned int numPos) const |
Finds the median value of the sub-sequence, considering numPos positions starting at position initialPos . More... | |
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 initialPos . More... | |
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 initialPos and of mean meanVec . More... | |
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 initialPos and of mean meanVec . More... | |
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 position initialPos and of mean meanValue . More... | |
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 starting at position initialPos and of mean unifiedMeanValue . More... | |
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 initialPos and of mean meanValue . More... | |
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 position initialPos and of mean meanValue . More... | |
T | autoCovariance (unsigned int initialPos, unsigned int numPos, const T &meanValue, unsigned int lag) const |
Calculates the autocovariance. More... | |
T | autoCorrViaDef (unsigned int initialPos, unsigned int numPos, unsigned int lag) const |
Calculates the autocorrelation via definition. More... | |
void | autoCorrViaFft (unsigned int initialPos, unsigned int numPos, unsigned int maxLag, std::vector< T > &autoCorrs) const |
Calculates the autocorrelation via Fast Fourier transforms (FFT). More... | |
void | autoCorrViaFft (unsigned int initialPos, unsigned int numPos, unsigned int numSum, T &autoCorrsSum) const |
Calculates the sum of autocorrelation via Fast Fourier transforms (FFT). More... | |
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 at position initialPos . More... | |
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 starting at position initialPos . More... | |
void | subHistogram (unsigned int initialPos, const T &minHorizontalValue, const T &maxHorizontalValue, std::vector< T > ¢ers, std::vector< unsigned int > &bins) const |
Calculates the histogram of the sub-sequence. More... | |
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. More... | |
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. More... | |
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. More... | |
void | subWeightHistogram (unsigned int initialPos, const T &minHorizontalValue, const T &maxHorizontalValue, std::vector< T > &gridValues, std::vector< unsigned int > &bins) const |
Calculates the weighted histogram of the sub-sequence. More... | |
void | subSort (unsigned int initialPos, ScalarSequence< T > &sortedSequence) const |
Sorts the sub-sequence of scalars. More... | |
void | unifiedSort (bool useOnlyInter0Comm, unsigned int initialPos, ScalarSequence< T > &unifiedSortedSequence) const |
Sorts the unified sequence of scalars. More... | |
T | subInterQuantileRange (unsigned int initialPos) const |
Returns the interquartile range of the values in the sub-sequence. More... | |
T | unifiedInterQuantileRange (bool useOnlyInter0Comm, unsigned int initialPos) const |
Returns the interquartile range of the values in the unified sequence. More... | |
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-sequence. More... | |
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. More... | |
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. More... | |
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. More... | |
void | filter (unsigned int initialPos, unsigned int spacing) |
Filters positions in the sequence of vectors. More... | |
T | brooksGelmanConvMeasure (bool useOnlyInter0Comm, unsigned int initialPos, unsigned int spacing) const |
Estimates convergence rate using Brooks & Gelman method. More... | |
void | append (const ScalarSequence< T > &src, unsigned int srcInitialPos, unsigned int srcNumPos) |
Appends the scalar sequence src to this sequence. More... | |
T | subPositionsOfMaximum (const ScalarSequence< T > &subCorrespondingScalarValues, ScalarSequence< T > &subPositionsOfMaximum) |
Finds the positions where the maximum element occurs in the sub-sequence. More... | |
T | unifiedPositionsOfMaximum (const ScalarSequence< T > &subCorrespondingScalarValues, ScalarSequence< T > &unifiedPositionsOfMaximum) |
Finds the positions where the maximum element occurs in the unified sequence. More... | |
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. More... | |
void | subWriteContents (unsigned int initialPos, unsigned int numPos, std::ofstream &ofs, const std::string &fileType) const |
Writes the sub-sequence to a file. More... | |
void | unifiedWriteContents (const std::string &fileName, const std::string &fileType) const |
Writes 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... | |
T | bmm (unsigned int initialPos, unsigned int batchLength) const |
void | psd (unsigned int initialPos, unsigned int numBlocks, double hopSizeRatio, std::vector< double > &psdSequence) const |
T | geweke (unsigned int initialPos, double ratioNa, double ratioNb) const |
T | meanStacc (unsigned int initialPos) const |
void | subCdfPercentageRange (unsigned int initialPos, unsigned int numPos, double range, T &lowerValue, T &upperValue) const |
void | unifiedCdfPercentageRange (bool useOnlyInter0Comm, unsigned int initialPos, unsigned int numPos, double range, T &lowerValue, T &upperValue) const |
void | subCdfStacc (unsigned int initialPos, std::vector< double > &cdfStaccValues, std::vector< double > &cdfStaccValuesup, std::vector< double > &cdfStaccValueslow, const ScalarSequence< T > &sortedDataValues) const |
void | subCdfStacc (unsigned int initialPos, const std::vector< T > &evaluationPositions, std::vector< double > &cdfStaccValues) const |
void | subUniformlySampledMdf (unsigned int numIntervals, T &minDomainValue, T &maxDomainValue, std::vector< T > &mdfValues) const |
T | subMeanCltStd (unsigned int initialPos, unsigned int numPos, const T &meanValue) const |
T | unifiedMeanCltStd (bool useOnlyInter0Comm, unsigned int initialPos, unsigned int localNumPos, const T &unifiedMeanValue) const |
Private Member Functions | |
void | copy (const ScalarSequence< T > &src) |
Copies the scalar sequence src to this . More... | |
void | writeUnifiedMatlabHeader (std::ofstream &ofs, double sequenceSize) const |
Helper function to write header info for matlab files from all chains. More... | |
void | writeSubMatlabHeader (std::ofstream &ofs, double sequenceSize) const |
Helper function to write header info for matlab files from one chain. More... | |
void | writeTxtHeader (std::ofstream &ofs, double sequenceSize) const |
Helper function to write txt info for matlab files. More... | |
void | extractScalarSeq (unsigned int initialPos, unsigned int spacing, unsigned int numPos, ScalarSequence< T > &scalarSeq) const |
Extracts a sequence of scalars. More... | |
void | extractRawData (unsigned int initialPos, unsigned int spacing, unsigned int numPos, std::vector< double > &rawData) const |
Extracts the raw data. More... | |
std::vector< T > & | rawData () |
The sequence of scalars. Access to private attribute m_seq . More... | |
void | subSort () |
Sorts the sequence of scalars in the private attribute m_seq . More... | |
void | parallelMerge (std::vector< T > &sortedBuffer, const std::vector< T > &leafData, unsigned int treeLevel) const |
Sorts/merges data in parallel using MPI. More... | |
Private Attributes | |
const BaseEnvironment & | m_env |
std::string | m_name |
std::vector< T > | m_seq |
T * | m_subMinPlain |
T * | m_unifiedMinPlain |
T * | m_subMaxPlain |
T * | m_unifiedMaxPlain |
T * | m_subMeanPlain |
T * | m_unifiedMeanPlain |
T * | m_subMedianPlain |
T * | m_unifiedMedianPlain |
T * | m_subSampleVariancePlain |
T * | m_unifiedSampleVariancePlain |
Class for handling scalar samples.
This class handles scalar 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 54 of file ScalarSequence.h.
typedef std::vector<T>::const_iterator QUESO::ScalarSequence< T >::seqScalarPositionConstIteratorTypedef |
Definition at line 60 of file ScalarSequence.h.
typedef std::vector<T>::iterator QUESO::ScalarSequence< T >::seqScalarPositionIteratorTypedef |
Definition at line 59 of file ScalarSequence.h.
QUESO::ScalarSequence< T >::ScalarSequence | ( | const BaseEnvironment & | env, |
unsigned int | subSequenceSize, | ||
const std::string & | name | ||
) |
Default constructor.
Definition at line 32 of file ScalarSequence.C.
QUESO::ScalarSequence< T >::~ScalarSequence | ( | ) |
Destructor.
Definition at line 54 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::append | ( | const ScalarSequence< T > & | src, |
unsigned int | srcInitialPos, | ||
unsigned int | srcNumPos | ||
) |
Appends the scalar sequence src
to this
sequence.
This routine deletes all stored computed scalars.
Definition at line 2456 of file ScalarSequence.C.
References QUESO::ScalarSequence< T >::m_seq, and QUESO::ScalarSequence< T >::subSequenceSize().
Referenced by QUESO::MLSampling< P_V, P_M >::generateBalLinkedChains_all(), and QUESO::MLSampling< P_V, P_M >::generateUnbLinkedChains_all().
T QUESO::ScalarSequence< T >::autoCorrViaDef | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
unsigned int | lag | ||
) | const |
Calculates the autocorrelation via definition.
Autocorrelation is the cross-correlation of a variable with itself; it describes the correlation between values of the process at different times, as a function of the two times. It is calculated over a sequence of vectors with initial position initialPos
, considering numPos
positions, a lag of lag
, with mean given by meanValue
. Output: the calculated autocorrelations of the sequence of vectors.
Definition at line 1302 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::autoCorrViaDef().
void QUESO::ScalarSequence< T >::autoCorrViaFft | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
unsigned int | maxLag, | ||
std::vector< T > & | autoCorrs | ||
) | const |
Calculates the autocorrelation via Fast Fourier transforms (FFT).
Definition at line 1331 of file ScalarSequence.C.
References QUESO::Fft< T >::forward(), and QUESO::Fft< T >::inverse().
Referenced by QUESO::ArrayOfSequences< V, M >::autoCorrViaFft(), and QUESO::SequenceOfVectors< V, M >::autoCorrViaFft().
void QUESO::ScalarSequence< T >::autoCorrViaFft | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
unsigned int | numSum, | ||
T & | autoCorrsSum | ||
) | const |
Calculates the sum of autocorrelation via Fast Fourier transforms (FFT).
Definition at line 1400 of file ScalarSequence.C.
References QUESO::Fft< T >::forward(), and QUESO::Fft< T >::inverse().
T QUESO::ScalarSequence< T >::autoCovariance | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
const T & | meanValue, | ||
unsigned int | lag | ||
) | const |
Calculates the autocovariance.
The autocovariance is the covariance of a variable with itself at some other time. It is calculated over a sequence of scalars with initial position initialPos
, considering numPos
positions, a lag of lag
, with mean given by meanValue
. Output: the calculated autocovariances of the sequence of scalars.
Definition at line 1272 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::autoCovariance().
T QUESO::ScalarSequence< T >::bmm | ( | unsigned int | initialPos, |
unsigned int | batchLength | ||
) | const |
Definition at line 3494 of file ScalarSequence.C.
References QUESO::ScalarSequence< T >::subMeanExtra(), QUESO::ScalarSequence< T >::subSampleVarianceExtra(), and QUESO::ScalarSequence< T >::subSequenceSize().
Referenced by QUESO::SequenceOfVectors< V, M >::bmm().
T QUESO::ScalarSequence< T >::brooksGelmanConvMeasure | ( | bool | useOnlyInter0Comm, |
unsigned int | initialPos, | ||
unsigned int | spacing | ||
) | const |
Estimates convergence rate using Brooks & Gelman method.
TODO: implement me!
Definition at line 2427 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::clear | ( | ) |
Clears the sequence of scalars.
Resets its values and then its size to zero.
Definition at line 123 of file ScalarSequence.C.
Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence_Step02_inter0().
|
private |
Copies the scalar sequence src
to this
.
This routine deletes all stored computed scalars.
Definition at line 3136 of file ScalarSequence.C.
References QUESO::ScalarSequence< T >::m_name, QUESO::ScalarSequence< T >::m_seq, and QUESO::ScalarSequence< T >::subSequenceSize().
void QUESO::ScalarSequence< T >::deleteStoredScalars | ( | ) |
Deletes all stored scalars.
Definition at line 467 of file ScalarSequence.C.
const BaseEnvironment & QUESO::ScalarSequence< T >::env | ( | ) | const |
Access to QUESO environment.
Definition at line 101 of file ScalarSequence.C.
Referenced by QUESO::ComputeCovCorrBetweenScalarSequences(), and QUESO::ComputeUnifiedGaussian2dKde().
void QUESO::ScalarSequence< T >::erasePositions | ( | unsigned int | initialPos, |
unsigned int | numPos | ||
) |
Erases numPos
values of the sequence, starting at position initialPos
.
This routine deletes all stored computed scalars.
Definition at line 206 of file ScalarSequence.C.
References QUESO::queso_require_equal_to_msg.
Referenced by QUESO::ArrayOfSequences< V, M >::erasePositions().
|
private |
Extracts the raw data.
This method saves in rawData
the data from the sequence of scalars (in private attribute m_seq
) starting at position (initialPos
), with a spacing of spacing
until numPos
positions have been extracted.
Definition at line 3192 of file ScalarSequence.C.
|
private |
Extracts a sequence of scalars.
The sequence of scalars has size numPos
, and it will be extracted starting at position (initialPos
) of this
sequence of scalars, given spacing spacing
.
Definition at line 3151 of file ScalarSequence.C.
References QUESO::ScalarSequence< T >::resizeSequence().
void QUESO::ScalarSequence< T >::filter | ( | unsigned int | initialPos, |
unsigned int | spacing | ||
) |
Filters positions in the sequence of vectors.
Filtered positions will start at initialPos
, and with spacing given by spacing
.
Definition at line 2388 of file ScalarSequence.C.
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().
void QUESO::ScalarSequence< T >::getUnifiedContentsAtProc0Only | ( | bool | useOnlyInter0Comm, |
std::vector< T > & | outputVec | ||
) | const |
Gets the unified contents of processor of rank equals to 0.
Definition at line 235 of file ScalarSequence.C.
References QUESO::queso_require_equal_to_msg.
Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence_Step05_inter0(), and QUESO::MLSampling< P_V, P_M >::generateSequence_Step09_all().
T QUESO::ScalarSequence< T >::geweke | ( | unsigned int | initialPos, |
double | ratioNa, | ||
double | ratioNb | ||
) | const |
Definition at line 3653 of file ScalarSequence.C.
References QUESO::ScalarSequence< T >::psd(), and QUESO::ScalarSequence< T >::subMeanExtra().
Referenced by QUESO::SequenceOfVectors< V, M >::geweke().
T QUESO::ScalarSequence< T >::meanStacc | ( | unsigned int | initialPos | ) | const |
Definition at line 3718 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::meanStacc().
const std::string & QUESO::ScalarSequence< T >::name | ( | ) | const |
ScalarSequence< T > & QUESO::ScalarSequence< T >::operator= | ( | const ScalarSequence< T > & | rhs | ) |
Assignment operator; it copies rhs
to this
.
Definition at line 61 of file ScalarSequence.C.
const T & QUESO::ScalarSequence< T >::operator[] | ( | unsigned int | posId | ) | const |
Access position posId
of the sequence of scalars (const).
Definition at line 69 of file ScalarSequence.C.
T & QUESO::ScalarSequence< T >::operator[] | ( | unsigned int | posId | ) |
Access position posId
of the sequence of scalars (non-const).
This routine deletes all stored computed scalars.
Definition at line 84 of file ScalarSequence.C.
|
private |
Sorts/merges data in parallel using MPI.
Definition at line 3233 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::psd | ( | unsigned int | initialPos, |
unsigned int | numBlocks, | ||
double | hopSizeRatio, | ||
std::vector< double > & | psdSequence | ||
) | const |
Definition at line 3530 of file ScalarSequence.C.
References QUESO::Fft< T >::forward(), and QUESO::MiscHammingWindow().
Referenced by QUESO::ArrayOfSequences< V, M >::geweke(), QUESO::ScalarSequence< T >::geweke(), QUESO::SequenceOfVectors< V, M >::psd(), QUESO::ArrayOfSequences< V, M >::psdAtZero(), and QUESO::SequenceOfVectors< V, M >::psdAtZero().
|
private |
The sequence of scalars. Access to private attribute m_seq
.
Definition at line 3215 of file ScalarSequence.C.
Referenced by QUESO::ScalarSequence< T >::unifiedSort().
void QUESO::ScalarSequence< T >::resetValues | ( | unsigned int | initialPos, |
unsigned int | numPos | ||
) |
Sets numPos
values of the sequence to zero, starting at position initialPos
.
This routine deletes all stored computed scalars.
Definition at line 186 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::resizeSequence | ( | unsigned int | newSequenceSize | ) |
Resizes the size of the sequence of scalars.
This routine deletes all stored computed scalars.
Definition at line 173 of file ScalarSequence.C.
Referenced by QUESO::ArrayOfSequences< V, M >::extractScalarSeq(), QUESO::SequenceOfVectors< V, M >::extractScalarSeq(), QUESO::ScalarSequence< T >::extractScalarSeq(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain(), QUESO::MLSampling< P_V, P_M >::generateSequence_Level0_all(), QUESO::ScalarSequence< T >::subCdfPercentageRange(), QUESO::ScalarSequence< T >::subMedianExtra(), QUESO::ScalarSequence< T >::subPositionsOfMaximum(), QUESO::ScalarSequence< T >::subSort(), QUESO::ScalarSequence< T >::unifiedPositionsOfMaximum(), and QUESO::ScalarSequence< T >::unifiedSort().
void QUESO::ScalarSequence< T >::setGaussian | ( | const T & | mean, |
const T & | stdDev | ||
) |
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 scalars.
Definition at line 515 of file ScalarSequence.C.
Referenced by QUESO::ArrayOfSequences< V, M >::setGaussian().
void QUESO::ScalarSequence< T >::setName | ( | const std::string & | newName | ) |
Sets a new name to the sequence of scalars.
Definition at line 115 of file ScalarSequence.C.
Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::MLSampling< P_V, P_M >::generateSequence_Level0_all(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step02_inter0(), and QUESO::MLSampling< P_V, P_M >::generateSequence_Step11_inter0().
void QUESO::ScalarSequence< T >::setUniform | ( | const T & | a, |
const T & | b | ||
) |
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 scalars.
Definition at line 527 of file ScalarSequence.C.
Referenced by QUESO::ArrayOfSequences< V, M >::setUniform().
void QUESO::ScalarSequence< T >::subBasicCdf | ( | unsigned int | numIntervals, |
UniformOneDGrid< T > *& | gridValues, | ||
std::vector< T > & | cdfValues | ||
) | const |
Finds the Cumulative Distribution Function (CDF) of the sub-sequence of scalars.
Definition at line 680 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::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.
It requires the specification of the maximum (maxHorizontalValue
) and the minimum (minHorizontalValue
) values if the data and the initial position (initialPos
) from where the data will be considered. Output: grid values that will act as the center of each bin (gridValues
) and the number of data occurrences in each bin (bins
).
Definition at line 1706 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::subCdfPercentageRange | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
double | range, | ||
T & | lowerValue, | ||
T & | upperValue | ||
) | const |
Definition at line 3730 of file ScalarSequence.C.
References QUESO::ScalarSequence< T >::resizeSequence(), and QUESO::ScalarSequence< T >::subSort().
Referenced by QUESO::SequenceOfVectors< V, M >::subCdfPercentageRange().
void QUESO::ScalarSequence< T >::subCdfStacc | ( | unsigned int | initialPos, |
std::vector< double > & | cdfStaccValues, | ||
std::vector< double > & | cdfStaccValuesup, | ||
std::vector< double > & | cdfStaccValueslow, | ||
const ScalarSequence< T > & | sortedDataValues | ||
) | const |
Definition at line 3808 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::subCdfStacc().
void QUESO::ScalarSequence< T >::subCdfStacc | ( | unsigned int | initialPos, |
const std::vector< T > & | evaluationPositions, | ||
std::vector< double > & | cdfStaccValues | ||
) | const |
Definition at line 3888 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::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.
Computes a probability density estimate of the sample in this
sub-sequence, starting at position initialPos
. densityValues
is the vector of density values evaluated at the points in evaluationPositions
. The estimate is based on Gaussian (normal) kernel function, using a window parameter (scaleValue
).
Definition at line 2278 of file ScalarSequence.C.
References QUESO::MiscGaussianDensity().
Referenced by QUESO::SequenceOfVectors< V, M >::subGaussian1dKde().
void QUESO::ScalarSequence< T >::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.
It requires the specification of the maximum (maxHorizontalValue
) and the minimum (minHorizontalValue
) values if the data and the initial position (initialPos
) from where the data will be considered. Output: the center of each bin (centers
) and the number of data occurrences in each bin (bins
).
Definition at line 1569 of file ScalarSequence.C.
References QUESO::queso_require_equal_to_msg.
Referenced by QUESO::SequenceOfVectors< V, M >::subHistogram().
T QUESO::ScalarSequence< T >::subInterQuantileRange | ( | unsigned int | initialPos | ) | const |
Returns the interquartile range of the values in the sub-sequence.
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)
Definition at line 1963 of file ScalarSequence.C.
References QUESO::queso_require_equal_to_msg, QUESO::ScalarSequence< T >::subSequenceSize(), and QUESO::BaseEnvironment::worldRank().
Referenced by QUESO::SequenceOfVectors< V, M >::subInterQuantileRange().
const T & QUESO::ScalarSequence< T >::subMaxPlain | ( | ) | const |
Finds the maximum value of the sub-sequence of scalars.
Definition at line 369 of file ScalarSequence.C.
Referenced by QUESO::BaseVectorSequence< V, M >::subPositionsOfMaximum(), QUESO::ScalarSequence< T >::subPositionsOfMaximum(), QUESO::BaseVectorSequence< V, M >::unifiedPositionsOfMaximum(), and QUESO::ScalarSequence< T >::unifiedPositionsOfMaximum().
T QUESO::ScalarSequence< T >::subMeanCltStd | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
const T & | meanValue | ||
) | const |
Definition at line 3405 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::subMeanCltStd().
T QUESO::ScalarSequence< T >::subMeanExtra | ( | unsigned int | initialPos, |
unsigned int | numPos | ||
) | const |
Finds the mean value of the sub-sequence, considering numPos
positions starting at position initialPos
.
Definition at line 806 of file ScalarSequence.C.
Referenced by QUESO::ScalarSequence< T >::bmm(), QUESO::ScalarSequence< T >::geweke(), QUESO::ArrayOfSequences< V, M >::mean(), and QUESO::SequenceOfVectors< V, M >::subMeanExtra().
const T & QUESO::ScalarSequence< T >::subMeanPlain | ( | ) | const |
Finds the mean value of the sub-sequence of scalars.
Definition at line 395 of file ScalarSequence.C.
T QUESO::ScalarSequence< T >::subMedianExtra | ( | unsigned int | initialPos, |
unsigned int | numPos | ||
) | const |
Finds the median value of the sub-sequence, considering numPos
positions starting at position initialPos
.
Definition at line 922 of file ScalarSequence.C.
References QUESO::ScalarSequence< T >::resizeSequence(), and QUESO::ScalarSequence< T >::subSort().
Referenced by QUESO::SequenceOfVectors< V, M >::subMedianExtra().
const T & QUESO::ScalarSequence< T >::subMedianPlain | ( | ) | const |
Finds the median value of the sub-sequence of scalars.
Definition at line 419 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::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 at position initialPos
.
Definition at line 1469 of file ScalarSequence.C.
Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::ArrayOfSequences< V, M >::minMax(), and QUESO::SequenceOfVectors< V, M >::subMinMaxExtra().
const T & QUESO::ScalarSequence< T >::subMinPlain | ( | ) | const |
Finds the minimum value of the sub-sequence of scalars.
Definition at line 343 of file ScalarSequence.C.
T QUESO::ScalarSequence< 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 initialPos
and of mean meanValue
.
Output: calculated population variance of the sub-sequence of scalars. The population variance \( \sigma^2 \) is defined by \( \sigma^2 = \frac{1}{n-1} \sum_{i=1}^n \left(y_i - \mu \right)^2 \), where \( \mu \) is the sample mean and \( n \) is the sample size. This procedure lets the users choose the initial position and the number of elements of the sequence which will be used to evaluate the population variance .
Definition at line 1186 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::subPopulationVariance().
T QUESO::ScalarSequence< T >::subPositionsOfMaximum | ( | const ScalarSequence< T > & | subCorrespondingScalarValues, |
ScalarSequence< T > & | subPositionsOfMaximum | ||
) |
Finds the positions where the maximum element occurs in the sub-sequence.
Definition at line 2477 of file ScalarSequence.C.
References QUESO::queso_require_equal_to_msg, QUESO::ScalarSequence< T >::resizeSequence(), QUESO::ScalarSequence< T >::subMaxPlain(), and QUESO::ScalarSequence< T >::subSequenceSize().
T QUESO::ScalarSequence< 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 position initialPos
and of mean meanValue
.
Definition at line 1098 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::subSampleStd().
T QUESO::ScalarSequence< 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 initialPos
and of mean meanVec
.
Output: calculated sample variance of the sub-sequence of scalars. The sample variance \( \sigma_y^2 \) is the second sample central moment and is defined by \( \sigma_y^2 = \frac{1}{n} \sum_{i=1}^n \left(y_i - \mu \right)^2 \), where \( \mu \) is the sample mean and \( n \) is the sample size. This procedure lets the users choose the initial position and the number of elements of the sequence which will be used to evaluate the sample variance.
Definition at line 1012 of file ScalarSequence.C.
Referenced by QUESO::ScalarSequence< T >::bmm(), and QUESO::SequenceOfVectors< V, M >::subSampleVarianceExtra().
const T & QUESO::ScalarSequence< T >::subSampleVariancePlain | ( | ) | const |
Finds the variance of a sample of the sub-sequence of scalars.
Definition at line 443 of file ScalarSequence.C.
T QUESO::ScalarSequence< 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-sequence.
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 × (iqrValue
) × n^{-1/5}, where iqrValue
is the interquartile range OutputValue = 0.90 × minimum(standard deviation, iqrValue
/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.
Definition at line 2167 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::subScalesForKde().
unsigned int QUESO::ScalarSequence< T >::subSequenceSize | ( | ) | const |
Size of the sub-sequence of scalars.
Definition at line 136 of file ScalarSequence.C.
Referenced by QUESO::ScalarSequence< T >::append(), QUESO::ScalarSequence< T >::bmm(), QUESO::ComputeCovCorrBetweenScalarSequences(), QUESO::ComputeSubGaussian2dKde(), QUESO::ScalarSequence< T >::copy(), QUESO::MLSampling< P_V, P_M >::generateBalLinkedChains_all(), QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step02_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step03_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step04_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step05_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step09_all(), QUESO::MLSampling< P_V, P_M >::generateUnbLinkedChains_all(), QUESO::SubF1F2Gaussian2dKdeIntegral(), QUESO::ScalarSequence< T >::subInterQuantileRange(), QUESO::BaseVectorSequence< V, M >::subPositionsOfMaximum(), QUESO::ScalarSequence< T >::subPositionsOfMaximum(), QUESO::ScalarSequence< T >::unifiedInterQuantileRange(), QUESO::BaseVectorSequence< V, M >::unifiedPositionsOfMaximum(), QUESO::ScalarSequence< T >::unifiedPositionsOfMaximum(), and QUESO::ScalarSequence< T >::unifiedSort().
void QUESO::ScalarSequence< T >::subSort | ( | unsigned int | initialPos, |
ScalarSequence< T > & | sortedSequence | ||
) | const |
Sorts the sub-sequence of scalars.
Definition at line 1842 of file ScalarSequence.C.
References QUESO::ScalarSequence< T >::resizeSequence(), and QUESO::ScalarSequence< T >::subSort().
Referenced by QUESO::ScalarSequence< T >::subCdfPercentageRange(), QUESO::SequenceOfVectors< V, M >::subCdfStacc(), QUESO::ScalarSequence< T >::subMedianExtra(), and QUESO::ScalarSequence< T >::subSort().
|
private |
Sorts the sequence of scalars in the private attribute m_seq
.
Definition at line 3223 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::subUniformlySampledCdf | ( | unsigned int | numIntervals, |
T & | minDomainValue, | ||
T & | maxDomainValue, | ||
std::vector< T > & | cdfValues | ||
) | const |
Uniformly samples from the CDF from the sub-sequence.
Definition at line 539 of file ScalarSequence.C.
Referenced by QUESO::ArrayOfSequences< V, M >::uniformlySampledCdf().
void QUESO::ScalarSequence< T >::subUniformlySampledMdf | ( | unsigned int | numIntervals, |
T & | minDomainValue, | ||
T & | maxDomainValue, | ||
std::vector< T > & | mdfValues | ||
) | const |
Definition at line 3364 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::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.
Definition at line 717 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::subWeightCdf | ( | unsigned int | numIntervals, |
UniformOneDGrid< T > *& | gridValues, | ||
std::vector< T > & | cdfValues | ||
) | const |
Finds the Weighted Cumulative Distribution Function (CDF) of the sub-sequence of scalars.
Definition at line 769 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::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.
TODO:Note that this method is exactly the same as subBasicHistogram().
It requires the specification of the maximum (maxHorizontalValue
) and the minimum (minHorizontalValue
) values if the data and the initial position (initialPos
) from where the data will be considered. Output: grid values that will act as the center of each bin (gridValues
) and the number of data occurrences in each bin (bins
).
Definition at line 1748 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::subWeightHistogram | ( | unsigned int | initialPos, |
const T & | minHorizontalValue, | ||
const T & | maxHorizontalValue, | ||
std::vector< T > & | gridValues, | ||
std::vector< unsigned int > & | bins | ||
) | const |
Calculates the weighted histogram of the sub-sequence.
In this method, gridValues
is a std::vector<T>, but internally, it will be copied to an structure of the type UniformOneDGrid<T>.
Definition at line 1790 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::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.
Given the allowed sub environments (allowedSubEnvIds
) that are allowed to write to file, together with the file name and type (fileName
, fileType
), it writes the entire sub- sequence to the file. The sum of the initial position of the sequence (initialPos
) with the number of positions that will be written (numPos
) must equal the size of the sequence.
Definition at line 2537 of file ScalarSequence.C.
Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain(), and QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence().
void QUESO::ScalarSequence< T >::subWriteContents | ( | unsigned int | initialPos, |
unsigned int | numPos, | ||
std::ofstream & | ofs, | ||
const std::string & | fileType | ||
) | const |
Writes the sub-sequence to a file.
Uses object of the type std::ofstream.
Definition at line 2612 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::unifiedCdfPercentageRange | ( | bool | useOnlyInter0Comm, |
unsigned int | initialPos, | ||
unsigned int | numPos, | ||
double | range, | ||
T & | lowerValue, | ||
T & | upperValue | ||
) | const |
Definition at line 3764 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::unifiedCdfPercentageRange().
void QUESO::ScalarSequence< T >::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.
Definition at line 2308 of file ScalarSequence.C.
References QUESO::MiscGaussianDensity().
Referenced by QUESO::SequenceOfVectors< V, M >::unifiedGaussian1dKde().
void QUESO::ScalarSequence< T >::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.
Definition at line 1616 of file ScalarSequence.C.
References QUESO::queso_require_equal_to_msg.
Referenced by QUESO::SequenceOfVectors< V, M >::unifiedHistogram().
T QUESO::ScalarSequence< T >::unifiedInterQuantileRange | ( | bool | useOnlyInter0Comm, |
unsigned int | initialPos | ||
) | const |
Returns the interquartile range of the values in the unified sequence.
Definition at line 2076 of file ScalarSequence.C.
References QUESO::queso_require_equal_to_msg, and QUESO::ScalarSequence< T >::subSequenceSize().
Referenced by QUESO::SequenceOfVectors< V, M >::unifiedInterQuantileRange().
const T & QUESO::ScalarSequence< T >::unifiedMaxPlain | ( | bool | useOnlyInter0Comm | ) | const |
Finds the maximum value of the unified sequence of scalars.
Definition at line 382 of file ScalarSequence.C.
Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence_Step03_inter0().
T QUESO::ScalarSequence< T >::unifiedMeanCltStd | ( | bool | useOnlyInter0Comm, |
unsigned int | initialPos, | ||
unsigned int | localNumPos, | ||
const T & | unifiedMeanValue | ||
) | const |
Definition at line 3434 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::unifiedMeanCltStd().
T QUESO::ScalarSequence< 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
.
Definition at line 844 of file ScalarSequence.C.
Referenced by QUESO::ComputeCovCorrBetweenScalarSequences(), QUESO::MLSampling< P_V, P_M >::generateSequence(), and QUESO::SequenceOfVectors< V, M >::unifiedMeanExtra().
const T & QUESO::ScalarSequence< T >::unifiedMeanPlain | ( | bool | useOnlyInter0Comm | ) | const |
Finds the mean value of the unified sequence of scalars.
Definition at line 407 of file ScalarSequence.C.
Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence().
T QUESO::ScalarSequence< 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 initialPos
.
Definition at line 965 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::unifiedMedianExtra().
const T & QUESO::ScalarSequence< T >::unifiedMedianPlain | ( | bool | useOnlyInter0Comm | ) | const |
Finds the median value of the unified sequence of scalars.
Definition at line 431 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::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 starting at position initialPos
.
Definition at line 1498 of file ScalarSequence.C.
Referenced by QUESO::MLSampling< P_V, P_M >::generateSequence(), and QUESO::SequenceOfVectors< V, M >::unifiedMinMaxExtra().
const T & QUESO::ScalarSequence< T >::unifiedMinPlain | ( | bool | useOnlyInter0Comm | ) | const |
Finds the minimum value of the unified sequence of scalars.
Definition at line 356 of file ScalarSequence.C.
T QUESO::ScalarSequence< 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 position initialPos
and of mean meanValue
.
Output: calculated population variance of the unified sequence of scalars.
Definition at line 1213 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::unifiedPopulationVariance().
T QUESO::ScalarSequence< T >::unifiedPositionsOfMaximum | ( | const ScalarSequence< T > & | subCorrespondingScalarValues, |
ScalarSequence< T > & | unifiedPositionsOfMaximum | ||
) |
Finds the positions where the maximum element occurs in the unified sequence.
Definition at line 2507 of file ScalarSequence.C.
References QUESO::queso_require_equal_to_msg, QUESO::ScalarSequence< T >::resizeSequence(), QUESO::ScalarSequence< T >::subMaxPlain(), and QUESO::ScalarSequence< T >::subSequenceSize().
void QUESO::ScalarSequence< T >::unifiedReadContents | ( | const std::string & | fileName, |
const std::string & | fileType, | ||
const unsigned int | subSequenceSize | ||
) |
Reads the unified sequence from a file.
Definition at line 2865 of file ScalarSequence.C.
References QUESO::FilePtrSetStruct::h5Var, QUESO::FilePtrSetStruct::ifsVar, QUESO::MiscGetEllapsedSeconds(), QUESO::queso_require_equal_to_msg, QUESO::queso_require_not_equal_to_msg, and QUESO::UQ_OK_RC.
Referenced by QUESO::MLSampling< P_V, P_M >::restartML().
T QUESO::ScalarSequence< 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 starting at position initialPos
and of mean unifiedMeanValue
.
Definition at line 1126 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::unifiedSampleStd().
T QUESO::ScalarSequence< 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 initialPos
and of mean meanVec
.
Output:
samVec | is the vector of the calculated sample variance of the unified sequence of scalars. |
Definition at line 1039 of file ScalarSequence.C.
Referenced by QUESO::ComputeCovCorrBetweenScalarSequences(), and QUESO::SequenceOfVectors< V, M >::unifiedSampleVarianceExtra().
const T & QUESO::ScalarSequence< T >::unifiedSampleVariancePlain | ( | bool | useOnlyInter0Comm | ) | const |
Finds the variance of a sample of the unified sequence of scalars.
Definition at line 455 of file ScalarSequence.C.
T QUESO::ScalarSequence< 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.
Definition at line 2207 of file ScalarSequence.C.
Referenced by QUESO::SequenceOfVectors< V, M >::unifiedScalesForKde().
unsigned int QUESO::ScalarSequence< T >::unifiedSequenceSize | ( | bool | useOnlyInter0Comm | ) | const |
Size of the unified sequence of scalars.
Definition at line 143 of file ScalarSequence.C.
Referenced by QUESO::MLSampling< P_V, P_M >::checkpointML(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step02_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step03_inter0(), QUESO::MLSampling< P_V, P_M >::generateSequence_Step05_inter0(), and QUESO::MLSampling< P_V, P_M >::generateSequence_Step09_all().
void QUESO::ScalarSequence< T >::unifiedSort | ( | bool | useOnlyInter0Comm, |
unsigned int | initialPos, | ||
ScalarSequence< T > & | unifiedSortedSequence | ||
) | const |
Sorts the unified sequence of scalars.
Definition at line 1859 of file ScalarSequence.C.
References QUESO::queso_require_equal_to_msg, QUESO::ScalarSequence< T >::rawData(), QUESO::ScalarSequence< T >::resizeSequence(), and QUESO::ScalarSequence< T >::subSequenceSize().
void QUESO::ScalarSequence< T >::unifiedUniformlySampledCdf | ( | bool | useOnlyInter0Comm, |
unsigned int | numIntervals, | ||
T & | unifiedMinDomainValue, | ||
T & | unifiedMaxDomainValue, | ||
std::vector< T > & | unifiedCdfValues | ||
) | const |
Uniformly samples from the CDF from the unified sequence.
Definition at line 581 of file ScalarSequence.C.
void QUESO::ScalarSequence< T >::unifiedWriteContents | ( | const std::string & | fileName, |
const std::string & | fileType | ||
) | const |
Writes the unified sequence to a file.
Writes the unified sequence in Matlab/Octave format or, if enabled, in HDF5 format.
Definition at line 2640 of file ScalarSequence.C.
References QUESO::FilePtrSetStruct::h5Var, QUESO::MiscGetEllapsedSeconds(), QUESO::FilePtrSetStruct::ofsVar, and QUESO::UQ_OK_RC.
Referenced by QUESO::MLSampling< P_V, P_M >::checkpointML(), QUESO::MLSampling< P_V, P_M >::generateSequence(), QUESO::MetropolisHastingsSG< P_V, P_M >::generateSequence(), QUESO::MLSampling< P_V, P_M >::generateSequence_Level0_all(), and QUESO::MLSampling< P_V, P_M >::generateSequence_Step11_inter0().
|
private |
Helper function to write header info for matlab files from one chain.
Definition at line 2844 of file ScalarSequence.C.
|
private |
Helper function to write txt info for matlab files.
Definition at line 2856 of file ScalarSequence.C.
|
private |
Helper function to write header info for matlab files from all chains.
Definition at line 2832 of file ScalarSequence.C.
|
private |
Definition at line 525 of file ScalarSequence.h.
|
private |
Definition at line 526 of file ScalarSequence.h.
Referenced by QUESO::ScalarSequence< T >::copy().
|
private |
Definition at line 527 of file ScalarSequence.h.
Referenced by QUESO::ScalarSequence< T >::append(), and QUESO::ScalarSequence< T >::copy().
|
mutableprivate |
Definition at line 531 of file ScalarSequence.h.
|
mutableprivate |
Definition at line 533 of file ScalarSequence.h.
|
mutableprivate |
Definition at line 535 of file ScalarSequence.h.
|
mutableprivate |
Definition at line 529 of file ScalarSequence.h.
|
mutableprivate |
Definition at line 537 of file ScalarSequence.h.
|
mutableprivate |
Definition at line 532 of file ScalarSequence.h.
|
mutableprivate |
Definition at line 534 of file ScalarSequence.h.
|
mutableprivate |
Definition at line 536 of file ScalarSequence.h.
|
mutableprivate |
Definition at line 530 of file ScalarSequence.h.
|
mutableprivate |
Definition at line 538 of file ScalarSequence.h.