73 | | <a name="l00101"></a>00101 |
74 | | <a name="l00102"></a><a class="code" href="classepdf.html">00102</a> <span class="keyword">class </span><a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> { |
75 | | <a name="l00103"></a>00103 <span class="keyword">protected</span>: |
76 | | <a name="l00105"></a><a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">00105</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a>; |
77 | | <a name="l00106"></a>00106 <span class="keyword">public</span>: |
78 | | <a name="l00108"></a><a class="code" href="classepdf.html#d8eb760037b3bad5a0d64081606697cd">00108</a> <a class="code" href="classepdf.html#d8eb760037b3bad5a0d64081606697cd" title="default constructor">epdf</a>() :<a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a> ( ivec ( 0 ) ) {}; |
79 | | <a name="l00109"></a>00109 |
80 | | <a name="l00111"></a><a class="code" href="classepdf.html#c95b1a27a8dd9507bb9a5a3cb2809c7a">00111</a> <a class="code" href="classepdf.html#d8eb760037b3bad5a0d64081606697cd" title="default constructor">epdf</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv0 ) :<a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a> ( rv0 ) {}; |
81 | | <a name="l00112"></a>00112 |
82 | | <a name="l00114"></a>00114 <span class="comment">// virtual vec moment ( const int order = 1 );</span> |
83 | | <a name="l00116"></a>00116 <span class="comment"></span> <span class="keyword">virtual</span> vec <a class="code" href="classepdf.html#8019654e494bf5e458f6fb947e11b262" title="Returns the required moment of the epdf.">sample</a> () <span class="keyword">const</span> =0; |
84 | | <a name="l00118"></a><a class="code" href="classepdf.html#3ea597362e11a0040fe7c990269d072c">00118</a> <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classepdf.html#3ea597362e11a0040fe7c990269d072c" title="Compute probability of argument val.">eval</a> ( <span class="keyword">const</span> vec &val )<span class="keyword"> const </span>{<span class="keywordflow">return</span> exp(this->evalpdflog(val));}; |
85 | | <a name="l00119"></a>00119 |
86 | | <a name="l00121"></a>00121 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classepdf.html#6aef3eca74899692503769c18add1a4c" title="Compute log-probability of argument val.">evalpdflog</a> ( <span class="keyword">const</span> vec &val ) <span class="keyword">const</span> =0; |
87 | | <a name="l00122"></a>00122 |
88 | | <a name="l00124"></a>00124 <span class="keyword">virtual</span> vec <a class="code" href="classepdf.html#bf0a070a8f3e67a93604ca724638b870" title="return expected value">mean</a>() <span class="keyword">const</span> =0; |
89 | | <a name="l00125"></a>00125 |
90 | | <a name="l00127"></a><a class="code" href="classepdf.html#0a322dd106f04c0a2915e3d4f4227396">00127</a> <span class="keyword">virtual</span> <a class="code" href="classepdf.html#0a322dd106f04c0a2915e3d4f4227396" title="Destructor for future use;.">~epdf</a>() {}; |
91 | | <a name="l00129"></a><a class="code" href="classepdf.html#b89143f12c9b49282e30841e4fb5f337">00129</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classepdf.html#b89143f12c9b49282e30841e4fb5f337" title="access function">_rv</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a>;} |
92 | | <a name="l00130"></a>00130 }; |
93 | | <a name="l00131"></a>00131 |
94 | | <a name="l00132"></a>00132 |
95 | | <a name="l00134"></a>00134 <span class="comment">//TODO Samplecond can be generalized</span> |
96 | | <a name="l00135"></a>00135 |
97 | | <a name="l00136"></a><a class="code" href="classmpdf.html">00136</a> <span class="keyword">class </span><a class="code" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> { |
98 | | <a name="l00137"></a>00137 <span class="keyword">protected</span>: |
99 | | <a name="l00139"></a><a class="code" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb">00139</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb" title="modeled random variable">rv</a>; |
100 | | <a name="l00141"></a><a class="code" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab">00141</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab" title="random variable in condition">rvc</a>; |
101 | | <a name="l00143"></a><a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c">00143</a> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* <a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>; |
102 | | <a name="l00144"></a>00144 <span class="keyword">public</span>: |
103 | | <a name="l00145"></a>00145 |
104 | | <a name="l00147"></a>00147 <span class="comment">// virtual fnc moment ( const int order = 1 );</span> |
105 | | <a name="l00149"></a><a class="code" href="classmpdf.html#b0193a350c97933ddf15b15a130da352">00149</a> <span class="comment"></span> <span class="keyword">virtual</span> vec <a class="code" href="classmpdf.html#b0193a350c97933ddf15b15a130da352" title="Returns the required moment of the epdf.">samplecond</a> ( vec &cond, <span class="keywordtype">double</span> &ll ) {this-><a class="code" href="classmpdf.html#0f95a0cc6ab40611f46804682446ed83" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a>(cond);vec temp= <a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>-><a class="code" href="classepdf.html#8019654e494bf5e458f6fb947e11b262" title="Returns the required moment of the epdf.">sample</a>();ll=<a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>-><a class="code" href="classepdf.html#6aef3eca74899692503769c18add1a4c" title="Compute log-probability of argument val.">evalpdflog</a>(temp);<span class="keywordflow">return</span> temp;}; |
106 | | <a name="l00151"></a><a class="code" href="classmpdf.html#0f95a0cc6ab40611f46804682446ed83">00151</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmpdf.html#0f95a0cc6ab40611f46804682446ed83" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &cond ) {}; |
107 | | <a name="l00152"></a>00152 |
108 | | <a name="l00154"></a><a class="code" href="classmpdf.html#80b738ece5bd4f8c4edaee4b38906f91">00154</a> <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmpdf.html#80b738ece5bd4f8c4edaee4b38906f91" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evalcond</a> (<span class="keyword">const</span> vec &dt, <span class="keyword">const</span> vec &cond ) {this-><a class="code" href="classmpdf.html#0f95a0cc6ab40611f46804682446ed83" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a>(cond);<span class="keywordflow">return</span> <a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>-><a class="code" href="classepdf.html#3ea597362e11a0040fe7c990269d072c" title="Compute probability of argument val.">eval</a>(dt);}; |
109 | | <a name="l00155"></a>00155 |
110 | | <a name="l00157"></a><a class="code" href="classmpdf.html#6788be9f3a888796499c5293a318fcfb">00157</a> <span class="keyword">virtual</span> <a class="code" href="classmpdf.html#6788be9f3a888796499c5293a318fcfb" title="Destructor for future use;.">~mpdf</a>() {}; |
111 | | <a name="l00158"></a>00158 |
112 | | <a name="l00160"></a><a class="code" href="classmpdf.html#581ecf362185d37c08bb31cb9d046d6f">00160</a> <a class="code" href="classmpdf.html#581ecf362185d37c08bb31cb9d046d6f" title="Default constructor.">mpdf</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv0, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rvc0 ) :<a class="code" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb" title="modeled random variable">rv</a> ( rv0 ),<a class="code" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab" title="random variable in condition">rvc</a> ( rvc0 ) {}; |
113 | | <a name="l00162"></a><a class="code" href="classmpdf.html#ec9c850305984582548e8deb64f0ffe8">00162</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classmpdf.html#ec9c850305984582548e8deb64f0ffe8" title="access function">_rvc</a>(){<span class="keywordflow">return</span> <a class="code" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab" title="random variable in condition">rvc</a>;} |
114 | | <a name="l00164"></a><a class="code" href="classmpdf.html#e17780ee5b2cfe05922a6c56af1462f8">00164</a> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>& <a class="code" href="classmpdf.html#e17780ee5b2cfe05922a6c56af1462f8" title="access function">_epdf</a>(){<span class="keywordflow">return</span> *<a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>;} |
115 | | <a name="l00165"></a>00165 }; |
116 | | <a name="l00166"></a>00166 |
117 | | <a name="l00174"></a><a class="code" href="classDS.html">00174</a> <span class="keyword">class </span><a class="code" href="classDS.html" title="Abstract class for discrete-time sources of data.">DS</a> { |
118 | | <a name="l00175"></a>00175 <span class="keyword">protected</span>: |
119 | | <a name="l00177"></a><a class="code" href="classDS.html#1012025a1a3a1fdd24aa48698a3d3454">00177</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classDS.html#1012025a1a3a1fdd24aa48698a3d3454" title="Observed variables, returned by getdata().">Drv</a>; |
120 | | <a name="l00179"></a><a class="code" href="classDS.html#0a88ffaeb3c7c2cf30c69bc41a000629">00179</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classDS.html#0a88ffaeb3c7c2cf30c69bc41a000629" title="Action variables, accepted by write().">Urv</a>; <span class="comment">//</span> |
121 | | <a name="l00180"></a>00180 <span class="keyword">public</span>: |
122 | | <a name="l00182"></a>00182 <span class="keywordtype">void</span> <a class="code" href="classDS.html#db2dacc9e71a36eeb9c5c2ee402eeeb1" title="Returns full vector of observed data.">getdata</a> ( vec &dt ); |
123 | | <a name="l00184"></a>00184 <span class="keywordtype">void</span> <a class="code" href="classDS.html#db2dacc9e71a36eeb9c5c2ee402eeeb1" title="Returns full vector of observed data.">getdata</a> ( vec &dt, ivec &indeces ); |
124 | | <a name="l00186"></a>00186 <span class="keywordtype">void</span> <a class="code" href="classDS.html#0dfb6788b70c0d48a1f5276ed6c93039" title="Accepts action variable and schedule it for application.">write</a> ( vec &ut ); |
125 | | <a name="l00188"></a>00188 <span class="keywordtype">void</span> <a class="code" href="classDS.html#0dfb6788b70c0d48a1f5276ed6c93039" title="Accepts action variable and schedule it for application.">write</a> ( vec &ut, ivec &indeces ); |
126 | | <a name="l00194"></a>00194 <span class="keywordtype">void</span> <a class="code" href="classDS.html#9a35ca9c9321dce2bf63bf668f785b75" title="Method that assigns random variables to the datasource. Typically, the datasource...">linkrvs</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &drv, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &urv ); |
127 | | <a name="l00195"></a>00195 |
128 | | <a name="l00197"></a>00197 <span class="keywordtype">void</span> <a class="code" href="classDS.html#470ba89e8e7c3c4d830803221b4e9be6" title="Moves from $t$ to $t+1$, i.e. perfroms the actions and reads response of the system...">step</a>(); |
129 | | <a name="l00198"></a>00198 |
130 | | <a name="l00199"></a>00199 }; |
| 72 | <a name="l00101"></a><a class="code" href="classfnc.html#17164c202f6feee3d708b8caab6306ab">00101</a> <span class="keyword">virtual</span> <a class="code" href="classfnc.html#17164c202f6feee3d708b8caab6306ab" title="Destructor for future use;.">~fnc</a>() {}; |
| 73 | <a name="l00102"></a>00102 }; |
| 74 | <a name="l00103"></a>00103 |
| 75 | <a name="l00104"></a>00104 |
| 76 | <a name="l00106"></a>00106 |
| 77 | <a name="l00107"></a><a class="code" href="classepdf.html">00107</a> <span class="keyword">class </span><a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> { |
| 78 | <a name="l00108"></a>00108 <span class="keyword">protected</span>: |
| 79 | <a name="l00110"></a><a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">00110</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a>; |
| 80 | <a name="l00111"></a>00111 <span class="keyword">public</span>: |
| 81 | <a name="l00113"></a><a class="code" href="classepdf.html#d8eb760037b3bad5a0d64081606697cd">00113</a> <a class="code" href="classepdf.html#d8eb760037b3bad5a0d64081606697cd" title="default constructor">epdf</a>() :<a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a> ( ivec ( 0 ) ) {}; |
| 82 | <a name="l00114"></a>00114 |
| 83 | <a name="l00116"></a><a class="code" href="classepdf.html#c95b1a27a8dd9507bb9a5a3cb2809c7a">00116</a> <a class="code" href="classepdf.html#d8eb760037b3bad5a0d64081606697cd" title="default constructor">epdf</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv0 ) :<a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a> ( rv0 ) {}; |
| 84 | <a name="l00117"></a>00117 |
| 85 | <a name="l00119"></a>00119 <span class="comment">// virtual vec moment ( const int order = 1 );</span> |
| 86 | <a name="l00121"></a>00121 <span class="comment"></span> <span class="keyword">virtual</span> vec <a class="code" href="classepdf.html#8019654e494bf5e458f6fb947e11b262" title="Returns the required moment of the epdf.">sample</a> () <span class="keyword">const</span> =0; |
| 87 | <a name="l00123"></a><a class="code" href="classepdf.html#3ea597362e11a0040fe7c990269d072c">00123</a> <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classepdf.html#3ea597362e11a0040fe7c990269d072c" title="Compute probability of argument val.">eval</a> ( <span class="keyword">const</span> vec &val )<span class="keyword"> const </span>{<span class="keywordflow">return</span> exp(this->evalpdflog(val));}; |
| 88 | <a name="l00124"></a>00124 |
| 89 | <a name="l00126"></a>00126 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classepdf.html#6aef3eca74899692503769c18add1a4c" title="Compute log-probability of argument val.">evalpdflog</a> ( <span class="keyword">const</span> vec &val ) <span class="keyword">const</span> =0; |
| 90 | <a name="l00127"></a>00127 |
| 91 | <a name="l00129"></a>00129 <span class="keyword">virtual</span> vec <a class="code" href="classepdf.html#bf0a070a8f3e67a93604ca724638b870" title="return expected value">mean</a>() <span class="keyword">const</span> =0; |
| 92 | <a name="l00130"></a>00130 |
| 93 | <a name="l00132"></a><a class="code" href="classepdf.html#0a322dd106f04c0a2915e3d4f4227396">00132</a> <span class="keyword">virtual</span> <a class="code" href="classepdf.html#0a322dd106f04c0a2915e3d4f4227396" title="Destructor for future use;.">~epdf</a>() {}; |
| 94 | <a name="l00134"></a><a class="code" href="classepdf.html#b89143f12c9b49282e30841e4fb5f337">00134</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classepdf.html#b89143f12c9b49282e30841e4fb5f337" title="access function">_rv</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a>;} |
| 95 | <a name="l00135"></a>00135 }; |
| 96 | <a name="l00136"></a>00136 |
| 97 | <a name="l00137"></a>00137 |
| 98 | <a name="l00139"></a>00139 <span class="comment">//TODO Samplecond can be generalized</span> |
| 99 | <a name="l00140"></a>00140 |
| 100 | <a name="l00141"></a><a class="code" href="classmpdf.html">00141</a> <span class="keyword">class </span><a class="code" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> { |
| 101 | <a name="l00142"></a>00142 <span class="keyword">protected</span>: |
| 102 | <a name="l00144"></a><a class="code" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb">00144</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb" title="modeled random variable">rv</a>; |
| 103 | <a name="l00146"></a><a class="code" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab">00146</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab" title="random variable in condition">rvc</a>; |
| 104 | <a name="l00148"></a><a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c">00148</a> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* <a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>; |
| 105 | <a name="l00149"></a>00149 <span class="keyword">public</span>: |
| 106 | <a name="l00150"></a>00150 |
| 107 | <a name="l00152"></a>00152 <span class="comment">// virtual fnc moment ( const int order = 1 );</span> |
| 108 | <a name="l00154"></a><a class="code" href="classmpdf.html#b0193a350c97933ddf15b15a130da352">00154</a> <span class="comment"></span> <span class="keyword">virtual</span> vec <a class="code" href="classmpdf.html#b0193a350c97933ddf15b15a130da352" title="Returns the required moment of the epdf.">samplecond</a> ( vec &cond, <span class="keywordtype">double</span> &ll ) {this-><a class="code" href="classmpdf.html#0f95a0cc6ab40611f46804682446ed83" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a>(cond);vec temp= <a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>-><a class="code" href="classepdf.html#8019654e494bf5e458f6fb947e11b262" title="Returns the required moment of the epdf.">sample</a>();ll=<a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>-><a class="code" href="classepdf.html#6aef3eca74899692503769c18add1a4c" title="Compute log-probability of argument val.">evalpdflog</a>(temp);<span class="keywordflow">return</span> temp;}; |
| 109 | <a name="l00156"></a><a class="code" href="classmpdf.html#0f95a0cc6ab40611f46804682446ed83">00156</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmpdf.html#0f95a0cc6ab40611f46804682446ed83" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &cond ) {}; |
| 110 | <a name="l00157"></a>00157 |
| 111 | <a name="l00159"></a><a class="code" href="classmpdf.html#80b738ece5bd4f8c4edaee4b38906f91">00159</a> <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmpdf.html#80b738ece5bd4f8c4edaee4b38906f91" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evalcond</a> (<span class="keyword">const</span> vec &dt, <span class="keyword">const</span> vec &cond ) {this-><a class="code" href="classmpdf.html#0f95a0cc6ab40611f46804682446ed83" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a>(cond);<span class="keywordflow">return</span> <a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>-><a class="code" href="classepdf.html#3ea597362e11a0040fe7c990269d072c" title="Compute probability of argument val.">eval</a>(dt);}; |
| 112 | <a name="l00160"></a>00160 |
| 113 | <a name="l00162"></a><a class="code" href="classmpdf.html#6788be9f3a888796499c5293a318fcfb">00162</a> <span class="keyword">virtual</span> <a class="code" href="classmpdf.html#6788be9f3a888796499c5293a318fcfb" title="Destructor for future use;.">~mpdf</a>() {}; |
| 114 | <a name="l00163"></a>00163 |
| 115 | <a name="l00165"></a><a class="code" href="classmpdf.html#581ecf362185d37c08bb31cb9d046d6f">00165</a> <a class="code" href="classmpdf.html#581ecf362185d37c08bb31cb9d046d6f" title="Default constructor.">mpdf</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv0, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rvc0 ) :<a class="code" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb" title="modeled random variable">rv</a> ( rv0 ),<a class="code" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab" title="random variable in condition">rvc</a> ( rvc0 ) {}; |
| 116 | <a name="l00167"></a><a class="code" href="classmpdf.html#ec9c850305984582548e8deb64f0ffe8">00167</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classmpdf.html#ec9c850305984582548e8deb64f0ffe8" title="access function">_rvc</a>(){<span class="keywordflow">return</span> <a class="code" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab" title="random variable in condition">rvc</a>;} |
| 117 | <a name="l00169"></a><a class="code" href="classmpdf.html#e17780ee5b2cfe05922a6c56af1462f8">00169</a> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>& <a class="code" href="classmpdf.html#e17780ee5b2cfe05922a6c56af1462f8" title="access function">_epdf</a>(){<span class="keywordflow">return</span> *<a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>;} |
| 118 | <a name="l00170"></a>00170 }; |
| 119 | <a name="l00171"></a>00171 |
| 120 | <a name="l00179"></a><a class="code" href="classDS.html">00179</a> <span class="keyword">class </span><a class="code" href="classDS.html" title="Abstract class for discrete-time sources of data.">DS</a> { |
| 121 | <a name="l00180"></a>00180 <span class="keyword">protected</span>: |
| 122 | <a name="l00182"></a><a class="code" href="classDS.html#1012025a1a3a1fdd24aa48698a3d3454">00182</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classDS.html#1012025a1a3a1fdd24aa48698a3d3454" title="Observed variables, returned by getdata().">Drv</a>; |
| 123 | <a name="l00184"></a><a class="code" href="classDS.html#0a88ffaeb3c7c2cf30c69bc41a000629">00184</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classDS.html#0a88ffaeb3c7c2cf30c69bc41a000629" title="Action variables, accepted by write().">Urv</a>; <span class="comment">//</span> |
| 124 | <a name="l00185"></a>00185 <span class="keyword">public</span>: |
| 125 | <a name="l00187"></a>00187 <span class="keywordtype">void</span> <a class="code" href="classDS.html#db2dacc9e71a36eeb9c5c2ee402eeeb1" title="Returns full vector of observed data.">getdata</a> ( vec &dt ); |
| 126 | <a name="l00189"></a>00189 <span class="keywordtype">void</span> <a class="code" href="classDS.html#db2dacc9e71a36eeb9c5c2ee402eeeb1" title="Returns full vector of observed data.">getdata</a> ( vec &dt, ivec &indeces ); |
| 127 | <a name="l00191"></a>00191 <span class="keywordtype">void</span> <a class="code" href="classDS.html#0dfb6788b70c0d48a1f5276ed6c93039" title="Accepts action variable and schedule it for application.">write</a> ( vec &ut ); |
| 128 | <a name="l00193"></a>00193 <span class="keywordtype">void</span> <a class="code" href="classDS.html#0dfb6788b70c0d48a1f5276ed6c93039" title="Accepts action variable and schedule it for application.">write</a> ( vec &ut, ivec &indeces ); |
| 129 | <a name="l00199"></a>00199 <span class="keywordtype">void</span> <a class="code" href="classDS.html#9a35ca9c9321dce2bf63bf668f785b75" title="Method that assigns random variables to the datasource. Typically, the datasource...">linkrvs</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &drv, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &urv ); |
132 | | <a name="l00205"></a><a class="code" href="classBM.html">00205</a> <span class="keyword">class </span><a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> { |
133 | | <a name="l00206"></a>00206 <span class="keyword">protected</span>: |
134 | | <a name="l00208"></a><a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88">00208</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a>; |
135 | | <a name="l00210"></a><a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979">00210</a> <span class="keywordtype">double</span> <a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a>; |
136 | | <a name="l00212"></a><a class="code" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129">00212</a> <span class="keywordtype">bool</span> <a class="code" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a>; |
137 | | <a name="l00213"></a>00213 <span class="keyword">public</span>: |
138 | | <a name="l00214"></a>00214 |
139 | | <a name="l00216"></a><a class="code" href="classBM.html#605d28b426adb677c86a57ddb525132a">00216</a> <a class="code" href="classBM.html#605d28b426adb677c86a57ddb525132a" title="Default constructor.">BM</a>(<span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv0) :<a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a>(rv0), <a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a> ( 0 ),<a class="code" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ( true ) {<span class="comment">//Fixme: test rv </span> |
140 | | <a name="l00217"></a>00217 }; |
141 | | <a name="l00218"></a>00218 |
142 | | <a name="l00222"></a>00222 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBM.html#a892eff438aab2dd1a9e2efcb7fb5bdf" title="Incremental Bayes rule.">bayes</a> ( <span class="keyword">const</span> vec &dt ) = 0; |
143 | | <a name="l00224"></a>00224 <span class="keywordtype">void</span> <a class="code" href="classBM.html#a892eff438aab2dd1a9e2efcb7fb5bdf" title="Incremental Bayes rule.">bayes</a> ( mat Dt ); |
144 | | <a name="l00226"></a>00226 <span class="keyword">virtual</span> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>& <a class="code" href="classBM.html#3dc45554556926bde996a267636abe55" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_epdf</a>()=0; |
145 | | <a name="l00227"></a>00227 |
146 | | <a name="l00229"></a><a class="code" href="classBM.html#ca0f02b3b4144e0895cc14f7e0374bdd">00229</a> <span class="keyword">virtual</span> <a class="code" href="classBM.html#ca0f02b3b4144e0895cc14f7e0374bdd" title="Destructor for future use;.">~BM</a>() {}; |
147 | | <a name="l00231"></a><a class="code" href="classBM.html#126bd2595c48e311fc2a7ab72876092a">00231</a> <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>& <a class="code" href="classBM.html#126bd2595c48e311fc2a7ab72876092a" title="access function">_rv</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a>;} |
148 | | <a name="l00233"></a><a class="code" href="classBM.html#87f4a547d2c29180be88175e5eab9c88">00233</a> <span class="keywordtype">double</span> <a class="code" href="classBM.html#87f4a547d2c29180be88175e5eab9c88" title="access function">_ll</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a>;} |
149 | | <a name="l00234"></a>00234 }; |
150 | | <a name="l00235"></a>00235 |
151 | | <a name="l00245"></a><a class="code" href="classBMcond.html">00245</a> <span class="keyword">class </span><a class="code" href="classBMcond.html" title="Conditional Bayesian Filter.">BMcond</a> { |
152 | | <a name="l00246"></a>00246 <span class="keyword">protected</span>: |
153 | | <a name="l00248"></a><a class="code" href="classBMcond.html#9ba793c8ec453f04d372d17195ed8dec">00248</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classBMcond.html#9ba793c8ec453f04d372d17195ed8dec" title="Identificator of the conditioning variable.">rvc</a>; |
154 | | <a name="l00249"></a>00249 <span class="keyword">public</span>: |
155 | | <a name="l00251"></a>00251 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBMcond.html#3543cfe274c35f9033c24d8036a96c4d" title="Substitute val for rvc.">condition</a> ( <span class="keyword">const</span> vec &val ) =0; |
156 | | <a name="l00253"></a><a class="code" href="classBMcond.html#9a38dcdabef902fd91da3c9fb6ac27f7">00253</a> <a class="code" href="classBMcond.html#9a38dcdabef902fd91da3c9fb6ac27f7" title="Default constructor.">BMcond</a>(<a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv0):<a class="code" href="classBMcond.html#9ba793c8ec453f04d372d17195ed8dec" title="Identificator of the conditioning variable.">rvc</a>(rv0){}; |
157 | | <a name="l00255"></a><a class="code" href="classBMcond.html#d40c72250cf93640f982d06de20815b2">00255</a> <span class="keyword">virtual</span> <a class="code" href="classBMcond.html#d40c72250cf93640f982d06de20815b2" title="Destructor for future use.">~BMcond</a>(){}; |
158 | | <a name="l00257"></a><a class="code" href="classBMcond.html#3fa60348b2da6b4208bb95b8d146900a">00257</a> <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>& <a class="code" href="classBMcond.html#3fa60348b2da6b4208bb95b8d146900a" title="access function">_rvc</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classBMcond.html#9ba793c8ec453f04d372d17195ed8dec" title="Identificator of the conditioning variable.">rvc</a>;} |
159 | | <a name="l00258"></a>00258 }; |
160 | | <a name="l00259"></a>00259 |
161 | | <a name="l00260"></a>00260 <span class="preprocessor">#endif // BM_H</span> |
162 | | </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Wed Mar 12 16:15:44 2008 for mixpp by |
| 131 | <a name="l00202"></a>00202 <span class="keywordtype">void</span> <a class="code" href="classDS.html#470ba89e8e7c3c4d830803221b4e9be6" title="Moves from $t$ to $t+1$, i.e. perfroms the actions and reads response of the system...">step</a>(); |
| 132 | <a name="l00203"></a>00203 |
| 133 | <a name="l00204"></a>00204 }; |
| 134 | <a name="l00205"></a>00205 |
| 135 | <a name="l00210"></a><a class="code" href="classBM.html">00210</a> <span class="keyword">class </span><a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> { |
| 136 | <a name="l00211"></a>00211 <span class="keyword">protected</span>: |
| 137 | <a name="l00213"></a><a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88">00213</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a>; |
| 138 | <a name="l00215"></a><a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979">00215</a> <span class="keywordtype">double</span> <a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a>; |
| 139 | <a name="l00217"></a><a class="code" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129">00217</a> <span class="keywordtype">bool</span> <a class="code" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a>; |
| 140 | <a name="l00218"></a>00218 <span class="keyword">public</span>: |
| 141 | <a name="l00219"></a>00219 |
| 142 | <a name="l00221"></a><a class="code" href="classBM.html#605d28b426adb677c86a57ddb525132a">00221</a> <a class="code" href="classBM.html#605d28b426adb677c86a57ddb525132a" title="Default constructor.">BM</a>(<span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv0) :<a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a>(rv0), <a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a> ( 0 ),<a class="code" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ( true ) {<span class="comment">//Fixme: test rv </span> |
| 143 | <a name="l00222"></a>00222 }; |
| 144 | <a name="l00223"></a>00223 |
| 145 | <a name="l00227"></a>00227 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBM.html#a892eff438aab2dd1a9e2efcb7fb5bdf" title="Incremental Bayes rule.">bayes</a> ( <span class="keyword">const</span> vec &dt ) = 0; |
| 146 | <a name="l00229"></a>00229 <span class="keywordtype">void</span> <a class="code" href="classBM.html#a892eff438aab2dd1a9e2efcb7fb5bdf" title="Incremental Bayes rule.">bayes</a> ( mat Dt ); |
| 147 | <a name="l00231"></a>00231 <span class="keyword">virtual</span> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>& <a class="code" href="classBM.html#3dc45554556926bde996a267636abe55" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_epdf</a>()=0; |
| 148 | <a name="l00232"></a>00232 |
| 149 | <a name="l00234"></a><a class="code" href="classBM.html#ca0f02b3b4144e0895cc14f7e0374bdd">00234</a> <span class="keyword">virtual</span> <a class="code" href="classBM.html#ca0f02b3b4144e0895cc14f7e0374bdd" title="Destructor for future use;.">~BM</a>() {}; |
| 150 | <a name="l00236"></a><a class="code" href="classBM.html#126bd2595c48e311fc2a7ab72876092a">00236</a> <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>& <a class="code" href="classBM.html#126bd2595c48e311fc2a7ab72876092a" title="access function">_rv</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a>;} |
| 151 | <a name="l00238"></a><a class="code" href="classBM.html#87f4a547d2c29180be88175e5eab9c88">00238</a> <span class="keywordtype">double</span> <a class="code" href="classBM.html#87f4a547d2c29180be88175e5eab9c88" title="access function">_ll</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a>;} |
| 152 | <a name="l00239"></a>00239 }; |
| 153 | <a name="l00240"></a>00240 |
| 154 | <a name="l00250"></a>00250 <span class="keyword">class </span><a class="code" href="classBMcond.html" title="Conditional Bayesian Filter.">BMcond</a> { |
| 155 | <a name="l00251"></a>00251 <span class="keyword">protected</span>: |
| 156 | <a name="l00253"></a>00253 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classBMcond.html#9ba793c8ec453f04d372d17195ed8dec" title="Identificator of the conditioning variable.">rvc</a>; |
| 157 | <a name="l00254"></a>00254 <span class="keyword">public</span>: |
| 158 | <a name="l00256"></a>00256 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBMcond.html#3543cfe274c35f9033c24d8036a96c4d" title="Substitute val for rvc.">condition</a> ( <span class="keyword">const</span> vec &val ) =0; |
| 159 | <a name="l00258"></a><a class="code" href="classBMcond.html#9a38dcdabef902fd91da3c9fb6ac27f7">00258</a> <a class="code" href="classBMcond.html#9a38dcdabef902fd91da3c9fb6ac27f7" title="Default constructor.">BMcond</a>(<a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv0):<a class="code" href="classBMcond.html#9ba793c8ec453f04d372d17195ed8dec" title="Identificator of the conditioning variable.">rvc</a>(rv0){}; |
| 160 | <a name="l00260"></a><a class="code" href="classBMcond.html#d40c72250cf93640f982d06de20815b2">00260</a> <span class="keyword">virtual</span> <a class="code" href="classBMcond.html#d40c72250cf93640f982d06de20815b2" title="Destructor for future use.">~BMcond</a>(){}; |
| 161 | <a name="l00262"></a><a class="code" href="classBMcond.html#3fa60348b2da6b4208bb95b8d146900a">00262</a> <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>& <a class="code" href="classBMcond.html#3fa60348b2da6b4208bb95b8d146900a" title="access function">_rvc</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classBMcond.html#9ba793c8ec453f04d372d17195ed8dec" title="Identificator of the conditioning variable.">rvc</a>;} |
| 162 | <a name="l00263"></a>00263 }; |
| 163 | <a name="l00264"></a>00264 |
| 164 | <a name="l00265"></a>00265 <span class="preprocessor">#endif // BM_H</span> |
| 165 | </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Apr 18 11:15:15 2008 for mixpp by |