70 | | <h1>bdm::BM Class Reference</h1><!-- doxytag: class="bdm::BM" --><!-- doxytag: inherits="bdm::root" -->Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities. |
71 | | <a href="#_details">More...</a> |
72 | | <p> |
73 | | <code>#include <<a class="el" href="bdmbase_8h-source.html">bdmbase.h</a>></code> |
74 | | <p> |
75 | | |
76 | | <p> |
77 | | <a href="classbdm_1_1BM-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> |
78 | | <tr><td></td></tr> |
79 | | <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> |
80 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="23c6a8f71f922023ab08dcb0487a86de"></a><!-- doxytag: member="bdm::BM::from_setting" ref="23c6a8f71f922023ab08dcb0487a86de" args="(const Setting &set)" --> |
81 | | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#23c6a8f71f922023ab08dcb0487a86de">from_setting</a> (const Setting &set)</td></tr> |
82 | | |
83 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method arrange instance properties according the data stored in the Setting structure. <br></td></tr> |
84 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="af0e6941ba5919cae1bc530e2181b109"></a><!-- doxytag: member="bdm::BM::to_string" ref="af0e6941ba5919cae1bc530e2181b109" args="()" --> |
85 | | virtual string </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1root.html#af0e6941ba5919cae1bc530e2181b109">to_string</a> ()</td></tr> |
86 | | |
87 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method returns a basic info about the current instance. <br></td></tr> |
88 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="67d954d255ede776eade7334d4895790"></a><!-- doxytag: member="bdm::BM::to_setting" ref="67d954d255ede776eade7334d4895790" args="(Setting &set) const " --> |
89 | | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1root.html#67d954d255ede776eade7334d4895790">to_setting</a> (Setting &set) const </td></tr> |
90 | | |
91 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method save all the instance properties into the Setting structure. <br></td></tr> |
92 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1c314bd6d6dacb8ba78ea5eb88fd9516"></a><!-- doxytag: member="bdm::BM::validate" ref="1c314bd6d6dacb8ba78ea5eb88fd9516" args="()" --> |
93 | | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1root.html#1c314bd6d6dacb8ba78ea5eb88fd9516">validate</a> ()</td></tr> |
94 | | |
95 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method TODO. <br></td></tr> |
| 73 | <h1>bdm::BM Class Reference</h1><!-- doxytag: class="bdm::BM" --><!-- doxytag: inherits="bdm::root" --> |
| 74 | <p>Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities. |
| 75 | <a href="#_details">More...</a></p> |
| 76 | |
| 77 | <p><code>#include <<a class="el" href="bdmbase_8h_source.html">bdmbase.h</a>></code></p> |
| 78 | |
| 79 | <p><a href="classbdm_1_1BM-members.html">List of all members.</a></p> |
| 80 | <table border="0" cellpadding="0" cellspacing="0"> |
| 81 | <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> |
| 82 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a23c6a8f71f922023ab08dcb0487a86de"></a><!-- doxytag: member="bdm::BM::from_setting" ref="a23c6a8f71f922023ab08dcb0487a86de" args="(const Setting &set)" --> |
| 83 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a23c6a8f71f922023ab08dcb0487a86de">from_setting</a> (const Setting &set)</td></tr> |
| 84 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method arrange instance properties according the data stored in the Setting structure. <br/></td></tr> |
| 85 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaf0e6941ba5919cae1bc530e2181b109"></a><!-- doxytag: member="bdm::BM::to_string" ref="aaf0e6941ba5919cae1bc530e2181b109" args="()" --> |
| 86 | virtual string </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1root.html#aaf0e6941ba5919cae1bc530e2181b109">to_string</a> ()</td></tr> |
| 87 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method returns a basic info about the current instance. <br/></td></tr> |
| 88 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a67d954d255ede776eade7334d4895790"></a><!-- doxytag: member="bdm::BM::to_setting" ref="a67d954d255ede776eade7334d4895790" args="(Setting &set) const " --> |
| 89 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1root.html#a67d954d255ede776eade7334d4895790">to_setting</a> (Setting &set) const </td></tr> |
| 90 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method save all the instance properties into the Setting structure. <br/></td></tr> |
| 91 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1c314bd6d6dacb8ba78ea5eb88fd9516"></a><!-- doxytag: member="bdm::BM::validate" ref="a1c314bd6d6dacb8ba78ea5eb88fd9516" args="()" --> |
| 92 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1root.html#a1c314bd6d6dacb8ba78ea5eb88fd9516">validate</a> ()</td></tr> |
| 93 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method TODO. <br/></td></tr> |
106 | | <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#60b1779a577367c369a932cabd3a6188">bayes</a> (const vec &dt)=0</td></tr> |
107 | | |
108 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Incremental Bayes rule. <a href="#60b1779a577367c369a932cabd3a6188"></a><br></td></tr> |
109 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1dee3fddaf021e62d925289660a707dc"></a><!-- doxytag: member="bdm::BM::bayesB" ref="1dee3fddaf021e62d925289660a707dc" args="(const mat &Dt)" --> |
110 | | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#1dee3fddaf021e62d925289660a707dc">bayesB</a> (const mat &Dt)</td></tr> |
111 | | |
112 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Batch Bayes rule (columns of Dt are observations). <br></td></tr> |
113 | | <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#50257e0c1e5b5c73153ea6e716ad8ae0">logpred</a> (const vec &dt) const </td></tr> |
114 | | |
115 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0e8ebe61fb14990abe1254bd3dda5fae"></a><!-- doxytag: member="bdm::BM::logpred_m" ref="0e8ebe61fb14990abe1254bd3dda5fae" args="(const mat &dt) const " --> |
116 | | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#0e8ebe61fb14990abe1254bd3dda5fae">logpred_m</a> (const mat &dt) const </td></tr> |
117 | | |
118 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Matrix version of logpred. <br></td></tr> |
119 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="688d7a2aced1e06aa1c468d73a9e5eba"></a><!-- doxytag: member="bdm::BM::epredictor" ref="688d7a2aced1e06aa1c468d73a9e5eba" args="() const " --> |
120 | | virtual <a class="el" href="classbdm_1_1epdf.html">epdf</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#688d7a2aced1e06aa1c468d73a9e5eba">epredictor</a> () const </td></tr> |
121 | | |
122 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs a predictive density <img class="formulaInl" alt="$ f(d_{t+1} |d_{t}, \ldots d_{0}) $" src="form_14.png">. <br></td></tr> |
123 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="598b25e3f3d96a5bc00a5faeb5b3c912"></a><!-- doxytag: member="bdm::BM::predictor" ref="598b25e3f3d96a5bc00a5faeb5b3c912" args="() const " --> |
124 | | virtual <a class="el" href="classbdm_1_1mpdf.html">mpdf</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#598b25e3f3d96a5bc00a5faeb5b3c912">predictor</a> () const </td></tr> |
125 | | |
126 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs conditional density of 1-step ahead predictor <img class="formulaInl" alt="$ f(d_{t+1} |d_{t+h-1}, \ldots d_{t}) $" src="form_131.png">. <br></td></tr> |
| 103 | <tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpfb3595af27ed8bd142c95323c0dab340"></a> </p> |
| 104 | <br/><br/></div></td></tr> |
| 105 | <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a60b1779a577367c369a932cabd3a6188">bayes</a> (const vec &dt)=0</td></tr> |
| 106 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Incremental Bayes rule. <a href="#a60b1779a577367c369a932cabd3a6188"></a><br/></td></tr> |
| 107 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1dee3fddaf021e62d925289660a707dc"></a><!-- doxytag: member="bdm::BM::bayesB" ref="a1dee3fddaf021e62d925289660a707dc" args="(const mat &Dt)" --> |
| 108 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a1dee3fddaf021e62d925289660a707dc">bayesB</a> (const mat &Dt)</td></tr> |
| 109 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Batch Bayes rule (columns of Dt are observations). <br/></td></tr> |
| 110 | <tr><td class="memItemLeft" align="right" valign="top">virtual double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a50257e0c1e5b5c73153ea6e716ad8ae0">logpred</a> (const vec &dt) const </td></tr> |
| 111 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0e8ebe61fb14990abe1254bd3dda5fae"></a><!-- doxytag: member="bdm::BM::logpred_m" ref="a0e8ebe61fb14990abe1254bd3dda5fae" args="(const mat &dt) const " --> |
| 112 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a0e8ebe61fb14990abe1254bd3dda5fae">logpred_m</a> (const mat &dt) const </td></tr> |
| 113 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Matrix version of logpred. <br/></td></tr> |
| 114 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a688d7a2aced1e06aa1c468d73a9e5eba"></a><!-- doxytag: member="bdm::BM::epredictor" ref="a688d7a2aced1e06aa1c468d73a9e5eba" args="() const " --> |
| 115 | virtual <a class="el" href="classbdm_1_1epdf.html">epdf</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a688d7a2aced1e06aa1c468d73a9e5eba">epredictor</a> () const </td></tr> |
| 116 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs a predictive density <img class="formulaInl" alt="$ f(d_{t+1} |d_{t}, \ldots d_{0}) $" src="form_14.png"/>. <br/></td></tr> |
| 117 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a598b25e3f3d96a5bc00a5faeb5b3c912"></a><!-- doxytag: member="bdm::BM::predictor" ref="a598b25e3f3d96a5bc00a5faeb5b3c912" args="() const " --> |
| 118 | virtual <a class="el" href="classbdm_1_1mpdf.html">mpdf</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a598b25e3f3d96a5bc00a5faeb5b3c912">predictor</a> () const </td></tr> |
| 119 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs conditional density of 1-step ahead predictor <img class="formulaInl" alt="$ f(d_{t+1} |d_{t+h-1}, \ldots d_{t}) $" src="form_131.png"/>. <br/></td></tr> |
145 | | |
146 | | <tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> |
147 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c400357e37d27a4834b2b1d9211009ed"></a><!-- doxytag: member="bdm::BM::drv" ref="c400357e37d27a4834b2b1d9211009ed" args="" --> |
148 | | <a class="el" href="classbdm_1_1RV.html">RV</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#c400357e37d27a4834b2b1d9211009ed">drv</a></td></tr> |
149 | | |
150 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Random variable of the data (optional). <br></td></tr> |
151 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4064b6559d962633e4372b12f4cd204a"></a><!-- doxytag: member="bdm::BM::ll" ref="4064b6559d962633e4372b12f4cd204a" args="" --> |
152 | | double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a">ll</a></td></tr> |
153 | | |
154 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Logarithm of marginalized data likelihood. <br></td></tr> |
155 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="faff0ad12556fe7dc0e2807d4fd938ee"></a><!-- doxytag: member="bdm::BM::evalll" ref="faff0ad12556fe7dc0e2807d4fd938ee" args="" --> |
156 | | bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee">evalll</a></td></tr> |
157 | | |
158 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">If true, the filter will compute likelihood of the data record and store it in <code>ll</code> . Set to false if you want to save computational time. <br></td></tr> |
159 | | <tr><td colspan="2"><br><h2>Extension to conditional BM</h2></td></tr> |
160 | | <tr><td colspan="2">This extension is useful e.g. in Marginalized Particle Filter (<a class="el" href="classbdm_1_1MPF.html">bdm::MPF</a>). Alternatively, it can be used for automated connection to <a class="el" href="classbdm_1_1DS.html" title="Abstract class for discrete-time sources of data.">DS</a> when the condition is observed <br><br></td></tr> |
161 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="de95c590d650b2db423d53992f0906cb"></a><!-- doxytag: member="bdm::BM::rvc" ref="de95c590d650b2db423d53992f0906cb" args="" --> |
162 | | <a class="el" href="classbdm_1_1RV.html">RV</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#de95c590d650b2db423d53992f0906cb">rvc</a></td></tr> |
163 | | |
164 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Name of extension variable. <br></td></tr> |
165 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b5e8e016be16e4029c789063cb3f3b33"></a><!-- doxytag: member="bdm::BM::_rvc" ref="b5e8e016be16e4029c789063cb3f3b33" args="() const " --> |
166 | | const <a class="el" href="classbdm_1_1RV.html">RV</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#b5e8e016be16e4029c789063cb3f3b33">_rvc</a> () const </td></tr> |
167 | | |
168 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">access function <br></td></tr> |
169 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6799f4b16a6a59ed58b1d0d6e17116f4"></a><!-- doxytag: member="bdm::BM::condition" ref="6799f4b16a6a59ed58b1d0d6e17116f4" args="(const vec &val)" --> |
170 | | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#6799f4b16a6a59ed58b1d0d6e17116f4">condition</a> (const vec &val)</td></tr> |
171 | | |
172 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Substitute <code>val</code> for <code>rvc</code>. <br></td></tr> |
173 | | <tr><td colspan="2"><br><h2>Logging of results</h2></td></tr> |
174 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="109c1a626a69031658e3a44e9e500cca"></a><!-- doxytag: member="bdm::BM::LIDs" ref="109c1a626a69031658e3a44e9e500cca" args="" --> |
175 | | ivec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#109c1a626a69031658e3a44e9e500cca">LIDs</a></td></tr> |
176 | | |
177 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">IDs of storages in loggers 4:[1=mean,2=lb,3=ub,4=ll]. <br></td></tr> |
178 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="398b7e7a162cf37d0022d6126495f207"></a><!-- doxytag: member="bdm::BM::LFlags" ref="398b7e7a162cf37d0022d6126495f207" args="" --> |
179 | | ivec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#398b7e7a162cf37d0022d6126495f207">LFlags</a></td></tr> |
180 | | |
181 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Flags for logging - same size as LIDs, each entry correspond to the same in LIDs. <br></td></tr> |
182 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="adb539fa2585c8a2a91c54e5aebf330e"></a><!-- doxytag: member="bdm::BM::set_options" ref="adb539fa2585c8a2a91c54e5aebf330e" args="(const string &opt)" --> |
183 | | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#adb539fa2585c8a2a91c54e5aebf330e">set_options</a> (const string &opt)</td></tr> |
184 | | |
185 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set boolean options from a string, recognized are: "logbounds,logll". <br></td></tr> |
186 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2298ca6af9b13a78a4c9e18ab43f1827"></a><!-- doxytag: member="bdm::BM::log_add" ref="2298ca6af9b13a78a4c9e18ab43f1827" args="(logger &L, const string &name="")" --> |
187 | | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#2298ca6af9b13a78a4c9e18ab43f1827">log_add</a> (<a class="el" href="classbdm_1_1logger.html">logger</a> &L, const string &name="")</td></tr> |
188 | | |
189 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Add all logged variables to a <a class="el" href="classbdm_1_1logger.html" title="Class for storing results (and semi-results) of an experiment.">logger</a>. <br></td></tr> |
190 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b517e1679eaa94e803ea4cd0b8efbcd7"></a><!-- doxytag: member="bdm::BM::logit" ref="b517e1679eaa94e803ea4cd0b8efbcd7" args="(logger &L)" --> |
| 135 | <tr><td colspan="2"><h2>Protected Attributes</h2></td></tr> |
| 136 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac400357e37d27a4834b2b1d9211009ed"></a><!-- doxytag: member="bdm::BM::drv" ref="ac400357e37d27a4834b2b1d9211009ed" args="" --> |
| 137 | <a class="el" href="classbdm_1_1RV.html">RV</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#ac400357e37d27a4834b2b1d9211009ed">drv</a></td></tr> |
| 138 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Random variable of the data (optional). <br/></td></tr> |
| 139 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4064b6559d962633e4372b12f4cd204a"></a><!-- doxytag: member="bdm::BM::ll" ref="a4064b6559d962633e4372b12f4cd204a" args="" --> |
| 140 | double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a4064b6559d962633e4372b12f4cd204a">ll</a></td></tr> |
| 141 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Logarithm of marginalized data likelihood. <br/></td></tr> |
| 142 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afaff0ad12556fe7dc0e2807d4fd938ee"></a><!-- doxytag: member="bdm::BM::evalll" ref="afaff0ad12556fe7dc0e2807d4fd938ee" args="" --> |
| 143 | bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#afaff0ad12556fe7dc0e2807d4fd938ee">evalll</a></td></tr> |
| 144 | <tr><td class="mdescLeft"> </td><td class="mdescRight">If true, the filter will compute likelihood of the data record and store it in <code>ll</code> . Set to false if you want to save computational time. <br/></td></tr> |
| 145 | <tr><td colspan="2"><h2>Extension to conditional BM</h2></td></tr> |
| 146 | <tr><td colspan="2"><p><a class="anchor" id="amgrp74e1db869c28ea37aac65bd658ff5da4"></a> This extension is useful e.g. in Marginalized Particle Filter (<a class="el" href="classbdm_1_1MPF.html">bdm::MPF</a>). Alternatively, it can be used for automated connection to <a class="el" href="classbdm_1_1DS.html" title="Abstract class for discrete-time sources of data.">DS</a> when the condition is observed </p> |
| 147 | <br/><br/></td></tr> |
| 148 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ade95c590d650b2db423d53992f0906cb"></a><!-- doxytag: member="bdm::BM::rvc" ref="ade95c590d650b2db423d53992f0906cb" args="" --> |
| 149 | <a class="el" href="classbdm_1_1RV.html">RV</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#ade95c590d650b2db423d53992f0906cb">rvc</a></td></tr> |
| 150 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Name of extension variable. <br/></td></tr> |
| 151 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab5e8e016be16e4029c789063cb3f3b33"></a><!-- doxytag: member="bdm::BM::_rvc" ref="ab5e8e016be16e4029c789063cb3f3b33" args="() const " --> |
| 152 | const <a class="el" href="classbdm_1_1RV.html">RV</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#ab5e8e016be16e4029c789063cb3f3b33">_rvc</a> () const </td></tr> |
| 153 | <tr><td class="mdescLeft"> </td><td class="mdescRight">access function <br/></td></tr> |
| 154 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6799f4b16a6a59ed58b1d0d6e17116f4"></a><!-- doxytag: member="bdm::BM::condition" ref="a6799f4b16a6a59ed58b1d0d6e17116f4" args="(const vec &val)" --> |
| 155 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a6799f4b16a6a59ed58b1d0d6e17116f4">condition</a> (const vec &val)</td></tr> |
| 156 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Substitute <code>val</code> for <code>rvc</code>. <br/></td></tr> |
| 157 | <tr><td colspan="2"><h2>Logging of results</h2></td></tr> |
| 158 | <tr><td colspan="2"><p><a class="anchor" id="amgrp5b751fa78120752d90ae4487df3bfa73"></a> </p> |
| 159 | <br/><br/></td></tr> |
| 160 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a109c1a626a69031658e3a44e9e500cca"></a><!-- doxytag: member="bdm::BM::LIDs" ref="a109c1a626a69031658e3a44e9e500cca" args="" --> |
| 161 | ivec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a109c1a626a69031658e3a44e9e500cca">LIDs</a></td></tr> |
| 162 | <tr><td class="mdescLeft"> </td><td class="mdescRight">IDs of storages in loggers 4:[1=mean,2=lb,3=ub,4=ll]. <br/></td></tr> |
| 163 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a398b7e7a162cf37d0022d6126495f207"></a><!-- doxytag: member="bdm::BM::LFlags" ref="a398b7e7a162cf37d0022d6126495f207" args="" --> |
| 164 | ivec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a398b7e7a162cf37d0022d6126495f207">LFlags</a></td></tr> |
| 165 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Flags for logging - same size as LIDs, each entry correspond to the same in LIDs. <br/></td></tr> |
| 166 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aadb539fa2585c8a2a91c54e5aebf330e"></a><!-- doxytag: member="bdm::BM::set_options" ref="aadb539fa2585c8a2a91c54e5aebf330e" args="(const string &opt)" --> |
| 167 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#aadb539fa2585c8a2a91c54e5aebf330e">set_options</a> (const string &opt)</td></tr> |
| 168 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set boolean options from a string, recognized are: "logbounds,logll". <br/></td></tr> |
| 169 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2298ca6af9b13a78a4c9e18ab43f1827"></a><!-- doxytag: member="bdm::BM::log_add" ref="a2298ca6af9b13a78a4c9e18ab43f1827" args="(logger &L, const string &name="")" --> |
| 170 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#a2298ca6af9b13a78a4c9e18ab43f1827">log_add</a> (<a class="el" href="classbdm_1_1logger.html">logger</a> &L, const string &name="")</td></tr> |
| 171 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Add all logged variables to a <a class="el" href="classbdm_1_1logger.html" title="Class for storing results (and semi-results) of an experiment.">logger</a>. <br/></td></tr> |
| 172 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab517e1679eaa94e803ea4cd0b8efbcd7"></a><!-- doxytag: member="bdm::BM::logit" ref="ab517e1679eaa94e803ea4cd0b8efbcd7" args="(logger &L)" --> |
194 | | <hr><a name="_details"></a><h2>Detailed Description</h2> |
195 | | Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities. |
196 | | <p> |
197 | | This object represents exact or approximate evaluation of the Bayes rule: <p class="formulaDsp"> |
198 | | <img class="formulaDsp" alt="\[ f(\theta_t | d_1,\ldots,d_t) = \frac{f(y_t|\theta_t,\cdot) f(\theta_t|d_1,\ldots,d_{t-1})}{f(y_t|d_1,\ldots,d_{t-1})} \]" src="form_2.png"> |
199 | | <p> |
200 | | <p> |
201 | | Access to the resulting posterior density is via function <code>posterior()</code>.<p> |
202 | | 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 <img class="formulaInl" alt="$y_t$" src="form_3.png">, see functions <a class="el" href="classbdm_1_1BM.html#688d7a2aced1e06aa1c468d73a9e5eba" title="Constructs a predictive density .">epredictor()</a> and <a class="el" href="classbdm_1_1BM.html#598b25e3f3d96a5bc00a5faeb5b3c912" title="Constructs conditional density of 1-step ahead predictor .">predictor()</a>.<p> |
203 | | Alternatively, it can evaluate posterior density conditioned by a known constant, <img class="formulaInl" alt="$ c_t $" src="form_4.png">: <p class="formulaDsp"> |
204 | | <img class="formulaDsp" alt="\[ f(\theta_t | c_t, d_1,\ldots,d_t) \propto f(y_t,\theta_t|c_t,\cdot, d_1,\ldots,d_{t-1}) \]" src="form_5.png"> |
205 | | <p> |
206 | | <p> |
207 | | The value of <img class="formulaInl" alt="$ c_t $" src="form_4.png"> is set by function <a class="el" href="classbdm_1_1BM.html#6799f4b16a6a59ed58b1d0d6e17116f4" title="Substitute val for rvc.">condition()</a>. <hr><h2>Member Function Documentation</h2> |
208 | | <a class="anchor" name="40f01563651c1e4fe926189e41a6b8ab"></a><!-- doxytag: member="bdm::BM::_copy_" ref="40f01563651c1e4fe926189e41a6b8ab" args="() const " --> |
| 175 | <hr/><a name="_details"></a><h2>Detailed Description</h2> |
| 176 | <p>Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities. </p> |
| 177 | <p>This object represents exact or approximate evaluation of the Bayes rule: </p> |
| 178 | <p class="formulaDsp"> |
| 179 | <img class="formulaDsp" alt="\[ f(\theta_t | d_1,\ldots,d_t) = \frac{f(y_t|\theta_t,\cdot) f(\theta_t|d_1,\ldots,d_{t-1})}{f(y_t|d_1,\ldots,d_{t-1})} \]" src="form_2.png"/> |
| 180 | </p> |
| 181 | <p>Access to the resulting posterior density is via function <code>posterior()</code>.</p> |
| 182 | <p>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 <img class="formulaInl" alt="$y_t$" src="form_3.png"/>, see functions <a class="el" href="classbdm_1_1BM.html#a688d7a2aced1e06aa1c468d73a9e5eba" title="Constructs a predictive density .">epredictor()</a> and <a class="el" href="classbdm_1_1BM.html#a598b25e3f3d96a5bc00a5faeb5b3c912" title="Constructs conditional density of 1-step ahead predictor .">predictor()</a>.</p> |
| 183 | <p>Alternatively, it can evaluate posterior density conditioned by a known constant, <img class="formulaInl" alt="$ c_t $" src="form_4.png"/>: </p> |
| 184 | <p class="formulaDsp"> |
| 185 | <img class="formulaDsp" alt="\[ f(\theta_t | c_t, d_1,\ldots,d_t) \propto f(y_t,\theta_t|c_t,\cdot, d_1,\ldots,d_{t-1}) \]" src="form_5.png"/> |
| 186 | </p> |
| 187 | <p>The value of <img class="formulaInl" alt="$ c_t $" src="form_4.png"/> is set by function <a class="el" href="classbdm_1_1BM.html#a6799f4b16a6a59ed58b1d0d6e17116f4" title="Substitute val for rvc.">condition()</a>. </p> |
| 188 | <hr/><h2>Member Function Documentation</h2> |
| 189 | <a class="anchor" id="a40f01563651c1e4fe926189e41a6b8ab"></a><!-- doxytag: member="bdm::BM::_copy_" ref="a40f01563651c1e4fe926189e41a6b8ab" args="() const " --> |