queso-0.57.1
|
A class for handling Bayesian joint PDFs. More...
#include <ScalarFunctionSynchronizer.h>
Public Member Functions | |
Constructor/Destructor methods | |
BayesianJointPdf (const char *prefix, const BaseJointPdf< V, M > &priorDensity, const BaseScalarFunction< V, M > &likelihoodFunction, double likelihoodExponent, const VectorSet< V, M > &intersectionDomain) | |
Default constructor. More... | |
~BayesianJointPdf () | |
Destructor. More... | |
Math methods | |
double | actualValue (const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const |
Actual value of the PDF (scalar function). More... | |
virtual double | lnValue (const V &domainVector) const |
Computes the logarithm of the value of the function. More... | |
virtual double | lnValue (const V &domainVector, V &gradVector) const |
Returns the logarithm of the function and its gradient at domainVector . More... | |
virtual void | distributionMean (V &meanVector) const |
Mean value of the underlying random variable. More... | |
virtual void | distributionVariance (M &covMatrix) const |
Covariance matrix of the underlying random variable. More... | |
double | computeLogOfNormalizationFactor (unsigned int numSamples, bool updateFactorInternally) const |
TODO: Computes the logarithm of the normalization factor. More... | |
void | setNormalizationStyle (unsigned int value) const |
Sets a value to be used in the normalization style of the prior density PDF (ie, protected attribute m_priorDensity). More... | |
double | lastComputedLogPrior () const |
Returns the logarithm of the last computed Prior value. Access to protected attribute m_lastComputedLogPrior. More... | |
double | lastComputedLogLikelihood () const |
Returns the logarithm of the last computed likelihood value. Access to protected attribute m_lastComputedLogLikelihood. More... | |
Public Member Functions inherited from QUESO::BaseJointPdf< V, M > | |
BaseJointPdf (const char *prefix, const VectorSet< V, M > &domainSet) | |
Default constructor. More... | |
virtual | ~BaseJointPdf () |
Destructor. More... | |
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 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, V &gradVector, const V &domainDirection, V &hessianEffect) const |
Protected Attributes | |
const BaseJointPdf< V, M > & | m_priorDensity |
const BaseScalarFunction< V, M > & | m_likelihoodFunction |
double | m_likelihoodExponent |
double | m_lastComputedLogPrior |
double | m_lastComputedLogLikelihood |
V | m_tmpVector1 |
V | m_tmpVector2 |
M * | m_tmpMatrix |
Protected Attributes inherited from QUESO::BaseJointPdf< V, M > | |
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... | |
Additional Inherited Members | |
Protected Member Functions inherited from QUESO::BaseJointPdf< V, M > | |
double | commonComputeLogOfNormalizationFactor (unsigned int numSamples, bool updateFactorInternally) const |
Common method (to the derived classes) to compute the logarithm of the normalization factor. More... | |
A class for handling Bayesian joint PDFs.
This class allows the mathematical definition of a Bayesian Joint PDF.
Definition at line 36 of file ScalarFunctionSynchronizer.h.
QUESO::BayesianJointPdf< V, M >::BayesianJointPdf | ( | const char * | prefix, |
const BaseJointPdf< V, M > & | priorDensity, | ||
const BaseScalarFunction< V, M > & | likelihoodFunction, | ||
double | likelihoodExponent, | ||
const VectorSet< V, M > & | intersectionDomain | ||
) |
Default constructor.
Instantiates an object of this class given a prefix and a scalar function. The domain of the scalar function is assigned to the protected attribute m_domainSet, and the scalar fiction is also itself copied to the protected attribute m_scalarFunction.
Definition at line 33 of file BayesianJointPdf.C.
QUESO::BayesianJointPdf< V, M >::~BayesianJointPdf | ( | ) |
|
virtual |
Actual value of the PDF (scalar function).
If the exponent of the likelihood function (likelihoodExponent) is zero, i.e. the likelihood is constant and unitary, then the actual value is the value of the prior PDF; otherwise, the actual value is scaled (multiplied) by a power of the value of the likelihood function.
Implements QUESO::BaseJointPdf< V, M >.
Definition at line 82 of file BayesianJointPdf.C.
References QUESO::queso_require_equal_to_msg.
|
virtual |
TODO: Computes the logarithm of the normalization factor.
Implements QUESO::BaseJointPdf< V, M >.
Definition at line 236 of file BayesianJointPdf.C.
References QUESO::queso_isnan().
|
inlinevirtual |
Mean value of the underlying random variable.
Reimplemented from QUESO::BaseJointPdf< V, M >.
Definition at line 81 of file BayesianJointPdf.h.
|
inlinevirtual |
Covariance matrix of the underlying random variable.
Reimplemented from QUESO::BaseJointPdf< V, M >.
Definition at line 84 of file BayesianJointPdf.h.
double QUESO::BayesianJointPdf< V, M >::lastComputedLogLikelihood | ( | ) | const |
Returns the logarithm of the last computed likelihood value. Access to protected attribute m_lastComputedLogLikelihood.
Definition at line 75 of file BayesianJointPdf.C.
double QUESO::BayesianJointPdf< V, M >::lastComputedLogPrior | ( | ) | const |
Returns the logarithm of the last computed Prior value. Access to protected attribute m_lastComputedLogPrior.
Definition at line 68 of file BayesianJointPdf.C.
|
virtual |
Computes the logarithm of the value of the function.
Analogously to the method actualValue(), if the exponent of the likelihood function (likelihoodExponent) is zero then the Logarithm of the value of the function is the logarithm of the value of the prior PDF; otherwise, the value is scaled (added) by a power of the value of the likelihood function.
Reimplemented from QUESO::BaseScalarFunction< V, M >.
Definition at line 141 of file BayesianJointPdf.C.
|
virtual |
Returns the logarithm of the function and its gradient at domainVector
.
Default implementation calls above method successively to fill up gradVector
with a finite difference approximation.
Note, gradVector should be filled with the gradient of the logarithm of the function, not the gradient of the function.
QUESO calls this method when it needs to evaluate the function, needs first order derivative information, but doesn't need second order derivative information.
Reimplemented from QUESO::BaseScalarFunction< V, M >.
Definition at line 184 of file BayesianJointPdf.C.
|
virtual |
Sets a value to be used in the normalization style of the prior density PDF (ie, protected attribute m_priorDensity).
Reimplemented from QUESO::BaseJointPdf< V, M >.
Definition at line 60 of file BayesianJointPdf.C.
|
mutableprotected |
Definition at line 116 of file BayesianJointPdf.h.
|
mutableprotected |
Definition at line 115 of file BayesianJointPdf.h.
|
protected |
Definition at line 114 of file BayesianJointPdf.h.
|
protected |
Definition at line 113 of file BayesianJointPdf.h.
|
protected |
Definition at line 112 of file BayesianJointPdf.h.
|
mutableprotected |
Definition at line 120 of file BayesianJointPdf.h.
|
mutableprotected |
Definition at line 118 of file BayesianJointPdf.h.
|
mutableprotected |
Definition at line 119 of file BayesianJointPdf.h.