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

A class that represents a Gaussian likelihood with diagonal covariance matrix. More...

#include <GaussianLikelihoodDiagonalCovariance.h>

Inheritance diagram for QUESO::GaussianLikelihoodDiagonalCovariance< V, M >:
QUESO::LikelihoodBase< V, M > QUESO::BaseScalarFunction< V, M >

Public Member Functions

virtual double lnValue (const V &domainVector) const
 Logarithm of the value of the scalar function. More...
 
Constructor/Destructor methods.
 GaussianLikelihoodDiagonalCovariance (const char *prefix, const VectorSet< V, M > &domainSet, const V &observations, const V &covariance)
 Default constructor. More...
 
virtual ~GaussianLikelihoodDiagonalCovariance ()
 Destructor. More...
 
- Public Member Functions inherited from QUESO::LikelihoodBase< V, M >
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...
 
 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, 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
 

Private Attributes

const V & m_covariance
 

Additional Inherited Members

- Protected Attributes inherited from QUESO::LikelihoodBase< V, M >
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::GaussianLikelihoodDiagonalCovariance< V, M >

A class that represents a Gaussian likelihood with diagonal covariance matrix.

Definition at line 43 of file GaussianLikelihoodDiagonalCovariance.h.

Constructor & Destructor Documentation

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

Default constructor.

Instantiates a Gaussian likelihood function, given a prefix, its domain, a set of observations and a diagonal covariance matrix. The diagonal covariance matrix is stored as a vector in the covariance parameter.

Definition at line 35 of file GaussianLikelihoodDiagonalCovariance.C.

38  : LikelihoodBase<V, M>(prefix, domainSet, observations),
39  m_covariance(covariance)
40 {
41  if (covariance.sizeLocal() != observations.sizeLocal()) {
42  queso_error_msg("Covariance matrix not same size as observation vector");
43  }
44 }
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::GaussianLikelihoodDiagonalCovariance< V, M >::~GaussianLikelihoodDiagonalCovariance ( )
virtual

Destructor.

Definition at line 47 of file GaussianLikelihoodDiagonalCovariance.C.

48 {
49 }

Member Function Documentation

template<class V , class M >
double QUESO::GaussianLikelihoodDiagonalCovariance< V, M >::lnValue ( const V &  domainVector) const
virtual

Logarithm of the value of the scalar function.

Reimplemented from QUESO::BaseScalarFunction< V, M >.

Definition at line 53 of file GaussianLikelihoodDiagonalCovariance.C.

54 {
55  V modelOutput(this->m_observations, 0, 0); // At least it's not a copy
56 
57  this->evaluateModel(domainVector, modelOutput);
58 
59  modelOutput -= this->m_observations; // Compute misfit
60  modelOutput *= modelOutput;
61  modelOutput /= this->m_covariance; // Multiply by inverse covriance matrix
62 
63  double norm2_squared = modelOutput.sumOfComponents(); // This is square of 2-norm
64 
65  return -0.5 * norm2_squared;
66 }
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::GaussianLikelihoodDiagonalCovariance< V, M >::m_covariance
private

Definition at line 65 of file GaussianLikelihoodDiagonalCovariance.h.


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

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