queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::LikelihoodBase< V, M > Class Template Referenceabstract

Base class for canned Gaussian likelihoods. More...

#include <LikelihoodBase.h>

Inheritance diagram for QUESO::LikelihoodBase< V, M >:
QUESO::BaseScalarFunction< V, M > QUESO::GaussianLikelihoodBlockDiagonalCovariance< V, M > QUESO::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients< V, M > QUESO::GaussianLikelihoodDiagonalCovariance< V, M > QUESO::GaussianLikelihoodFullCovariance< V, M > QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient< V, M > QUESO::GaussianLikelihoodScalarCovariance< V, M >

Public Member Functions

virtual void evaluateModel (const V &domainVector, const V *domainDirection, V &modelOutput, V *gradVector, M *hessianMatrix, V *hessianEffect) const
 Deprecated. Evaluates the user's model at the point domainVector. More...
 
virtual void evaluateModel (const V &domainVector, V &modelOutput) const
 Evaluates the user's model at the point domainVector. More...
 
virtual double actualValue (const V &domainVector, const V *, V *, M *, V *) const
 Actual value of the scalar function. More...
 
Constructor/Destructor methods.
 LikelihoodBase (const char *prefix, const VectorSet< V, M > &domainSet, const V &observations)
 Default constructor. More...
 
virtual ~LikelihoodBase ()=0
 Destructor, pure to make this class abstract. 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 Attributes

const V & m_observations
 
- Protected Attributes inherited from QUESO::BaseScalarFunction< V, M >
const BaseEnvironmentm_env
 
std::string m_prefix
 
const VectorSet< V, M > & m_domainSet
 Domain set of the scalar function. More...
 

Detailed Description

template<class V = GslVector, class M = GslMatrix>
class QUESO::LikelihoodBase< V, M >

Base class for canned Gaussian likelihoods.

This class is an abstract base class for 'canned' Gaussian likelihoods. All this class does is add a pure virtual function called evaluateModel that the user will implement to interact with the forward code.

Definition at line 49 of file LikelihoodBase.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::LikelihoodBase< V, M >::LikelihoodBase ( const char *  prefix,
const VectorSet< V, M > &  domainSet,
const V &  observations 
)

Default constructor.

The vector of observations must be passed. This will be used when evaluating the likelihood functional

Definition at line 35 of file LikelihoodBase.C.

38  : BaseScalarFunction<V, M>(prefix, domainSet),
39  m_observations(observations)
40 {
41 }
const VectorSet< V, M > & domainSet() const
Access to the protected attribute m_domainSet: domain set of the scalar function. ...
template<class V , class M >
QUESO::LikelihoodBase< V, M >::~LikelihoodBase ( )
pure virtual

Destructor, pure to make this class abstract.

Definition at line 44 of file LikelihoodBase.C.

45 {
46 }

Member Function Documentation

template<class V = GslVector, class M = GslMatrix>
virtual double QUESO::LikelihoodBase< V, M >::actualValue ( const V &  domainVector,
const V *  ,
V *  ,
M *  ,
V *   
) const
inlinevirtual

Actual value of the scalar function.

Implements QUESO::BaseScalarFunction< V, M >.

Definition at line 98 of file LikelihoodBase.h.

References QUESO::BaseScalarFunction< V, M >::lnValue().

100  { return std::exp(this->lnValue(domainVector)); }
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.
template<class V , class M >
void QUESO::LikelihoodBase< V, M >::evaluateModel ( const V &  domainVector,
const V *  domainDirection,
V &  modelOutput,
V *  gradVector,
M *  hessianMatrix,
V *  hessianEffect 
) const
virtual

Deprecated. Evaluates the user's model at the point domainVector.

This method is deprecated. The user instead should subclass evaluateModel(const V & domainVector, V & modelOutput).

Definition at line 49 of file LikelihoodBase.C.

Referenced by QUESO::LikelihoodBase< V, M >::evaluateModel().

52 {
53  std::stringstream ss;
54  ss << "ERROR: evaluateModel() not implemented! This interface is deprecated."
55  << std::endl
56  << "Prefer implementing evaluateModel(const V & domainVector, V & modelOutput)"
57  << std::endl;
58 
59  queso_error_msg(ss.str());
60 }
template<class V = GslVector, class M = GslMatrix>
virtual void QUESO::LikelihoodBase< V, M >::evaluateModel ( const V &  domainVector,
V &  modelOutput 
) const
inlinevirtual

Evaluates the user's model at the point domainVector.

Subclass implementations will fill up the modelOutput vector with output from the model. This represents a vector of synthetic observations that will be compared to actual observations when computing the likelihood functional.

The first n components of domainVector are the model parameters. The rest of domainVector contains the hyperparameters, if any. For example, in GaussianLikelihoodFullCovarainceRandomCoefficient, the last component of domainVector contains the multiplicative coefficient of the observational covariance matrix. In this case, the user need not concern themselves with this parameter as it is handled not in the model evaluation but by the likelihood evaluation.

By default, to ensure backward compatibility, this method will call the deprecated evaluateModel( const V & domainVector, const V * domainDirection, V & modelOutput, V * gradVector, M * hessianMatrix, V * hessianEffect ).

Definition at line 94 of file LikelihoodBase.h.

References QUESO::LikelihoodBase< V, M >::evaluateModel().

95  { this->evaluateModel(domainVector,NULL,modelOutput,NULL,NULL,NULL); }
virtual void evaluateModel(const V &domainVector, const V *domainDirection, V &modelOutput, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Deprecated. Evaluates the user&#39;s model at the point domainVector.

Member Data Documentation

template<class V = GslVector, class M = GslMatrix>
const V& QUESO::LikelihoodBase< V, M >::m_observations
protected

Definition at line 103 of file LikelihoodBase.h.


The documentation for this class was generated from the following files:

Generated on Tue Jun 5 2018 19:49:32 for queso-0.57.1 by  doxygen 1.8.5