27 #include <queso/GslVector.h>
28 #include <queso/GslMatrix.h>
29 #include <queso/VectorSet.h>
30 #include <queso/GaussianLikelihoodScalarCovariance.h>
34 template<
class V,
class M>
37 const V & observations,
double covariance)
39 m_covariance(covariance)
43 template<
class V,
class M>
48 template<
class V,
class M>
51 const V * domainDirection, V * gradVector, M * hessianMatrix,
52 V * hessianEffect)
const
54 return std::exp(this->lnValue(domainVector, domainDirection, gradVector,
55 hessianMatrix, hessianEffect));
58 template<
class V,
class M>
61 const V * domainDirection, V * gradVector, M * hessianMatrix,
62 V * hessianEffect)
const
64 V modelOutput(this->m_observations, 0, 0);
66 this->evaluateModel(domainVector, domainDirection, modelOutput, gradVector,
67 hessianMatrix, hessianEffect);
69 modelOutput -= this->m_observations;
70 double norm2_squared = modelOutput.norm2Sq();
72 return -0.5 * norm2_squared / m_covariance;
GaussianLikelihoodScalarCovariance(const char *prefix, const VectorSet< V, M > &domainSet, const V &observations, double covariance)
Default constructor.
A templated class for handling sets.
virtual double lnValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Logarithm of the value of the scalar function.
A class that represents a Gaussian likelihood with scalar covariance.
virtual double actualValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Actual value of the scalar function.
Base class for canned Gaussian likelihoods.
virtual ~GaussianLikelihoodScalarCovariance()
Destructor.