template<typename T = double>
CustomLikelihood class
Custom likelihood function wrapper.
Allows users to define custom likelihood functions using boost::function
Base classes
-
template<typename T = double>class LikelihoodFunction<double>
- Abstract base class for likelihood functions in Bayesian analysis.
Constructors, destructors, conversion operators
-
CustomLikelihood(function_
type likelihood_fn, const std::string& name = "custom")
Public functions
- auto evaluate(T theta, T observation) const -> T override
- Evaluate likelihood for a single observation.
-
auto evaluate(T theta,
const vector_
type& observations) const -> T override - Evaluate likelihood for multiple observations.
-
auto sufficient_statistics(const vector_
type& observations) const -> vector_ type override - Get the sufficient statistics for the data.
- auto family() const -> std::string override
- Get the family name of the likelihood.
- auto clone() const -> std::unique_ptr<LikelihoodFunction<T>> override
- Clone the likelihood function.
Function documentation
template<typename T>
T liarsdice:: bayesian:: CustomLikelihood<T>:: evaluate(T theta,
T observation) const override
Evaluate likelihood for a single observation.
| Parameters | |
|---|---|
| theta | Parameter value |
| observation | Single data point |
| Returns | Likelihood value |
template<typename T>
T liarsdice:: bayesian:: CustomLikelihood<T>:: evaluate(T theta,
const vector_ type& observations) const override
Evaluate likelihood for multiple observations.
| Parameters | |
|---|---|
| theta | Parameter value |
| observations | Vector of data points |
| Returns | Combined likelihood value |
template<typename T>
vector_ type liarsdice:: bayesian:: CustomLikelihood<T>:: sufficient_statistics(const vector_ type& observations) const override
Get the sufficient statistics for the data.
| Parameters | |
|---|---|
| observations | Data points |
| Returns | Vector of sufficient statistics |