Doxygen 1.9.1
Toolkit for Adaptive Stochastic Modeling and Non-Intrusive ApproximatioN: Tasmanian v8.1
TasDREAM::TasmanianLikelihood Class Referenceabstract

Interface for the likelihood classes. More...

#include <tsgDreamLikelihoodCore.hpp>

Inheritance diagram for TasDREAM::TasmanianLikelihood:

Public Member Functions

 TasmanianLikelihood ()
 Empty default constructor.
 
virtual ~TasmanianLikelihood ()
 Empty virtual destructor.
 
virtual void getLikelihood (TypeSamplingForm form, const std::vector< double > &model, std::vector< double > &likely) const =0
 Purely virtual method used by SampleDREAMPosterior(), computes the likelihood of multiple model values. More...
 
virtual void getLikelihood (TypeSamplingForm form, double const model[], int num_samples, double likely[]) const =0
 Overload for raw-arrays, for interface purposes mostly, never called from C++ directly.
 
virtual int getNumOutputs () const =0
 Return the number of expected model outputs.
 
virtual operator std::function< void (TypeSamplingForm, const std::vector< double > &, std::vector< double > &)>() const
 Automatically convert the likelihood into input for TasDREAM::posterior().
 

Detailed Description

Interface for the likelihood classes.

Likelihood
In the framework of Bayesian inference the likelihood is a measure of how likely is a specific outcome (i.e., model output), given some observed data. The likelihood class (usually) contains the data and implements a specific formula that measure the discrepancy. The TasmanianLikelihood class is virtual, but an inherited class is required for the SampleDREAMPosterior() methods.
Included Likelihood Formulas
The chose of likelihood is very problem dependent and Tasmanian implements only a few commonly used cases, mostly relying on the assumption that the data is contaminated with white noise. However, the user can implement any other likelihood by simply inheriting from this class.

Member Function Documentation

◆ getLikelihood()

virtual void TasDREAM::TasmanianLikelihood::getLikelihood ( TypeSamplingForm  form,
const std::vector< double > &  model,
std::vector< double > &  likely 
) const
pure virtual

Purely virtual method used by SampleDREAMPosterior(), computes the likelihood of multiple model values.

The model vector is the same as the output of the model lambda in SampleDREAMPosterior() or the TasGrid::TasmanianSparseGrid::evaluateBatch(), the model realizations are stored contiguously in strides of length equal to the number of model outputs. The likely vector is pre-allocated with size matching the number of model realizations under considerations (no resize is needed), this function must populate the likely entries with the corresponding values of the likelihood. Note that model.size() / likely.size() will divide evenly and will equal the number of model realizations.

Implemented in TasDREAM::LikelihoodGaussAnisotropic, and TasDREAM::LikelihoodGaussIsotropic.


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