bdm::BM Class Reference
Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities. More...
#include <bdmbase.h>
Inheritance diagram for bdm::BM:
Public Types | |
__VA_ARGS__ | |
enum | log_level_enums { __VA_ARGS__ } |
Public Member Functions | |
void | from_setting (const Setting &set) |
void | to_setting (Setting &set) const |
void | validate () |
process | |
Constructors | |
virtual BM * | _copy () const NOT_IMPLEMENTED(NULL) |
Copy function required in vectors, Arrays of BM etc. Have to be DELETED manually! Prototype:. | |
Mathematical operations | |
virtual void | bayes (const vec &yt, const vec &cond=empty_vec)=0 |
Incremental Bayes rule. | |
virtual double | bayes_batch (const mat &Dt, const vec &cond=empty_vec) |
Batch Bayes rule (columns of Dt are observations). | |
virtual double | bayes_batch (const mat &Dt, const mat &Cond) |
Batch Bayes rule (columns of Dt are observations, columns of Cond are conditions). | |
virtual double | logpred (const vec &yt, const vec &cond) const NOT_IMPLEMENTED(0.0) |
virtual vec | samplepred (const vec &cond=empty_vec) NOT_IMPLEMENTED(empty_vec) |
Sample from predictor(cond). Implemented as sampling the joint density and discarding the sample of . | |
vec | logpred_mat (const mat &Yt, const mat &Cond) const |
Matrix version of logpred. | |
virtual epdf * | epredictor (const vec &cond=vec()) const NOT_IMPLEMENTED(NULL) |
Constructs a predictive density . | |
virtual pdf * | predictor () const NOT_IMPLEMENTED(NULL) |
Constructs conditional density of 1-step ahead predictor . | |
Access to attributes | |
access function | |
const RV & | _rvc () const |
int | dimensionc () const |
access function | |
int | dimensiony () const |
access function | |
int | dimension () const |
access function | |
const RV & | _rv () const |
access function | |
const RV & | _yrv () const |
access function | |
void | set_yrv (const RV &rv) |
access function | |
void | set_rvc (const RV &rv) |
access function | |
void | set_rv (const RV &rv) |
access to rv of the posterior | |
void | set_dim (int dim) |
access function | |
double | _ll () const |
return internal log-likelihood of the last data vector | |
void | set_evalll (bool evl0) |
switch evaluation of log-likelihood on/off | |
virtual const epdf & | posterior () const =0 |
return posterior density | |
epdf & | prior () |
virtual void | set_prior (const epdf *pdf0) NOT_IMPLEMENTED_VOID |
set prior density -- same as posterior but writable | |
Logging of results | |
virtual void | log_register (logger &L, const string &prefix="") |
virtual void | log_write () const |
Save results to the given logger, details of what is stored is configured by LIDs and options . | |
Public Attributes | |
log_level_template< BM > | log_level |
Protected Attributes | |
RV | yrv |
Random variable of the data (optional). | |
int | dimy |
size of the data record | |
RV | rvc |
Name of extension variable. | |
int | dimc |
size of the conditioning vector | |
double | ll |
Logarithm of marginalized data likelihood. | |
bool | evalll |
If true, the filter will compute likelihood of the data record and store it in ll . Set to false if you want to save computational time. | |
Friends | |
class | log_level_intermediate< BM > |
Detailed Description
Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.This object represents exact or approximate evaluation of the Bayes rule:
where: is the variable Access to the resulting posterior density is via function posterior()
.
As a "side-effect" it also evaluates log-likelihood of the data, which can be accessed via function _ll(). It can also evaluate predictors of future values of , see functions epredictor() and predictor().
Alternatively, it can evaluate posterior density with rvc replaced by the given values, :
Member Function Documentation
virtual BM* bdm::BM::_copy | ( | ) | const [virtual] |
Copy function required in vectors, Arrays of BM etc. Have to be DELETED manually! Prototype:.
BM* _copy() const {return new BM(*this);}
Reimplemented from bdm::root.
Reimplemented in bdm::KalmanCh, bdm::EKFCh, and bdm::EKF_UD.
virtual void bdm::BM::bayes | ( | const vec & | yt, | |
const vec & | cond = empty_vec | |||
) | [pure virtual] |
Incremental Bayes rule.
- Parameters:
-
yt vector of input data
Implemented in bdm::EKFCh_dQ, bdm::KalmanFull, bdm::KalmanCh, bdm::EKFfull, bdm::EKFCh, bdm::EKF_UD, and bdm::MixEF.
void bdm::BM::from_setting | ( | const Setting & | set | ) | [inline, virtual] |
Create object from the following structure check if not remove... rv...
class = 'BM'; --- optional fields --- log_level = "..."; % identifiers of levels of detail to store to loggers yrv = RV({'names',...},[sizes,...],[times,...]); % names of modelled data rvc = RV({'names',...},[sizes,...],[times,...]); % names of data in condition rv = RV({'names',...},[sizes,...],[times,...]); % names of parameters --- inherited fields --- bdm::root::from_setting
Reimplemented from bdm::root.
Reimplemented in bdm::ARX, bdm::ARXg, bdm::Kalman< sq_T >, bdm::KalmanCh, bdm::EKFfull, bdm::EKFCh, bdm::EKF_UD, bdm::MixEF, bdm::MarginalizedParticleBase, bdm::MarginalizedParticle, bdm::BootstrapParticle, bdm::PF, bdm::BMEF, and bdm::multiBM.
void bdm::BM::log_register | ( | logger & | L, | |
const string & | prefix = "" | |||
) | [virtual] |
Add all logged variables to a logger Log levels two digits: xy where y = 0/1 log-likelihood is to be logged x = level of the posterior (typically 0/1/2 for nothing/mean/bounds)
Reimplemented from bdm::root.
virtual double bdm::BM::logpred | ( | const vec & | yt, | |
const vec & | cond | |||
) | const [virtual] |
Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out. Shortcut for bdm::BM::predictor().evallog(yt,cond) - sometimes easier to implement.
The documentation for this class was generated from the following files:
- bdmbase.h
- bdmbase.cpp
Generated on 2 Dec 2013 for mixpp by 1.4.7