25 #include <queso/LogNormalVectorRV.h>
26 #include <queso/GslVector.h>
27 #include <queso/GslMatrix.h>
32 template<
class V,
class M>
36 const V& lawExpVector,
37 const V& lawVarVector)
39 BaseVectorRV<V,M>(((std::string)(prefix)+
"gau").c_str(),imageSet)
51 double smallerOfMaxValues = imageBox->
maxValues().getMinValue();
52 double smallerOfMinValues = imageBox->
minValues().getMinValue();
54 if( smallerOfMinValues < 0 )
56 std::cerr <<
"In LogNormalVectorRV<V,M>::constructor()\n"
57 <<
"LogNormal distribution is only defined in (0, infinity).\n"
58 <<
"The data provided is: \n"
60 <<
"Sampling will not cover all interval.\n"
66 "LogNormalVectorRealizer<V,M>::constructor()",
67 "invalid input: LogNormal distribution is only defined in (0, infinity), and min(m_maxValues)<0");
77 M lowerCholLawCovMatrix(lawVarVector);
78 int iRC = lowerCholLawCovMatrix.chol();
79 lowerCholLawCovMatrix.zeroUpper(
false);
81 std::cerr <<
"In LogNormalVectorRV<V,M>::constructor() [1]: chol failed, will use svd\n";
83 *
m_env.
subDisplayFile() <<
"In LogNormalVectorRV<V,M>::constructor() [1]: chol failed; will use svd; lawVarVector contents are\n";
87 M matLaw(lawVarVector);
88 M matU (lawVarVector);
89 M matVt (
m_imageSet.vectorSpace().zeroVector());
90 V vecS (
m_imageSet.vectorSpace().zeroVector());
91 iRC = matLaw.svd(matU,vecS,matVt);
94 "LogNormalVectorRV<V,M>::constructor() [1]",
95 "Cholesky decomposition of covariance matrix failed.");
109 lowerCholLawCovMatrix);
123 template<
class V,
class M>
133 template <
class V,
class M>
137 os <<
"LogNormalVectorRV<V,M>::print() says, 'Please implement me.'" << std::endl;
Class representing a subset of a vector space shaped like a hypercube.
const BaseVectorCdf< V, M > * m_unifiedCdf
A templated base class for handling vector RV.
A class representing a LogNormal vector RV.
int worldRank() const
Returns the process world rank.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
const BaseEnvironment & m_env
virtual ~LogNormalVectorRV()
Virtual destructor.
const VectorSet< V, M > & m_imageSet
A class for handling Log-Normal joint PDFs.
const BaseVectorCdf< V, M > * m_subCdf
BaseVectorRealizer< V, M > * m_realizer
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
A class for handling sampling from a Log-Normal probability density distribution. ...
A templated class for handling sets.
const BaseVectorMdf< V, M > * m_mdf
const VectorSet< V, M > & imageSet() const
Image set of the vector RV; access to private attribute m_imageSet.
const V & minValues() const
Vector of the minimum values of the box subset.
BaseJointPdf< V, M > * m_pdf
const V & maxValues() const
Vector of the maximum values of the box subset.
void print(std::ostream &os) const
TODO: Prints the vector RV.
unsigned int displayVerbosity() const
LogNormalVectorRV(const char *prefix, const VectorSet< V, M > &imageSet, const V &lawExpVector, const V &lawVarVector)
Constructor.