[259] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 3 | <title>mixpp: bdm::MixEF Class Reference</title> |
---|
| 4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
[290] | 5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
[259] | 6 | </head><body> |
---|
[290] | 7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
[271] | 8 | <script type="text/javascript"> |
---|
| 9 | <!-- |
---|
| 10 | function changeDisplayState (e){ |
---|
| 11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
| 12 | var button=this.firstChild; |
---|
| 13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
| 14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
| 15 | sectionDiv.style.display='block'; |
---|
| 16 | button.src='open.gif'; |
---|
| 17 | }else{ |
---|
| 18 | sectionDiv.style.display='none'; |
---|
| 19 | button.src='closed.gif'; |
---|
| 20 | } |
---|
| 21 | } |
---|
| 22 | function initDynSections(){ |
---|
| 23 | var divs=document.getElementsByTagName('div'); |
---|
| 24 | var sectionCounter=1; |
---|
| 25 | for(var i=0;i<divs.length-1;i++){ |
---|
| 26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
| 27 | var header=divs[i]; |
---|
| 28 | var section=divs[i+1]; |
---|
| 29 | var button=header.firstChild; |
---|
| 30 | if (button!='IMG'){ |
---|
| 31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
| 32 | button=document.createElement('img'); |
---|
| 33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
| 34 | } |
---|
| 35 | header.style.cursor='pointer'; |
---|
| 36 | header.onclick=changeDisplayState; |
---|
| 37 | header.id='dynheader'+sectionCounter; |
---|
| 38 | button.src='closed.gif'; |
---|
| 39 | section.id='dynsection'+sectionCounter; |
---|
| 40 | section.style.display='none'; |
---|
| 41 | section.style.marginLeft='14px'; |
---|
| 42 | sectionCounter++; |
---|
| 43 | } |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | window.onload = initDynSections; |
---|
| 47 | --> |
---|
| 48 | </script> |
---|
[259] | 49 | <div class="navigation" id="top"> |
---|
| 50 | <div class="tabs"> |
---|
| 51 | <ul> |
---|
[271] | 52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
[259] | 53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
| 54 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
[290] | 55 | <li class="current"><a href="annotated.html"><span>Classes</span></a></li> |
---|
[259] | 56 | <li><a href="files.html"><span>Files</span></a></li> |
---|
| 57 | </ul> |
---|
| 58 | </div> |
---|
| 59 | <div class="tabs"> |
---|
| 60 | <ul> |
---|
| 61 | <li><a href="annotated.html"><span>Class List</span></a></li> |
---|
[290] | 62 | <li><a href="classes.html"><span>Class Index</span></a></li> |
---|
[259] | 63 | <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> |
---|
| 64 | <li><a href="functions.html"><span>Class Members</span></a></li> |
---|
| 65 | </ul> |
---|
| 66 | </div> |
---|
[271] | 67 | <div class="navpath"><b>bdm</b>::<a class="el" href="classbdm_1_1MixEF.html">MixEF</a> |
---|
[259] | 68 | </div> |
---|
| 69 | </div> |
---|
| 70 | <div class="contents"> |
---|
[290] | 71 | <h1>bdm::MixEF Class Reference</h1><!-- doxytag: class="bdm::MixEF" --><!-- doxytag: inherits="bdm::BMEF" -->Mixture of Exponential Family Densities. |
---|
| 72 | <a href="#_details">More...</a> |
---|
[259] | 73 | <p> |
---|
[290] | 74 | <code>#include <<a class="el" href="mixef_8h-source.html">mixef.h</a>></code> |
---|
| 75 | <p> |
---|
[259] | 76 | |
---|
| 77 | <p> |
---|
[290] | 78 | <a href="classbdm_1_1MixEF-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> |
---|
[259] | 79 | <tr><td></td></tr> |
---|
| 80 | <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> |
---|
| 81 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4efe67d414ff34a1e7534004fd061241"></a><!-- doxytag: member="bdm::MixEF::MixEF" ref="4efe67d414ff34a1e7534004fd061241" args="(const Array< BMEF * > &Coms0, const vec &alpha0)" --> |
---|
[354] | 82 | </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#4efe67d414ff34a1e7534004fd061241">MixEF</a> (const Array< <a class="el" href="classbdm_1_1BMEF.html">BMEF</a> * > &Coms0, const vec &alpha0)</td></tr> |
---|
[259] | 83 | |
---|
| 84 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Full constructor. <br></td></tr> |
---|
| 85 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0266854387338ba757e6192d62907984"></a><!-- doxytag: member="bdm::MixEF::MixEF" ref="0266854387338ba757e6192d62907984" args="()" --> |
---|
| 86 | </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#0266854387338ba757e6192d62907984">MixEF</a> ()</td></tr> |
---|
| 87 | |
---|
| 88 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor of empty mixture. <br></td></tr> |
---|
| 89 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9577de85c3e3481f7c0e23cf8f87c482"></a><!-- doxytag: member="bdm::MixEF::MixEF" ref="9577de85c3e3481f7c0e23cf8f87c482" args="(const MixEF &M2)" --> |
---|
| 90 | </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#9577de85c3e3481f7c0e23cf8f87c482">MixEF</a> (const <a class="el" href="classbdm_1_1MixEF.html">MixEF</a> &M2)</td></tr> |
---|
| 91 | |
---|
| 92 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <br></td></tr> |
---|
| 93 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#0c2a50789b30769964a909d217125ed2">init</a> (<a class="el" href="classbdm_1_1BMEF.html">BMEF</a> *Com0, const mat &Data, int c=5)</td></tr> |
---|
| 94 | |
---|
| 95 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5bd7da667da183eed1577f11dff0c1f1"></a><!-- doxytag: member="bdm::MixEF::bayes" ref="5bd7da667da183eed1577f11dff0c1f1" args="(const vec &dt)" --> |
---|
| 96 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#5bd7da667da183eed1577f11dff0c1f1">bayes</a> (const vec &dt)</td></tr> |
---|
| 97 | |
---|
| 98 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006. <br></td></tr> |
---|
| 99 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5c41d5a4403da6e629f6bdfc70c43d20"></a><!-- doxytag: member="bdm::MixEF::bayes" ref="5c41d5a4403da6e629f6bdfc70c43d20" args="(const mat &dt)" --> |
---|
| 100 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#5c41d5a4403da6e629f6bdfc70c43d20">bayes</a> (const mat &dt)</td></tr> |
---|
| 101 | |
---|
| 102 | <tr><td class="mdescLeft"> </td><td class="mdescRight">EM algorithm. <br></td></tr> |
---|
| 103 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5de521c395e93478df00d881ab8dac81"></a><!-- doxytag: member="bdm::MixEF::bayesB" ref="5de521c395e93478df00d881ab8dac81" args="(const mat &dt, const vec &wData)" --> |
---|
| 104 | void </td><td class="memItemRight" valign="bottom"><b>bayesB</b> (const mat &dt, const vec &wData)</td></tr> |
---|
| 105 | |
---|
| 106 | <tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#da724da464a75e07521941e430929efa">logpred</a> (const vec &dt) const </td></tr> |
---|
| 107 | |
---|
[271] | 108 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4830916adef7891a207e42f39aaf787b"></a><!-- doxytag: member="bdm::MixEF::posterior" ref="4830916adef7891a207e42f39aaf787b" args="() const " --> |
---|
| 109 | const <a class="el" href="classbdm_1_1epdf.html">epdf</a> & </td><td class="memItemRight" valign="bottom"><b>posterior</b> () const </td></tr> |
---|
[259] | 110 | |
---|
| 111 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ea8be6f0703d87b7c4c3e77fd07e28c8"></a><!-- doxytag: member="bdm::MixEF::_e" ref="ea8be6f0703d87b7c4c3e77fd07e28c8" args="() const " --> |
---|
[270] | 112 | const <a class="el" href="classbdm_1_1eprod.html">eprod</a> * </td><td class="memItemRight" valign="bottom"><b>_e</b> () const </td></tr> |
---|
[259] | 113 | |
---|
[270] | 114 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="edc50e9640f049b846084748b18469a2"></a><!-- doxytag: member="bdm::MixEF::epredictor" ref="edc50e9640f049b846084748b18469a2" args="() const " --> |
---|
| 115 | <a class="el" href="classbdm_1_1emix.html">emix</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#edc50e9640f049b846084748b18469a2">epredictor</a> () const </td></tr> |
---|
[259] | 116 | |
---|
[354] | 117 | <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_52.png">. <br></td></tr> |
---|
[259] | 118 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f0dfb4375fef4e61c4cb062e5bac7c8c"></a><!-- doxytag: member="bdm::MixEF::flatten" ref="f0dfb4375fef4e61c4cb062e5bac7c8c" args="(const BMEF *M2)" --> |
---|
| 119 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#f0dfb4375fef4e61c4cb062e5bac7c8c">flatten</a> (const <a class="el" href="classbdm_1_1BMEF.html">BMEF</a> *M2)</td></tr> |
---|
| 120 | |
---|
| 121 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Flatten the density as if it was not estimated from the data. <br></td></tr> |
---|
| 122 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="251ef6fc51757712693da5faae5317c9"></a><!-- doxytag: member="bdm::MixEF::_Coms" ref="251ef6fc51757712693da5faae5317c9" args="(int i)" --> |
---|
| 123 | <a class="el" href="classbdm_1_1BMEF.html">BMEF</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#251ef6fc51757712693da5faae5317c9">_Coms</a> (int i)</td></tr> |
---|
| 124 | |
---|
| 125 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Access function. <br></td></tr> |
---|
| 126 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="664529d52cc667383b39eeb440ccd577"></a><!-- doxytag: member="bdm::MixEF::set_method" ref="664529d52cc667383b39eeb440ccd577" args="(MixEF_METHOD M)" --> |
---|
| 127 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#664529d52cc667383b39eeb440ccd577">set_method</a> (MixEF_METHOD M)</td></tr> |
---|
| 128 | |
---|
| 129 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set which method is to be used. <br></td></tr> |
---|
| 130 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d2b528b7a41ca67163152142f5404051"></a><!-- doxytag: member="bdm::MixEF::set_statistics" ref="d2b528b7a41ca67163152142f5404051" args="(const BMEF *BM0)" --> |
---|
| 131 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BMEF.html#d2b528b7a41ca67163152142f5404051">set_statistics</a> (const <a class="el" href="classbdm_1_1BMEF.html">BMEF</a> *BM0)</td></tr> |
---|
| 132 | |
---|
| 133 | <tr><td class="mdescLeft"> </td><td class="mdescRight">get statistics from another model <br></td></tr> |
---|
| 134 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bf58deb99af2a6cc674f13ff90300de6"></a><!-- doxytag: member="bdm::MixEF::bayes" ref="bf58deb99af2a6cc674f13ff90300de6" args="(const vec &data, const double w)" --> |
---|
| 135 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BMEF.html#bf58deb99af2a6cc674f13ff90300de6">bayes</a> (const vec &data, const double w)</td></tr> |
---|
| 136 | |
---|
| 137 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Weighted update of sufficient statistics (Bayes rule). <br></td></tr> |
---|
[290] | 138 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="62d2e4691bed41a1efa6b9c2e35e5c67"></a><!-- doxytag: member="bdm::MixEF::_copy_" ref="62d2e4691bed41a1efa6b9c2e35e5c67" args="() const " --> |
---|
| 139 | <a class="el" href="classbdm_1_1BMEF.html">BMEF</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BMEF.html#62d2e4691bed41a1efa6b9c2e35e5c67">_copy_</a> () const </td></tr> |
---|
[259] | 140 | |
---|
| 141 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Flatten the posterior as if to keep nu0 data. <br></td></tr> |
---|
[368] | 142 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e47a8bd9337478fa4e46d5a2a4336f9a"></a><!-- doxytag: member="bdm::MixEF::to_string" ref="e47a8bd9337478fa4e46d5a2a4336f9a" args="()" --> |
---|
| 143 | virtual string </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1bdmroot.html#e47a8bd9337478fa4e46d5a2a4336f9a">to_string</a> ()</td></tr> |
---|
[353] | 144 | |
---|
| 145 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method returns a basic info about the current instance. <br></td></tr> |
---|
| 146 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d4602efd3ad9fb9e4532426e4f488df8"></a><!-- doxytag: member="bdm::MixEF::from_setting" ref="d4602efd3ad9fb9e4532426e4f488df8" args="(const Setting &root)" --> |
---|
| 147 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1bdmroot.html#d4602efd3ad9fb9e4532426e4f488df8">from_setting</a> (const Setting &root)</td></tr> |
---|
| 148 | |
---|
| 149 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method arrange instance properties according the data stored in the Setting structure. <br></td></tr> |
---|
[354] | 150 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dd74cb898b22b95b7ee528e040a07618"></a><!-- doxytag: member="bdm::MixEF::to_setting" ref="dd74cb898b22b95b7ee528e040a07618" args="(Setting &root) const " --> |
---|
| 151 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1bdmroot.html#dd74cb898b22b95b7ee528e040a07618">to_setting</a> (Setting &root) const </td></tr> |
---|
[353] | 152 | |
---|
| 153 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method save all the instance properties into the Setting structure. <br></td></tr> |
---|
[368] | 154 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d8cc21ea15fc723065eed5f3100757a5"></a><!-- doxytag: member="bdm::MixEF::validate" ref="d8cc21ea15fc723065eed5f3100757a5" args="()" --> |
---|
| 155 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1bdmroot.html#d8cc21ea15fc723065eed5f3100757a5">validate</a> ()</td></tr> |
---|
| 156 | |
---|
| 157 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method TODO. <br></td></tr> |
---|
[270] | 158 | <tr><td colspan="2"><div class="groupHeader">Mathematical operations</div></td></tr> |
---|
[259] | 159 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1dee3fddaf021e62d925289660a707dc"></a><!-- doxytag: member="bdm::MixEF::bayesB" ref="1dee3fddaf021e62d925289660a707dc" args="(const mat &Dt)" --> |
---|
| 160 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#1dee3fddaf021e62d925289660a707dc">bayesB</a> (const mat &Dt)</td></tr> |
---|
| 161 | |
---|
| 162 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Batch Bayes rule (columns of Dt are observations). <br></td></tr> |
---|
| 163 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0e8ebe61fb14990abe1254bd3dda5fae"></a><!-- doxytag: member="bdm::MixEF::logpred_m" ref="0e8ebe61fb14990abe1254bd3dda5fae" args="(const mat &dt) const " --> |
---|
| 164 | 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> |
---|
| 165 | |
---|
| 166 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Matrix version of logpred. <br></td></tr> |
---|
[270] | 167 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="598b25e3f3d96a5bc00a5faeb5b3c912"></a><!-- doxytag: member="bdm::MixEF::predictor" ref="598b25e3f3d96a5bc00a5faeb5b3c912" args="() const " --> |
---|
| 168 | 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> |
---|
[259] | 169 | |
---|
[385] | 170 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs a conditional density 1-step ahead predictor <img class="formulaInl" alt="$ f(d_{t+1} |d_{t+h-1}, \ldots d_{t}) $" src="form_130.png">. <br></td></tr> |
---|
[270] | 171 | <tr><td colspan="2"><div class="groupHeader">Access to attributes</div></td></tr> |
---|
[269] | 172 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ff2d8755ba0b3def927d31305c03b09c"></a><!-- doxytag: member="bdm::MixEF::_drv" ref="ff2d8755ba0b3def927d31305c03b09c" args="() const " --> |
---|
[270] | 173 | const <a class="el" href="classbdm_1_1RV.html">RV</a> & </td><td class="memItemRight" valign="bottom"><b>_drv</b> () const </td></tr> |
---|
[269] | 174 | |
---|
| 175 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f135ae6dce7e9f30c9f88229c7930b96"></a><!-- doxytag: member="bdm::MixEF::set_drv" ref="f135ae6dce7e9f30c9f88229c7930b96" args="(const RV &rv)" --> |
---|
[270] | 176 | void </td><td class="memItemRight" valign="bottom"><b>set_drv</b> (const <a class="el" href="classbdm_1_1RV.html">RV</a> &rv)</td></tr> |
---|
[269] | 177 | |
---|
[271] | 178 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b38d92f17620813ad872d86e01a26e5e"></a><!-- doxytag: member="bdm::MixEF::set_rv" ref="b38d92f17620813ad872d86e01a26e5e" args="(const RV &rv)" --> |
---|
| 179 | void </td><td class="memItemRight" valign="bottom"><b>set_rv</b> (const <a class="el" href="classbdm_1_1RV.html">RV</a> &rv)</td></tr> |
---|
| 180 | |
---|
[259] | 181 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5be65d37dedfe33a3671e7065f523a70"></a><!-- doxytag: member="bdm::MixEF::_ll" ref="5be65d37dedfe33a3671e7065f523a70" args="() const " --> |
---|
[270] | 182 | double </td><td class="memItemRight" valign="bottom"><b>_ll</b> () const </td></tr> |
---|
[259] | 183 | |
---|
| 184 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="236b3abbcc93594fc97cd86d82c1a83f"></a><!-- doxytag: member="bdm::MixEF::set_evalll" ref="236b3abbcc93594fc97cd86d82c1a83f" args="(bool evl0)" --> |
---|
[270] | 185 | void </td><td class="memItemRight" valign="bottom"><b>set_evalll</b> (bool evl0)</td></tr> |
---|
[259] | 186 | |
---|
| 187 | <tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> |
---|
| 188 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d74a8d1370c63c93ec554908ae3e6006"></a><!-- doxytag: member="bdm::MixEF::build_est" ref="d74a8d1370c63c93ec554908ae3e6006" args="()" --> |
---|
| 189 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#d74a8d1370c63c93ec554908ae3e6006">build_est</a> ()</td></tr> |
---|
| 190 | |
---|
| 191 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Auxiliary function for use in constructors. <br></td></tr> |
---|
| 192 | <tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> |
---|
| 193 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="38ca1d86e977d1c38810a3c95bf074a5"></a><!-- doxytag: member="bdm::MixEF::n" ref="38ca1d86e977d1c38810a3c95bf074a5" args="" --> |
---|
| 194 | int </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5">n</a></td></tr> |
---|
| 195 | |
---|
| 196 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Number of components. <br></td></tr> |
---|
| 197 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="90c21ab5a2af56d4b49e2eaef6eccc08"></a><!-- doxytag: member="bdm::MixEF::Coms" ref="90c21ab5a2af56d4b49e2eaef6eccc08" args="" --> |
---|
[354] | 198 | Array< <a class="el" href="classbdm_1_1BMEF.html">BMEF</a> * > </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08">Coms</a></td></tr> |
---|
[259] | 199 | |
---|
[354] | 200 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Models for Components of <img class="formulaInl" alt="$\theta_i$" src="form_15.png">. <br></td></tr> |
---|
[259] | 201 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e39faa70cebadc3296bd249040105e86"></a><!-- doxytag: member="bdm::MixEF::weights" ref="e39faa70cebadc3296bd249040105e86" args="" --> |
---|
| 202 | <a class="el" href="classbdm_1_1multiBM.html">multiBM</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86">weights</a></td></tr> |
---|
| 203 | |
---|
| 204 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Statistics for weights. <br></td></tr> |
---|
| 205 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9413fb7f1836237aac807fb9f245e4f6"></a><!-- doxytag: member="bdm::MixEF::est" ref="9413fb7f1836237aac807fb9f245e4f6" args="" --> |
---|
| 206 | <a class="el" href="classbdm_1_1eprod.html">eprod</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#9413fb7f1836237aac807fb9f245e4f6">est</a></td></tr> |
---|
| 207 | |
---|
| 208 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Posterior on component parameters. <br></td></tr> |
---|
| 209 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a2376ddadb7573532404452d0c2dd28a"></a><!-- doxytag: member="bdm::MixEF::method" ref="a2376ddadb7573532404452d0c2dd28a" args="" --> |
---|
| 210 | MixEF_METHOD </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a">method</a></td></tr> |
---|
| 211 | |
---|
| 212 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Flag for a method that is used in the inference. <br></td></tr> |
---|
| 213 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1331865e10fb1ccef65bb4c47fa3be64"></a><!-- doxytag: member="bdm::MixEF::frg" ref="1331865e10fb1ccef65bb4c47fa3be64" args="" --> |
---|
| 214 | double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64">frg</a></td></tr> |
---|
| 215 | |
---|
| 216 | <tr><td class="mdescLeft"> </td><td class="mdescRight">forgetting factor <br></td></tr> |
---|
| 217 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="06e7b3ac03e10017d4288c76888e2865"></a><!-- doxytag: member="bdm::MixEF::last_lognc" ref="06e7b3ac03e10017d4288c76888e2865" args="" --> |
---|
| 218 | double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865">last_lognc</a></td></tr> |
---|
| 219 | |
---|
| 220 | <tr><td class="mdescLeft"> </td><td class="mdescRight">cached value of lognc() in the previous step (used in evaluation of <code>ll</code> ) <br></td></tr> |
---|
[269] | 221 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c400357e37d27a4834b2b1d9211009ed"></a><!-- doxytag: member="bdm::MixEF::drv" ref="c400357e37d27a4834b2b1d9211009ed" args="" --> |
---|
| 222 | <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> |
---|
| 223 | |
---|
| 224 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Random variable of the data (optional). <br></td></tr> |
---|
[259] | 225 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4064b6559d962633e4372b12f4cd204a"></a><!-- doxytag: member="bdm::MixEF::ll" ref="4064b6559d962633e4372b12f4cd204a" args="" --> |
---|
| 226 | double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a">ll</a></td></tr> |
---|
| 227 | |
---|
| 228 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Logarithm of marginalized data likelihood. <br></td></tr> |
---|
| 229 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="faff0ad12556fe7dc0e2807d4fd938ee"></a><!-- doxytag: member="bdm::MixEF::evalll" ref="faff0ad12556fe7dc0e2807d4fd938ee" args="" --> |
---|
| 230 | bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee">evalll</a></td></tr> |
---|
| 231 | |
---|
| 232 | <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> |
---|
[290] | 233 | <tr><td colspan="2"><br><h2>Extension to conditional BM</h2></td></tr> |
---|
| 234 | <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> |
---|
| 235 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b5e8e016be16e4029c789063cb3f3b33"></a><!-- doxytag: member="bdm::MixEF::_rvc" ref="b5e8e016be16e4029c789063cb3f3b33" args="() const " --> |
---|
| 236 | 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> |
---|
| 237 | |
---|
| 238 | <tr><td class="mdescLeft"> </td><td class="mdescRight">access function <br></td></tr> |
---|
| 239 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6799f4b16a6a59ed58b1d0d6e17116f4"></a><!-- doxytag: member="bdm::MixEF::condition" ref="6799f4b16a6a59ed58b1d0d6e17116f4" args="(const vec &val)" --> |
---|
| 240 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#6799f4b16a6a59ed58b1d0d6e17116f4">condition</a> (const vec &val)</td></tr> |
---|
| 241 | |
---|
| 242 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Substitute <code>val</code> for <code>rvc</code>. <br></td></tr> |
---|
| 243 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="de95c590d650b2db423d53992f0906cb"></a><!-- doxytag: member="bdm::MixEF::rvc" ref="de95c590d650b2db423d53992f0906cb" args="" --> |
---|
| 244 | <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> |
---|
| 245 | |
---|
| 246 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Name of extension variable. <br></td></tr> |
---|
| 247 | <tr><td colspan="2"><br><h2>Logging of results</h2></td></tr> |
---|
[353] | 248 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="adb539fa2585c8a2a91c54e5aebf330e"></a><!-- doxytag: member="bdm::MixEF::set_options" ref="adb539fa2585c8a2a91c54e5aebf330e" args="(const string &opt)" --> |
---|
| 249 | 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> |
---|
[290] | 250 | |
---|
[353] | 251 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set boolean options from a string recognized are: "logbounds,logll". <br></td></tr> |
---|
[323] | 252 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2298ca6af9b13a78a4c9e18ab43f1827"></a><!-- doxytag: member="bdm::MixEF::log_add" ref="2298ca6af9b13a78a4c9e18ab43f1827" args="(logger &L, const string &name="")" --> |
---|
| 253 | 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> |
---|
[290] | 254 | |
---|
| 255 | <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> |
---|
[323] | 256 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b517e1679eaa94e803ea4cd0b8efbcd7"></a><!-- doxytag: member="bdm::MixEF::logit" ref="b517e1679eaa94e803ea4cd0b8efbcd7" args="(logger &L)" --> |
---|
| 257 | virtual void </td><td class="memItemRight" valign="bottom"><b>logit</b> (<a class="el" href="classbdm_1_1logger.html">logger</a> &L)</td></tr> |
---|
[290] | 258 | |
---|
| 259 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="109c1a626a69031658e3a44e9e500cca"></a><!-- doxytag: member="bdm::MixEF::LIDs" ref="109c1a626a69031658e3a44e9e500cca" args="" --> |
---|
| 260 | ivec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#109c1a626a69031658e3a44e9e500cca">LIDs</a></td></tr> |
---|
| 261 | |
---|
[353] | 262 | <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> |
---|
| 263 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="398b7e7a162cf37d0022d6126495f207"></a><!-- doxytag: member="bdm::MixEF::LFlags" ref="398b7e7a162cf37d0022d6126495f207" args="" --> |
---|
| 264 | ivec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BM.html#398b7e7a162cf37d0022d6126495f207">LFlags</a></td></tr> |
---|
[290] | 265 | |
---|
[353] | 266 | <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> |
---|
[259] | 267 | </table> |
---|
[290] | 268 | <hr><a name="_details"></a><h2>Detailed Description</h2> |
---|
| 269 | Mixture of Exponential Family Densities. |
---|
| 270 | <p> |
---|
| 271 | An approximate estimation method for models with latent discrete variable, such as mixture models of the following kind: <p class="formulaDsp"> |
---|
[354] | 272 | <img class="formulaDsp" alt="\[ f(y_t|\psi_t, \Theta) = \sum_{i=1}^{n} w_i f(y_t|\psi_t, \theta_i) \]" src="form_12.png"> |
---|
[290] | 273 | <p> |
---|
[354] | 274 | where <img class="formulaInl" alt="$\psi$" src="form_13.png"> is a known function of past outputs, <img class="formulaInl" alt="$w=[w_1,\ldots,w_n]$" src="form_14.png"> are component weights, and component parameters <img class="formulaInl" alt="$\theta_i$" src="form_15.png"> are assumed to be mutually independent. <img class="formulaInl" alt="$\Theta$" src="form_16.png"> is an aggregation af all component parameters and weights, i.e. <img class="formulaInl" alt="$\Theta = [\theta_1,\ldots,\theta_n,w]$" src="form_17.png">.<p> |
---|
[290] | 275 | The characteristic feature of this model is that if the exact values of the latent variable were known, estimation of the parameters can be handled by a single model. For example, for the case of mixture models, posterior density for each component parameters would be a BayesianModel from Exponential Family.<p> |
---|
| 276 | This class uses EM-style type algorithms for estimation of its parameters. Under this simplification, the posterior density is a product of exponential family members, hence under EM-style approximate estimation this class itself belongs to the exponential family.<p> |
---|
| 277 | TODO: Extend <a class="el" href="classbdm_1_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.">BM</a> to use rvc. <hr><h2>Member Function Documentation</h2> |
---|
[259] | 278 | <a class="anchor" name="0c2a50789b30769964a909d217125ed2"></a><!-- doxytag: member="bdm::MixEF::init" ref="0c2a50789b30769964a909d217125ed2" args="(BMEF *Com0, const mat &Data, int c=5)" --> |
---|
| 279 | <div class="memitem"> |
---|
| 280 | <div class="memproto"> |
---|
| 281 | <table class="memname"> |
---|
| 282 | <tr> |
---|
| 283 | <td class="memname">void bdm::MixEF::init </td> |
---|
| 284 | <td>(</td> |
---|
| 285 | <td class="paramtype"><a class="el" href="classbdm_1_1BMEF.html">BMEF</a> * </td> |
---|
| 286 | <td class="paramname"> <em>Com0</em>, </td> |
---|
| 287 | </tr> |
---|
| 288 | <tr> |
---|
| 289 | <td class="paramkey"></td> |
---|
| 290 | <td></td> |
---|
| 291 | <td class="paramtype">const mat & </td> |
---|
| 292 | <td class="paramname"> <em>Data</em>, </td> |
---|
| 293 | </tr> |
---|
| 294 | <tr> |
---|
| 295 | <td class="paramkey"></td> |
---|
| 296 | <td></td> |
---|
| 297 | <td class="paramtype">int </td> |
---|
| 298 | <td class="paramname"> <em>c</em> = <code>5</code></td><td> </td> |
---|
| 299 | </tr> |
---|
| 300 | <tr> |
---|
| 301 | <td></td> |
---|
| 302 | <td>)</td> |
---|
| 303 | <td></td><td></td><td></td> |
---|
| 304 | </tr> |
---|
| 305 | </table> |
---|
| 306 | </div> |
---|
| 307 | <div class="memdoc"> |
---|
| 308 | |
---|
| 309 | <p> |
---|
| 310 | Initializing the mixture by a random pick of centroids from data <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
| 311 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 312 | <tr><td valign="top"></td><td valign="top"><em>Com0</em> </td><td>Initial component - necessary to determine its type. </td></tr> |
---|
| 313 | <tr><td valign="top"></td><td valign="top"><em>Data</em> </td><td>Data on which the initialization will be done </td></tr> |
---|
| 314 | <tr><td valign="top"></td><td valign="top"><em>c</em> </td><td>Initial number of components, default=5 </td></tr> |
---|
| 315 | </table> |
---|
| 316 | </dl> |
---|
| 317 | |
---|
[385] | 318 | <p>References <a class="el" href="libEF_8h-source.html#l00101">bdm::BMEF::_copy_()</a>, <a class="el" href="mixef_8h-source.html#l00057">build_est()</a>, <a class="el" href="mixef_8h-source.html#l00046">Coms</a>, <a class="el" href="mixef_8h-source.html#l00050">est</a>, <a class="el" href="mixef_8h-source.html#l00044">n</a>, <a class="el" href="libEF_8h-source.html#l00328">bdm::multiBM::set_parameters()</a>, and <a class="el" href="mixef_8h-source.html#l00048">weights</a>.</p> |
---|
[259] | 319 | |
---|
| 320 | </div> |
---|
| 321 | </div><p> |
---|
| 322 | <a class="anchor" name="da724da464a75e07521941e430929efa"></a><!-- doxytag: member="bdm::MixEF::logpred" ref="da724da464a75e07521941e430929efa" args="(const vec &dt) const " --> |
---|
| 323 | <div class="memitem"> |
---|
| 324 | <div class="memproto"> |
---|
| 325 | <table class="memname"> |
---|
| 326 | <tr> |
---|
| 327 | <td class="memname">double bdm::MixEF::logpred </td> |
---|
| 328 | <td>(</td> |
---|
| 329 | <td class="paramtype">const vec & </td> |
---|
| 330 | <td class="paramname"> <em>dt</em> </td> |
---|
| 331 | <td> ) </td> |
---|
| 332 | <td> const<code> [virtual]</code></td> |
---|
| 333 | </tr> |
---|
| 334 | </table> |
---|
| 335 | </div> |
---|
| 336 | <div class="memdoc"> |
---|
| 337 | |
---|
| 338 | <p> |
---|
| 339 | Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out. |
---|
| 340 | <p>Reimplemented from <a class="el" href="classbdm_1_1BM.html#50257e0c1e5b5c73153ea6e716ad8ae0">bdm::BM</a>.</p> |
---|
| 341 | |
---|
[385] | 342 | <p>References <a class="el" href="mixef_8h-source.html#l00046">Coms</a>, <a class="el" href="libBM_8h-source.html#l00274">bdm::epdf::mean()</a>, <a class="el" href="libEF_8h-source.html#l00326">bdm::multiBM::posterior()</a>, and <a class="el" href="mixef_8h-source.html#l00048">weights</a>.</p> |
---|
[259] | 343 | |
---|
| 344 | </div> |
---|
| 345 | </div><p> |
---|
| 346 | <hr>The documentation for this class was generated from the following files:<ul> |
---|
[261] | 347 | <li><a class="el" href="mixef_8h-source.html">mixef.h</a><li>mixef.cpp</ul> |
---|
[259] | 348 | </div> |
---|
[385] | 349 | <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 17 14:13:29 2009 for mixpp by |
---|
[259] | 350 | <a href="http://www.doxygen.org/index.html"> |
---|
[290] | 351 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
[259] | 352 | </body> |
---|
| 353 | </html> |
---|