[1054] | 1 | %> @file mexEpdf.m |
---|
| 2 | %> @brief File mapping root class of BM from BDM |
---|
| 3 | % ====================================================================== |
---|
| 4 | %> @brief Abstract class of Bayesian Model (estimator), bdm::BM |
---|
| 5 | % |
---|
| 6 | %> This class provides a bridge between bdm::BM and Matlab |
---|
| 7 | % ====================================================================== |
---|
[937] | 8 | classdef mexBM |
---|
| 9 | properties |
---|
[1054] | 10 | %> description of internal variables of parameters |
---|
[944] | 11 | rv=RV |
---|
[1054] | 12 | %> description of internal variables of data in condition |
---|
[944] | 13 | rvc=RV |
---|
[1054] | 14 | %> description of internal variables of observed data |
---|
[944] | 15 | rvy=RV |
---|
[1054] | 16 | %> log of evidence (marginal likelihood) potentially computed by the |
---|
[944] | 17 | % bayes rule for one step |
---|
| 18 | log_evidence |
---|
[1054] | 19 | %> posterior density - offspring of mexEpdf! |
---|
[944] | 20 | apost_pdf |
---|
| 21 | % |
---|
[937] | 22 | end |
---|
[944] | 23 | |
---|
[937] | 24 | methods |
---|
[1054] | 25 | %> check consistency of the object and fill defaults |
---|
[944] | 26 | function p=validate(p) |
---|
| 27 | % checks if all paramateres match |
---|
[937] | 28 | end |
---|
[1054] | 29 | %> dimensionality of the class: dims = [size_of_posterior size_of_data size_of_condition] |
---|
[937] | 30 | function dims=dimensions(p) |
---|
| 31 | %please fill |
---|
[943] | 32 | %dims = [size_of_posterior size_of_data size_of_condition] |
---|
| 33 | dims = [0,0,0] % |
---|
[937] | 34 | end |
---|
[1054] | 35 | %> Performs Bayesian update of the internal posterior using data \a dt and condition \a cond. |
---|
[937] | 36 | function obj=bayes(obj,dt,cond) |
---|
| 37 | % transform old estimate into new estimate |
---|
| 38 | end |
---|
[1054] | 39 | %> Computes predictor of the observed data in the next step |
---|
[943] | 40 | function p=epredictor(obj,cond) |
---|
[937] | 41 | % return posterior density |
---|
| 42 | end |
---|
[944] | 43 | |
---|
| 44 | %%%%%%%% default functions %%%%%%%%%%%%%% |
---|
| 45 | function r = get_rv(obj) |
---|
| 46 | r=obj.rv; |
---|
| 47 | end |
---|
| 48 | function r = get_rvc(obj) |
---|
| 49 | r=obj.rvc; |
---|
| 50 | end |
---|
| 51 | function r = get_rvy(obj) |
---|
| 52 | r=obj.rvy; |
---|
| 53 | end |
---|
[1054] | 54 | %> Evidence of the last data, \f[f(y_t|y_0\ldots y_t-1, cond_0\ldots cond_t\f] |
---|
[944] | 55 | function ev = logevidence(obj) |
---|
| 56 | ev = obj.log_evidence; |
---|
| 57 | end |
---|
[1054] | 58 | %> Posterior pdf |
---|
[944] | 59 | function post=posterior(obj); |
---|
| 60 | post = obj.apost_pdf; |
---|
| 61 | end |
---|
[937] | 62 | end |
---|
| 63 | end |
---|