queso-0.53.0
Public Member Functions | Private Attributes | List of all members
QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient< V, M > Class Template Reference

A class that represents a Gaussian likelihood with full covariance and random coefficient. More...

#include <GaussianLikelihoodFullCovarianceRandomCoefficient.h>

Inheritance diagram for QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient< V, M >:
Inheritance graph
[legend]
Collaboration diagram for QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient< V, M >:
Collaboration graph
[legend]

Public Member Functions

virtual double actualValue (const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
 Actual value 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. More...
 
Constructor/Destructor methods.
 GaussianLikelihoodFullCovarianceRandomCoefficient (const char *prefix, const VectorSet< V, M > &domainSet, const V &observations, const M &covariance)
 Default constructor. More...
 
virtual ~GaussianLikelihoodFullCovarianceRandomCoefficient ()
 Destructor. More...
 
- Public Member Functions inherited from QUESO::BaseGaussianLikelihood< V, M >
virtual void evaluateModel (const V &domainVector, const V *domainDirection, V &modelOutput, V *gradVector, M *hessianMatrix, V *hessianEffect) const =0
 Evaluates the user's model at the point domainVector. More...
 
 BaseGaussianLikelihood (const char *prefix, const VectorSet< V, M > &domainSet, const V &observations)
 Default constructor. More...
 
virtual ~BaseGaussianLikelihood ()
 Destructor. More...
 
- Public Member Functions inherited from QUESO::BaseScalarFunction< V, M >
 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...
 

Private Attributes

double m_covarianceCoefficient
 
const M & m_covariance
 

Additional Inherited Members

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

A class that represents a Gaussian likelihood with full covariance and random coefficient.

Definition at line 43 of file GaussianLikelihoodFullCovarianceRandomCoefficient.h.

Constructor & Destructor Documentation

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

Default constructor.

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

The parameter covarianceCoefficient is a multiplying factor of covaraince and is treated as a random variable (i.e. it is solved for in a statistical inversion).

Definition at line 34 of file GaussianLikelihoodFullCovarianceRandomCoefficient.C.

References queso_error_msg.

37  : BaseGaussianLikelihood<V, M>(prefix, domainSet, observations),
38  m_covariance(covariance)
39 {
40  if (covariance.numRowsLocal() != observations.sizeLocal()) {
41  queso_error_msg("Covariance matrix not same size as observation vector");
42  }
43 }
#define queso_error_msg(msg)
Definition: asserts.h:47
const VectorSet< V, M > & domainSet() const
Access to the protected attribute m_domainSet: domain set of the scalar function. ...

Destructor.

Definition at line 46 of file GaussianLikelihoodFullCovarianceRandomCoefficient.C.

47 {
48 }

Member Function Documentation

template<class V , class M >
double QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient< V, M >::actualValue ( const V &  domainVector,
const V *  domainDirection,
V *  gradVector,
M *  hessianMatrix,
V *  hessianEffect 
) const
virtual

Actual value of the scalar function.

Implements QUESO::BaseScalarFunction< V, M >.

Definition at line 52 of file GaussianLikelihoodFullCovarianceRandomCoefficient.C.

55 {
56  return std::exp(this->lnValue(domainVector, domainDirection, gradVector,
57  hessianMatrix, hessianEffect));
58 }
virtual double lnValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Logarithm of the value of the scalar function.
template<class V , class M >
double QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient< V, M >::lnValue ( const V &  domainVector,
const V *  domainDirection,
V *  gradVector,
M *  hessianMatrix,
V *  hessianEffect 
) const
virtual

Logarithm of the value of the scalar function.

Implements QUESO::BaseScalarFunction< V, M >.

Definition at line 62 of file GaussianLikelihoodFullCovarianceRandomCoefficient.C.

65 {
66  V modelOutput(this->m_observations, 0, 0); // At least it's not a copy
67  V weightedMisfit(this->m_observations, 0, 0); // At least it's not a copy
68 
69  this->evaluateModel(domainVector, domainDirection, modelOutput, gradVector,
70  hessianMatrix, hessianEffect);
71 
72  // Compute misfit G(x) - y
73  modelOutput -= this->m_observations;
74 
75  // Solve \Sigma u = G(x) - y for u
76  this->m_covariance.invertMultiply(modelOutput, weightedMisfit);
77 
78  // Compute (G(x) - y)^T \Sigma^{-1} (G(x) - y)
79  modelOutput *= weightedMisfit;
80 
81  // This is square of 2-norm
82  double norm2_squared = modelOutput.sumOfComponents();
83 
84  // The last element of domainVector is the multiplicative coefficient of the
85  // covariance matrix
86  return -0.5 * norm2_squared / (domainVector[domainVector.sizeLocal()-1]);
87 }
virtual void evaluateModel(const V &domainVector, const V *domainDirection, V &modelOutput, V *gradVector, M *hessianMatrix, V *hessianEffect) const =0
Evaluates the user&#39;s model at the point domainVector.

Member Data Documentation

template<class V = GslVector, class M = GslMatrix>
const M& QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient< V, M >::m_covariance
private
template<class V = GslVector, class M = GslMatrix>
double QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient< V, M >::m_covarianceCoefficient
private

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

Generated on Thu Jun 11 2015 13:52:35 for queso-0.53.0 by  doxygen 1.8.5