queso-0.57.1
|
A templated (base) class for handling joint PDFs. More...
#include <JointPdf.h>
Public Member Functions | |
Constructor/Destructor methods | |
BaseJointPdf (const char *prefix, const VectorSet< V, M > &domainSet) | |
Default constructor. More... | |
virtual | ~BaseJointPdf () |
Destructor. More... | |
Mathematical methods | |
virtual double | actualValue (const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const =0 |
Actual value of the PDF (scalar function). More... | |
virtual void | distributionMean (V &meanVector) const |
virtual void | distributionVariance (M &covMatrix) const |
virtual void | setNormalizationStyle (unsigned int value) const |
void | setLogOfNormalizationFactor (double value) const |
Sets a logarithmic value to be used in the normalization factor (stored in the protected attribute m_normalizationStyle.) More... | |
virtual double | computeLogOfNormalizationFactor (unsigned int numSamples, bool m_logOfNormalizationFactor) const =0 |
Computes the logarithm of the normalization factor. See template specialization. More... | |
virtual void | print (std::ostream &os) const |
Print method. Non-pure for backwards compatibility. More... | |
Public Member Functions inherited from QUESO::BaseScalarFunction< V, M > | |
void | setFiniteDifferenceStepSize (double fdStepSize) |
Sets the step size for finite differencing gradients. More... | |
void | setFiniteDifferenceStepSize (unsigned int i, double fdStepSize) |
BaseScalarFunction (const char *prefix, const VectorSet< V, M > &domainSet) | |
Default constructor. More... | |
virtual | ~BaseScalarFunction () |
Destructor. More... | |
const VectorSet< V, M > & | domainSet () const |
Access to the protected attribute m_domainSet: domain set of the scalar function. More... | |
virtual double | lnValue (const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const |
Logarithm of the value of the scalar function. Deprecated. More... | |
virtual double | lnValue (const V &domainVector) const |
Returns the logarithm of the function at domainVector . More... | |
virtual double | lnValue (const V &domainVector, V &gradVector) const |
Returns the logarithm of the function and its gradient at domainVector . More... | |
virtual double | lnValue (const V &domainVector, V &gradVector, const V &domainDirection, V &hessianEffect) const |
Protected Member Functions | |
double | commonComputeLogOfNormalizationFactor (unsigned int numSamples, bool updateFactorInternally) const |
Common method (to the derived classes) to compute the logarithm of the normalization factor. More... | |
Protected Attributes | |
unsigned int | m_normalizationStyle |
double | m_logOfNormalizationFactor |
Protected Attributes inherited from QUESO::BaseScalarFunction< V, M > | |
const BaseEnvironment & | m_env |
std::string | m_prefix |
const VectorSet< V, M > & | m_domainSet |
Domain set of the scalar function. More... | |
A templated (base) class for handling joint PDFs.
This class allows the mathematical definition of a Joint PDF, which is a scalar function such as * \( \pi: B \subset R^n \rightarrow R \); ie a function of one or more variables that has always one-dimensional range. QUESO currently supports basic PDFs such as uniform and Gaussian and also more complex PDFs, such as the ones coming from a Bayesian analysis. They are implemented in the derived classes UniformJointPdf, GaussianJointPdf, and BayesianJointPdf, respectively. The posterior PDF may be represented within QUESO by GenericJointPdf.
Definition at line 55 of file JointPdf.h.
QUESO::BaseJointPdf< V, M >::BaseJointPdf | ( | const char * | prefix, |
const VectorSet< V, M > & | domainSet | ||
) |
Default constructor.
Instantiates an object of the class, i.e. a scalar function, given a prefix and its domain.
Definition at line 33 of file JointPdf.C.
References QUESO::BaseEnvironment::displayVerbosity(), QUESO::BaseScalarFunction< V, M >::m_env, QUESO::BaseScalarFunction< V, M >::m_prefix, and QUESO::BaseEnvironment::subDisplayFile().
|
virtual |
|
pure virtual |
Actual value of the PDF (scalar function).
Implements QUESO::BaseScalarFunction< V, M >.
Implemented in QUESO::InvLogitGaussianJointPdf< V, M >, QUESO::GammaJointPdf< V, M >, QUESO::ConcatenatedJointPdf< V, M >, QUESO::GaussianJointPdf< V, M >, QUESO::LogNormalJointPdf< V, M >, QUESO::BayesianJointPdf< V, M >, QUESO::PoweredJointPdf< V, M >, QUESO::InverseGammaJointPdf< V, M >, QUESO::GenericJointPdf< V, M >, QUESO::JeffreysJointPdf< V, M >, QUESO::BetaJointPdf< V, M >, QUESO::WignerJointPdf< V, M >, and QUESO::UniformJointPdf< V, M >.
|
protected |
Common method (to the derived classes) to compute the logarithm of the normalization factor.
The normalization factor is calculated by finding the max and min values of the domain set and then drawing numSamples
samples from a uniform distribution varying from min
to max
. Such samples are averaged and the logarithmic value is assigned to protected attribute m_logOfNormalizationFactor if the parameter m_logOfNormalizationFactor
is true.
Definition at line 115 of file JointPdf.C.
References QUESO::BoxSubset< V, M >::maxValues(), QUESO::BoxSubset< V, M >::minValues(), and QUESO::queso_isnan().
Referenced by QUESO::GenericJointPdf< V, M >::computeLogOfNormalizationFactor(), QUESO::UniformJointPdf< V, M >::computeLogOfNormalizationFactor(), QUESO::WignerJointPdf< V, M >::computeLogOfNormalizationFactor(), QUESO::BetaJointPdf< V, M >::computeLogOfNormalizationFactor(), QUESO::InverseGammaJointPdf< V, M >::computeLogOfNormalizationFactor(), QUESO::LogNormalJointPdf< V, M >::computeLogOfNormalizationFactor(), QUESO::JeffreysJointPdf< V, M >::computeLogOfNormalizationFactor(), QUESO::GaussianJointPdf< V, M >::computeLogOfNormalizationFactor(), QUESO::GammaJointPdf< V, M >::computeLogOfNormalizationFactor(), and QUESO::InvLogitGaussianJointPdf< V, M >::computeLogOfNormalizationFactor().
|
pure virtual |
Computes the logarithm of the normalization factor. See template specialization.
Implemented in QUESO::InvLogitGaussianJointPdf< V, M >, QUESO::GammaJointPdf< V, M >, QUESO::ConcatenatedJointPdf< V, M >, QUESO::GaussianJointPdf< V, M >, QUESO::BayesianJointPdf< V, M >, QUESO::BayesianJointPdf< QUESO::GslVector, QUESO::GslMatrix >, QUESO::JeffreysJointPdf< V, M >, QUESO::LogNormalJointPdf< V, M >, QUESO::BetaJointPdf< V, M >, QUESO::InverseGammaJointPdf< V, M >, QUESO::PoweredJointPdf< V, M >, QUESO::WignerJointPdf< V, M >, QUESO::UniformJointPdf< V, M >, and QUESO::GenericJointPdf< V, M >.
|
virtual |
Mean value of the underlying random variable. Not implemented in base class, but not pure virtual for backwards compatibility reasons.
Reimplemented in QUESO::InvLogitGaussianJointPdf< V, M >, QUESO::GammaJointPdf< V, M >, QUESO::GaussianJointPdf< V, M >, QUESO::ConcatenatedJointPdf< V, M >, QUESO::BayesianJointPdf< V, M >, QUESO::LogNormalJointPdf< V, M >, QUESO::JeffreysJointPdf< V, M >, QUESO::BetaJointPdf< V, M >, QUESO::InverseGammaJointPdf< V, M >, QUESO::WignerJointPdf< V, M >, and QUESO::UniformJointPdf< V, M >.
Definition at line 62 of file JointPdf.C.
|
virtual |
Covariance matrix of the underlying random variable. Not implemented in base class, but not pure virtual for backwards compatibility reasons.
Reimplemented in QUESO::InvLogitGaussianJointPdf< V, M >, QUESO::GammaJointPdf< V, M >, QUESO::GaussianJointPdf< V, M >, QUESO::ConcatenatedJointPdf< V, M >, QUESO::BayesianJointPdf< V, M >, QUESO::LogNormalJointPdf< V, M >, QUESO::JeffreysJointPdf< V, M >, QUESO::BetaJointPdf< V, M >, QUESO::InverseGammaJointPdf< V, M >, QUESO::WignerJointPdf< V, M >, and QUESO::UniformJointPdf< V, M >.
Definition at line 70 of file JointPdf.C.
|
virtual |
Print method. Non-pure for backwards compatibility.
Reimplemented in QUESO::InvLogitGaussianJointPdf< V, M >, and QUESO::GaussianJointPdf< V, M >.
Definition at line 94 of file JointPdf.C.
void QUESO::BaseJointPdf< V, M >::setLogOfNormalizationFactor | ( | double | value | ) | const |
Sets a logarithmic value to be used in the normalization factor (stored in the protected attribute m_normalizationStyle.)
Definition at line 86 of file JointPdf.C.
|
virtual |
Sets a value to be used in the normalization style. Default value is zero.
The value is stored in m_normalizationStyle.
If the normalization style is zero, one should compute analytical normalization constants in lnValue and actualValue. It doesn't appear to be used in many of of the computeLogOfNormalizationFactor methods in derived classes.
Reimplemented in QUESO::ConcatenatedJointPdf< V, M >, QUESO::BayesianJointPdf< V, M >, QUESO::BayesianJointPdf< QUESO::GslVector, QUESO::GslMatrix >, and QUESO::PoweredJointPdf< V, M >.
Definition at line 78 of file JointPdf.C.
|
mutableprotected |
Definition at line 122 of file JointPdf.h.
|
mutableprotected |
Flag to decide which style of normalisation to use. The constructor sets this to zero in the initialisation list.
Definition at line 121 of file JointPdf.h.