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