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

Implements likelihood under the assumption of anisotropic white noise. More...

#include <tsgDreamLikelyGaussian.hpp>

Inheritance diagram for TasDREAM::LikelihoodGaussAnisotropic:
Collaboration diagram for TasDREAM::LikelihoodGaussAnisotropic:

Public Member Functions

 LikelihoodGaussAnisotropic ()=default
 Default constructor for convenience, an object constructed with the default cannot be used until setData() is called.
 
 LikelihoodGaussAnisotropic (std::vector< double > const &variance, std::vector< double > const &data_mean, size_t num_observe=1)
 Constructs the class and calls setData().
 
 ~LikelihoodGaussAnisotropic ()=default
 Default destructor.
 
void setData (std::vector< double > const &variance, std::vector< double > const &data_mean, size_t num_observe=1)
 Set the noise magnitude (variance) the observed data (data_mean) and number of observations (num_observe). More...
 
void getLikelihood (TypeSamplingForm form, std::vector< double > const &model, std::vector< double > &likely) const override final
 Compute the likelihood of a set of model outputs.
 
void getLikelihood (TypeSamplingForm form, double const model[], int num_samples, double likely[]) const override final
 Overload for raw-arrays, for interface purposes mostly, e.g., python.
 
int getNumOutputs () const override
 Returns the size of the data_mean vector (for error checking purposes).
 
void write (std::ostream &os, int outputs_begin=0, int outputs_end=-1) const
 Writes the data for a portion of the outputs into a stream. More...
 
void read (std::istream &is)
 Reads the data from a stream, assumes write() has been used first.
 
- Public Member Functions inherited from TasDREAM::TasmanianLikelihood
 TasmanianLikelihood ()
 Empty default constructor.
 
virtual ~TasmanianLikelihood ()
 Empty virtual destructor.
 
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

Implements likelihood under the assumption of anisotropic white noise.

Gaussian Likelihood
The general formula for Gaussian likelihood is $ L(y | d_1 \cdots d_n) = \exp\left( 0.5 sum_{i=1}^n (y - d_i)^T \Sigma^{-1} (y - d_i) \right)$ where the $ d_i $ are the data observations, y is the model output, and $ \Sigma $ is the noise covariance matrix.
Anisotropic Gaussian
A more advanced version of the Gaussian likelihood associated each model output with noise of different magnitude. The inversion of the covariance reduces to division of each input by the corresponding magnitude (i.e., there is no matrix inversion). Similarly to the simple case, the sum corresponding to the multiple data samples can be replaced by scaled operation on the data mean (average).

Member Function Documentation

◆ setData()

void TasDREAM::LikelihoodGaussAnisotropic::setData ( std::vector< double > const &  variance,
std::vector< double > const &  data_mean,
size_t  num_observe = 1 
)

Set the noise magnitude (variance) the observed data (data_mean) and number of observations (num_observe).

Parameters
varianceis a vector with size equal to the number of model outputs. Each entry represents the noise magnitude (variance) associated with that output.
data_meanis the average of all available observations of the data.
num_observeis the number of observations used to compute the data_mean.

◆ write()

void TasDREAM::LikelihoodGaussAnisotropic::write ( std::ostream &  os,
int  outputs_begin = 0,
int  outputs_end = -1 
) const
inline

Writes the data for a portion of the outputs into a stream.

See LikelihoodGaussIsotropic::write().


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