26 | | <a name="l00024"></a>00024 <span class="keyword">using namespace </span>itpp; |
27 | | <a name="l00025"></a>00025 |
28 | | <a name="l00027"></a><a class="code" href="classstr.html">00027</a> <span class="keyword">class </span><a class="code" href="classstr.html" title="Structure of RV (used internally), i.e. expanded RVs.">str</a> { |
29 | | <a name="l00028"></a>00028 <span class="keyword">public</span>: |
30 | | <a name="l00030"></a><a class="code" href="classstr.html#8c4e7241505999c272eb15e586ba7923">00030</a> ivec <a class="code" href="classstr.html#8c4e7241505999c272eb15e586ba7923" title="vector id ids (non-unique!)">ids</a>; |
31 | | <a name="l00032"></a><a class="code" href="classstr.html#a55be419d33638dd0b2de3ecd64a4f27">00032</a> ivec <a class="code" href="classstr.html#a55be419d33638dd0b2de3ecd64a4f27" title="vector of times">times</a>; |
32 | | <a name="l00034"></a><a class="code" href="classstr.html#11ba7967bca045fe27fab8e70b6c0598">00034</a> <a class="code" href="classstr.html#11ba7967bca045fe27fab8e70b6c0598" title="Default constructor.">str</a> ( ivec ids0, ivec times0 ) :<a class="code" href="classstr.html#8c4e7241505999c272eb15e586ba7923" title="vector id ids (non-unique!)">ids</a> ( ids0 ),<a class="code" href="classstr.html#a55be419d33638dd0b2de3ecd64a4f27" title="vector of times">times</a> ( times0 ) { |
33 | | <a name="l00035"></a>00035 it_assert_debug ( times0.length() ==ids0.length(),<span class="stringliteral">"Incompatible input"</span> ); |
34 | | <a name="l00036"></a>00036 }; |
35 | | <a name="l00037"></a>00037 }; |
36 | | <a name="l00038"></a>00038 |
37 | | <a name="l00045"></a><a class="code" href="classRV.html">00045</a> <span class="keyword">class </span><a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> { |
38 | | <a name="l00046"></a>00046 <span class="keyword">protected</span>: |
39 | | <a name="l00048"></a><a class="code" href="classRV.html#f2396efe2e6d656ebe9e6f06018cbe25">00048</a> <span class="keywordtype">int</span> <a class="code" href="classRV.html#f2396efe2e6d656ebe9e6f06018cbe25" title="size = sum of sizes">tsize</a>; |
40 | | <a name="l00050"></a><a class="code" href="classRV.html#0d7b36e2bbccf880c8fcf1e8cc43c1a9">00050</a> <span class="keywordtype">int</span> <a class="code" href="classRV.html#0d7b36e2bbccf880c8fcf1e8cc43c1a9" title="len = number of individual rvs">len</a>; |
41 | | <a name="l00052"></a><a class="code" href="classRV.html#1bd7165140f4b880a7f344bbb1c433f9">00052</a> ivec <a class="code" href="classRV.html#1bd7165140f4b880a7f344bbb1c433f9" title="Vector of unique IDs.">ids</a>; |
42 | | <a name="l00054"></a><a class="code" href="classRV.html#c878aab13f34b420e1eb5b485563682b">00054</a> ivec <a class="code" href="classRV.html#c878aab13f34b420e1eb5b485563682b" title="Vector of sizes.">sizes</a>; |
43 | | <a name="l00056"></a><a class="code" href="classRV.html#646e530c47a2dd38254b778d9f11ac89">00056</a> ivec <a class="code" href="classRV.html#646e530c47a2dd38254b778d9f11ac89" title="Vector of shifts from current time.">times</a>; |
44 | | <a name="l00058"></a><a class="code" href="classRV.html#df5d0030b277a1db2f1fd5fb79152acb">00058</a> Array<std::string> <a class="code" href="classRV.html#df5d0030b277a1db2f1fd5fb79152acb" title="Array of names.">names</a>; |
45 | | <a name="l00059"></a>00059 |
46 | | <a name="l00060"></a>00060 <span class="keyword">private</span>: |
47 | | <a name="l00062"></a>00062 <span class="keywordtype">void</span> init ( ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times ); |
48 | | <a name="l00063"></a>00063 <span class="keyword">public</span>: |
49 | | <a name="l00065"></a>00065 <a class="code" href="classRV.html#6a22f5c06d6403870d4e414b1993bf9e" title="Constructor of empty RV.">RV</a> ( Array<std::string> in_names, ivec in_sizes, ivec in_times ); |
50 | | <a name="l00067"></a>00067 <a class="code" href="classRV.html#6a22f5c06d6403870d4e414b1993bf9e" title="Constructor of empty RV.">RV</a> ( Array<std::string> in_names, ivec in_sizes ); |
51 | | <a name="l00069"></a>00069 <a class="code" href="classRV.html#6a22f5c06d6403870d4e414b1993bf9e" title="Constructor of empty RV.">RV</a> ( Array<std::string> in_names ); |
52 | | <a name="l00071"></a>00071 <a class="code" href="classRV.html#6a22f5c06d6403870d4e414b1993bf9e" title="Constructor of empty RV.">RV</a> (); |
53 | | <a name="l00072"></a>00072 |
54 | | <a name="l00074"></a>00074 <span class="keyword">friend</span> std::ostream &<a class="code" href="classRV.html#cad6f15535d10437f6690cb4492176a8" title="Printing output e.g. for debugging.">operator<< </a>( std::ostream &os, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv ); |
55 | | <a name="l00075"></a>00075 |
56 | | <a name="l00077"></a><a class="code" href="classRV.html#f5c7b8bd589eef09ccdf3329a0addea0">00077</a> <span class="keywordtype">int</span> <a class="code" href="classRV.html#f5c7b8bd589eef09ccdf3329a0addea0" title="Return number of scalars in the RV.">count</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classRV.html#f2396efe2e6d656ebe9e6f06018cbe25" title="size = sum of sizes">tsize</a>;} ; |
57 | | <a name="l00079"></a><a class="code" href="classRV.html#c114a6f3ff06796cc2f4dacba74291eb">00079</a> <span class="keywordtype">int</span> <a class="code" href="classRV.html#c114a6f3ff06796cc2f4dacba74291eb" title="Return length (number of entries) of the RV.">length</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classRV.html#0d7b36e2bbccf880c8fcf1e8cc43c1a9" title="len = number of individual rvs">len</a>;} ; |
58 | | <a name="l00080"></a>00080 |
59 | | <a name="l00081"></a>00081 <span class="comment">//TODO why not inline and later??</span> |
60 | | <a name="l00082"></a>00082 |
61 | | <a name="l00084"></a>00084 ivec <a class="code" href="classRV.html#0c493a7a897f4d75682f4264e40779a1" title="Find indexes of self in another rv,.">findself</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv2 ) <span class="keyword">const</span>; |
62 | | <a name="l00086"></a>00086 <span class="keywordtype">bool</span> <a class="code" href="classRV.html#82cc7fa22ce91cf461a522ad62014c65" title="Compare if rv2 is identical to this RV.">equal</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv2 ) <span class="keyword">const</span>; |
63 | | <a name="l00088"></a>00088 <span class="keywordtype">bool</span> <span class="keyword">add</span> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv2 ); |
64 | | <a name="l00090"></a>00090 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classRV.html#b9d175c327c21488b1e2fb756a84e149" title="Subtract another variable from the current one.">subt</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv2 ) <span class="keyword">const</span>; |
65 | | <a name="l00092"></a>00092 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classRV.html#b26d25a122be3303806af7726a625a0f" title="Select only variables at indeces ind.">subselect</a> ( <span class="keyword">const</span> ivec &ind ) <span class="keyword">const</span>; |
66 | | <a name="l00094"></a>00094 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classRV.html#248dfb2387976db2658489347669278c" title="Select only variables at indeces ind.">operator() </a>( <span class="keyword">const</span> ivec &ind ) <span class="keyword">const</span>; |
67 | | <a name="l00096"></a>00096 <span class="keywordtype">void</span> <a class="code" href="classRV.html#e0a158d53ab9430627241f844f4c9a60" title="Shift time shifted by delta.">t</a> ( <span class="keywordtype">int</span> delta ); |
68 | | <a name="l00098"></a>00098 <a class="code" href="classstr.html" title="Structure of RV (used internally), i.e. expanded RVs.">str</a> <a class="code" href="classRV.html#52f3ade796814da627ff5a44d00986be" title="generate str from rv, by expanding sizes">tostr</a>() <span class="keyword">const</span>; |
69 | | <a name="l00101"></a>00101 ivec <a class="code" href="classRV.html#bb724fa4e2d9ed7bfd0993b5975018a4">dataind</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &crv ) <span class="keyword">const</span>; |
70 | | <a name="l00104"></a>00104 <span class="keywordtype">void</span> <a class="code" href="classRV.html#bb724fa4e2d9ed7bfd0993b5975018a4">dataind</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv2, ivec &selfi, ivec &rv2i ) <span class="keyword">const</span>; |
71 | | <a name="l00105"></a>00105 |
72 | | <a name="l00107"></a><a class="code" href="classRV.html#b88ef5124713c9e30fd9446846b3f044">00107</a> Array<std::string>& <a class="code" href="classRV.html#b88ef5124713c9e30fd9446846b3f044" title="access function">_names</a>() {<span class="keywordflow">return</span> <a class="code" href="classRV.html#df5d0030b277a1db2f1fd5fb79152acb" title="Array of names.">names</a>;}; |
73 | | <a name="l00108"></a>00108 |
74 | | <a name="l00110"></a><a class="code" href="classRV.html#4a0069bc69f5a98d7ce9ed59077f2e6c">00110</a> <span class="keywordtype">int</span> <a class="code" href="classRV.html#4a0069bc69f5a98d7ce9ed59077f2e6c" title="access function">id</a> ( <span class="keywordtype">int</span> at ) {<span class="keywordflow">return</span> <a class="code" href="classRV.html#1bd7165140f4b880a7f344bbb1c433f9" title="Vector of unique IDs.">ids</a> ( at );}; |
75 | | <a name="l00112"></a><a class="code" href="classRV.html#20db23a5585d64a6e24404cc8379bc28">00112</a> <span class="keywordtype">int</span> <a class="code" href="classRV.html#20db23a5585d64a6e24404cc8379bc28" title="access function">size</a> ( <span class="keywordtype">int</span> at ) {<span class="keywordflow">return</span> <a class="code" href="classRV.html#c878aab13f34b420e1eb5b485563682b" title="Vector of sizes.">sizes</a> ( at );}; |
76 | | <a name="l00114"></a><a class="code" href="classRV.html#af068cf478864fe1a4fbfc6b4693b088">00114</a> <span class="keywordtype">int</span> <a class="code" href="classRV.html#af068cf478864fe1a4fbfc6b4693b088" title="access function">time</a> ( <span class="keywordtype">int</span> at ) {<span class="keywordflow">return</span> <a class="code" href="classRV.html#646e530c47a2dd38254b778d9f11ac89" title="Vector of shifts from current time.">times</a> ( at );}; |
77 | | <a name="l00116"></a><a class="code" href="classRV.html#3ae4dd6e368f814a02710636ac8e1721">00116</a> std::string <a class="code" href="classRV.html#3ae4dd6e368f814a02710636ac8e1721" title="access function">name</a> ( <span class="keywordtype">int</span> at ) {<span class="keywordflow">return</span> <a class="code" href="classRV.html#df5d0030b277a1db2f1fd5fb79152acb" title="Array of names.">names</a> ( at );}; |
78 | | <a name="l00117"></a>00117 |
79 | | <a name="l00119"></a><a class="code" href="classRV.html#f58db96c9f5b8a538e26f154b1047c62">00119</a> <span class="keywordtype">void</span> <a class="code" href="classRV.html#f58db96c9f5b8a538e26f154b1047c62" title="access function">set_id</a> ( <span class="keywordtype">int</span> at, <span class="keywordtype">int</span> id0 ) {<a class="code" href="classRV.html#1bd7165140f4b880a7f344bbb1c433f9" title="Vector of unique IDs.">ids</a> ( at ) =id0;}; |
80 | | <a name="l00121"></a><a class="code" href="classRV.html#70b24c39c5130b1e4753fa2eef495433">00121</a> <span class="keywordtype">void</span> <a class="code" href="classRV.html#70b24c39c5130b1e4753fa2eef495433" title="access function">set_size</a> ( <span class="keywordtype">int</span> at, <span class="keywordtype">int</span> size0 ) {<a class="code" href="classRV.html#c878aab13f34b420e1eb5b485563682b" title="Vector of sizes.">sizes</a> ( at ) =size0; <a class="code" href="classRV.html#f2396efe2e6d656ebe9e6f06018cbe25" title="size = sum of sizes">tsize</a>=sum ( <a class="code" href="classRV.html#c878aab13f34b420e1eb5b485563682b" title="Vector of sizes.">sizes</a> );}; |
81 | | <a name="l00123"></a><a class="code" href="classRV.html#af668289c016d12ac2a9ddb85416006b">00123</a> <span class="keywordtype">void</span> <a class="code" href="classRV.html#af668289c016d12ac2a9ddb85416006b" title="access function">set_time</a> ( <span class="keywordtype">int</span> at, <span class="keywordtype">int</span> time0 ) {<a class="code" href="classRV.html#646e530c47a2dd38254b778d9f11ac89" title="Vector of shifts from current time.">times</a> ( at ) =time0;}; |
82 | | <a name="l00124"></a>00124 |
83 | | <a name="l00126"></a>00126 <span class="keywordtype">void</span> <a class="code" href="classRV.html#fc4a3175ff678cba7ae4109654f66ce5" title="Assign unused ids to this rv.">newids</a>(); |
84 | | <a name="l00127"></a>00127 }; |
| 26 | <a name="l00024"></a>00024 <span class="keyword">namespace </span>bdm{ |
| 27 | <a name="l00025"></a>00025 <span class="keyword">using namespace </span>itpp; |
| 28 | <a name="l00026"></a>00026 |
| 29 | <a name="l00028"></a><a class="code" href="classbdm_1_1base.html">00028</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1base.html" title="Root class of BDM objects.">base</a>{}; |
| 30 | <a name="l00029"></a>00029 |
| 31 | <a name="l00031"></a><a class="code" href="classbdm_1_1str.html">00031</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1str.html" title="Structure of RV (used internally), i.e. expanded RVs.">str</a> { |
| 32 | <a name="l00032"></a>00032 <span class="keyword">public</span>: |
| 33 | <a name="l00034"></a><a class="code" href="classbdm_1_1str.html#64675a73fc7324177175f19b3baeb0b0">00034</a> ivec <a class="code" href="classbdm_1_1str.html#64675a73fc7324177175f19b3baeb0b0" title="vector id ids (non-unique!)">ids</a>; |
| 34 | <a name="l00036"></a><a class="code" href="classbdm_1_1str.html#905dc0f240e40432c103708c4a34f80a">00036</a> ivec <a class="code" href="classbdm_1_1str.html#905dc0f240e40432c103708c4a34f80a" title="vector of times">times</a>; |
| 35 | <a name="l00038"></a><a class="code" href="classbdm_1_1str.html#7c6b9dccc6814d7bd1e8e2208a0d3f3f">00038</a> <a class="code" href="classbdm_1_1str.html#7c6b9dccc6814d7bd1e8e2208a0d3f3f" title="Default constructor.">str</a> ( ivec ids0, ivec times0 ) :<a class="code" href="classbdm_1_1str.html#64675a73fc7324177175f19b3baeb0b0" title="vector id ids (non-unique!)">ids</a> ( ids0 ),<a class="code" href="classbdm_1_1str.html#905dc0f240e40432c103708c4a34f80a" title="vector of times">times</a> ( times0 ) { |
| 36 | <a name="l00039"></a>00039 it_assert_debug ( times0.length() ==ids0.length(),<span class="stringliteral">"Incompatible input"</span> ); |
| 37 | <a name="l00040"></a>00040 }; |
| 38 | <a name="l00041"></a>00041 }; |
| 39 | <a name="l00042"></a>00042 |
| 40 | <a name="l00049"></a><a class="code" href="classbdm_1_1RV.html">00049</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> :<a class="code" href="classbdm_1_1base.html" title="Root class of BDM objects.">base</a>{ |
| 41 | <a name="l00050"></a>00050 <span class="keyword">protected</span>: |
| 42 | <a name="l00052"></a><a class="code" href="classbdm_1_1RV.html#38203096d950671def44de8cf1c6bb2e">00052</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1RV.html#38203096d950671def44de8cf1c6bb2e" title="size = sum of sizes">tsize</a>; |
| 43 | <a name="l00054"></a><a class="code" href="classbdm_1_1RV.html#b11bfdceb831ed30d33b852dd4a6b385">00054</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1RV.html#b11bfdceb831ed30d33b852dd4a6b385" title="len = number of individual rvs">len</a>; |
| 44 | <a name="l00056"></a><a class="code" href="classbdm_1_1RV.html#0a9a4769ab5a322495bea0cd8091500b">00056</a> ivec <a class="code" href="classbdm_1_1RV.html#0a9a4769ab5a322495bea0cd8091500b" title="Vector of unique IDs.">ids</a>; |
| 45 | <a name="l00058"></a><a class="code" href="classbdm_1_1RV.html#0112d25045f6f8fabdc9e821029928ee">00058</a> ivec <a class="code" href="classbdm_1_1RV.html#0112d25045f6f8fabdc9e821029928ee" title="Vector of sizes.">sizes</a>; |
| 46 | <a name="l00060"></a><a class="code" href="classbdm_1_1RV.html#ef6703854820bbf61736738f1bac6896">00060</a> ivec <a class="code" href="classbdm_1_1RV.html#ef6703854820bbf61736738f1bac6896" title="Vector of shifts from current time.">times</a>; |
| 47 | <a name="l00062"></a><a class="code" href="classbdm_1_1RV.html#9a87c46918c3c0db0bdca854a48a44aa">00062</a> Array<std::string> <a class="code" href="classbdm_1_1RV.html#9a87c46918c3c0db0bdca854a48a44aa" title="Array of names.">names</a>; |
| 48 | <a name="l00063"></a>00063 |
| 49 | <a name="l00064"></a>00064 <span class="keyword">private</span>: |
| 50 | <a name="l00066"></a>00066 <span class="keywordtype">void</span> init ( ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times ); |
| 51 | <a name="l00067"></a>00067 <span class="keyword">public</span>: |
| 52 | <a name="l00069"></a>00069 <a class="code" href="classbdm_1_1RV.html#e319ca900261a5005a9b4b353ec16412" title="Constructor of empty RV.">RV</a> ( Array<std::string> in_names, ivec in_sizes, ivec in_times ); |
| 53 | <a name="l00071"></a>00071 <a class="code" href="classbdm_1_1RV.html#e319ca900261a5005a9b4b353ec16412" title="Constructor of empty RV.">RV</a> ( Array<std::string> in_names, ivec in_sizes ); |
| 54 | <a name="l00073"></a>00073 <a class="code" href="classbdm_1_1RV.html#e319ca900261a5005a9b4b353ec16412" title="Constructor of empty RV.">RV</a> ( Array<std::string> in_names ); |
| 55 | <a name="l00075"></a>00075 <a class="code" href="classbdm_1_1RV.html#e319ca900261a5005a9b4b353ec16412" title="Constructor of empty RV.">RV</a> (); |
| 56 | <a name="l00076"></a>00076 |
| 57 | <a name="l00078"></a>00078 <span class="keyword">friend</span> std::ostream &<a class="code" href="classbdm_1_1RV.html#cad6f15535d10437f6690cb4492176a8" title="Printing output e.g. for debugging.">operator<< </a>( std::ostream &os, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv ); |
| 58 | <a name="l00079"></a>00079 |
| 59 | <a name="l00081"></a><a class="code" href="classbdm_1_1RV.html#2174751a00ce19f941edd2c1a861be67">00081</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1RV.html#2174751a00ce19f941edd2c1a861be67" title="Return number of scalars in the RV.">count</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1RV.html#38203096d950671def44de8cf1c6bb2e" title="size = sum of sizes">tsize</a>;} ; |
| 60 | <a name="l00083"></a><a class="code" href="classbdm_1_1RV.html#e9ec8c3e756651ff352ab5e3d3acda4b">00083</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1RV.html#e9ec8c3e756651ff352ab5e3d3acda4b" title="Return length (number of entries) of the RV.">length</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1RV.html#b11bfdceb831ed30d33b852dd4a6b385" title="len = number of individual rvs">len</a>;} ; |
| 61 | <a name="l00084"></a>00084 |
| 62 | <a name="l00085"></a>00085 <span class="comment">//TODO why not inline and later??</span> |
| 63 | <a name="l00086"></a>00086 |
| 64 | <a name="l00088"></a>00088 ivec <a class="code" href="classbdm_1_1RV.html#1367055b2608ad9d50d01a2da6cec869" title="Find indexes of self in another rv,.">findself</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv2 ) <span class="keyword">const</span>; |
| 65 | <a name="l00090"></a>00090 <span class="keywordtype">bool</span> <a class="code" href="classbdm_1_1RV.html#3bb011af88ae98f5c97955bb2c95cfee" title="Compare if rv2 is identical to this RV.">equal</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv2 ) <span class="keyword">const</span>; |
| 66 | <a name="l00092"></a>00092 <span class="keywordtype">bool</span> <span class="keyword">add</span> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv2 ); |
| 67 | <a name="l00094"></a>00094 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1RV.html#aec44dabdf0a6d90fbae95e1356eda39" title="Subtract another variable from the current one.">subt</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv2 ) <span class="keyword">const</span>; |
| 68 | <a name="l00096"></a>00096 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1RV.html#c0c04ab99ded62e1e05bcefb151ebeb9" title="Select only variables at indeces ind.">subselect</a> ( <span class="keyword">const</span> ivec &ind ) <span class="keyword">const</span>; |
| 69 | <a name="l00098"></a>00098 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1RV.html#6f3daf0f857fff53a1c0a445fe160966" title="Select only variables at indeces ind.">operator() </a>( <span class="keyword">const</span> ivec &ind ) <span class="keyword">const</span>; |
| 70 | <a name="l00100"></a>00100 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1RV.html#bd77cb0899f7fba1d0e34396137b7f1f" title="Shift time shifted by delta.">t</a> ( <span class="keywordtype">int</span> delta ); |
| 71 | <a name="l00102"></a>00102 <a class="code" href="classbdm_1_1str.html" title="Structure of RV (used internally), i.e. expanded RVs.">str</a> <a class="code" href="classbdm_1_1RV.html#8bdd7f4072749c7cc864b78a418ca388" title="generate str from rv, by expanding sizes">tostr</a>() <span class="keyword">const</span>; |
| 72 | <a name="l00105"></a>00105 ivec <a class="code" href="classbdm_1_1RV.html#cbebdb5e0d30101a6eb63550ef701c55">dataind</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &crv ) <span class="keyword">const</span>; |
| 73 | <a name="l00108"></a>00108 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1RV.html#cbebdb5e0d30101a6eb63550ef701c55">dataind</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv2, ivec &selfi, ivec &rv2i ) <span class="keyword">const</span>; |
| 74 | <a name="l00109"></a>00109 |
| 75 | <a name="l00111"></a><a class="code" href="classbdm_1_1RV.html#ae0c6e729851a43c82a5b1c199474ef2">00111</a> Array<std::string>& <a class="code" href="classbdm_1_1RV.html#ae0c6e729851a43c82a5b1c199474ef2" title="access function">_names</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1RV.html#9a87c46918c3c0db0bdca854a48a44aa" title="Array of names.">names</a>;}; |
| 76 | <a name="l00112"></a>00112 |
| 77 | <a name="l00114"></a><a class="code" href="classbdm_1_1RV.html#172390b8525ef5aac684228241fff7b5">00114</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1RV.html#172390b8525ef5aac684228241fff7b5" title="access function">id</a> ( <span class="keywordtype">int</span> at ) {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1RV.html#0a9a4769ab5a322495bea0cd8091500b" title="Vector of unique IDs.">ids</a> ( at );}; |
| 78 | <a name="l00116"></a><a class="code" href="classbdm_1_1RV.html#8e64d02005a02aef72f214286977d8de">00116</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1RV.html#8e64d02005a02aef72f214286977d8de" title="access function">size</a> ( <span class="keywordtype">int</span> at ) {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1RV.html#0112d25045f6f8fabdc9e821029928ee" title="Vector of sizes.">sizes</a> ( at );}; |
| 79 | <a name="l00118"></a><a class="code" href="classbdm_1_1RV.html#aff4de8185750b506492623847520518">00118</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1RV.html#aff4de8185750b506492623847520518" title="access function">time</a> ( <span class="keywordtype">int</span> at ) {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1RV.html#ef6703854820bbf61736738f1bac6896" title="Vector of shifts from current time.">times</a> ( at );}; |
| 80 | <a name="l00120"></a><a class="code" href="classbdm_1_1RV.html#d05af87595cfb7fa2e0fadeae5597fa8">00120</a> std::string <a class="code" href="classbdm_1_1RV.html#d05af87595cfb7fa2e0fadeae5597fa8" title="access function">name</a> ( <span class="keywordtype">int</span> at ) {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1RV.html#9a87c46918c3c0db0bdca854a48a44aa" title="Array of names.">names</a> ( at );}; |
| 81 | <a name="l00121"></a>00121 |
| 82 | <a name="l00123"></a><a class="code" href="classbdm_1_1RV.html#602cea0aecebc5146d81657df5127543">00123</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1RV.html#602cea0aecebc5146d81657df5127543" title="access function">set_id</a> ( <span class="keywordtype">int</span> at, <span class="keywordtype">int</span> id0 ) {<a class="code" href="classbdm_1_1RV.html#0a9a4769ab5a322495bea0cd8091500b" title="Vector of unique IDs.">ids</a> ( at ) =id0;}; |
| 83 | <a name="l00125"></a><a class="code" href="classbdm_1_1RV.html#0b2c9e73ff66847c3644ebc3eb559a03">00125</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1RV.html#0b2c9e73ff66847c3644ebc3eb559a03" title="access function">set_size</a> ( <span class="keywordtype">int</span> at, <span class="keywordtype">int</span> size0 ) {<a class="code" href="classbdm_1_1RV.html#0112d25045f6f8fabdc9e821029928ee" title="Vector of sizes.">sizes</a> ( at ) =size0; <a class="code" href="classbdm_1_1RV.html#38203096d950671def44de8cf1c6bb2e" title="size = sum of sizes">tsize</a>=sum ( <a class="code" href="classbdm_1_1RV.html#0112d25045f6f8fabdc9e821029928ee" title="Vector of sizes.">sizes</a> );}; |
| 84 | <a name="l00127"></a><a class="code" href="classbdm_1_1RV.html#fb2892d12dc978549e9491aed327dfd4">00127</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1RV.html#fb2892d12dc978549e9491aed327dfd4" title="access function">set_time</a> ( <span class="keywordtype">int</span> at, <span class="keywordtype">int</span> time0 ) {<a class="code" href="classbdm_1_1RV.html#ef6703854820bbf61736738f1bac6896" title="Vector of shifts from current time.">times</a> ( at ) =time0;}; |
110 | | <a name="l00163"></a><a class="code" href="classepdf.html">00163</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> { |
111 | | <a name="l00164"></a>00164 <span class="keyword">protected</span>: |
112 | | <a name="l00166"></a><a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">00166</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>; |
113 | | <a name="l00167"></a>00167 <span class="keyword">public</span>: |
114 | | <a name="l00169"></a><a class="code" href="classepdf.html#d8eb760037b3bad5a0d64081606697cd">00169</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> ( ) {}; |
115 | | <a name="l00170"></a>00170 |
116 | | <a name="l00172"></a><a class="code" href="classepdf.html#c95b1a27a8dd9507bb9a5a3cb2809c7a">00172</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 ) {}; |
117 | | <a name="l00173"></a>00173 |
118 | | <a name="l00174"></a>00174 <span class="comment">// //! Returns the required moment of the epdf</span> |
119 | | <a name="l00175"></a>00175 <span class="comment">// virtual vec moment ( const int order = 1 );</span> |
120 | | <a name="l00176"></a>00176 |
121 | | <a name="l00178"></a>00178 <span class="keyword">virtual</span> vec <a class="code" href="classepdf.html#8019654e494bf5e458f6fb947e11b262" title="Returns a sample, from density .">sample</a> () <span class="keyword">const</span> =0; |
122 | | <a name="l00180"></a>00180 <span class="keyword">virtual</span> mat <a class="code" href="classepdf.html#76608914c3b19e150292d5c56e93e508" title="Returns N samples from density .">sample_m</a> ( <span class="keywordtype">int</span> N ) <span class="keyword">const</span>; |
123 | | <a name="l00181"></a>00181 |
124 | | <a name="l00183"></a>00183 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classepdf.html#e1996af1da1fa1214270066a96ca113e" title="Compute log-probability of argument val.">evallog</a> ( <span class="keyword">const</span> vec &val ) <span class="keyword">const</span> =0; |
125 | | <a name="l00184"></a>00184 |
126 | | <a name="l00186"></a><a class="code" href="classepdf.html#2495a04bbacb9b55fe5a3a59b78affca">00186</a> <span class="keyword">virtual</span> vec <a class="code" href="classepdf.html#2495a04bbacb9b55fe5a3a59b78affca" title="Compute log-probability of multiple values argument val.">evallog_m</a> ( <span class="keyword">const</span> mat &Val )<span class="keyword"> const </span>{ |
127 | | <a name="l00187"></a>00187 vec x ( Val.cols() ); |
128 | | <a name="l00188"></a>00188 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<Val.cols();i++ ) {x ( i ) =<a class="code" href="classepdf.html#e1996af1da1fa1214270066a96ca113e" title="Compute log-probability of argument val.">evallog</a> ( Val.get_col ( i ) ) ;} |
129 | | <a name="l00189"></a>00189 <span class="keywordflow">return</span> x; |
130 | | <a name="l00190"></a>00190 } |
131 | | <a name="l00192"></a><a class="code" href="classepdf.html#e87dc8260a5c37bc1b03eb66174741a0">00192</a> <span class="keyword">virtual</span> <a class="code" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a>* <a class="code" href="classepdf.html#e87dc8260a5c37bc1b03eb66174741a0" title="Return conditional density on the given RV, the remaining rvs will be in conditioning...">condition</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="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a> )<span class="keyword"> const </span>{it_warning ( <span class="stringliteral">"Not implemented"</span> ); <span class="keywordflow">return</span> NULL;} |
132 | | <a name="l00194"></a><a class="code" href="classepdf.html#38de9f59b65ee06028554f3f74b66025">00194</a> <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="classepdf.html#38de9f59b65ee06028554f3f74b66025" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">marginal</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="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a> )<span class="keyword"> const </span>{it_warning ( <span class="stringliteral">"Not implemented"</span> ); <span class="keywordflow">return</span> NULL;} |
133 | | <a name="l00195"></a>00195 |
134 | | <a name="l00197"></a>00197 <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; |
135 | | <a name="l00198"></a>00198 |
136 | | <a name="l00200"></a>00200 <span class="keyword">virtual</span> vec <a class="code" href="classepdf.html#29f17cea338692f4cb6d4ac9f7d89e1f" title="return expected variance (not covariance!)">variance</a>() <span class="keyword">const</span> = 0; |
137 | | <a name="l00201"></a>00201 |
138 | | <a name="l00203"></a><a class="code" href="classepdf.html#0a322dd106f04c0a2915e3d4f4227396">00203</a> <span class="keyword">virtual</span> <a class="code" href="classepdf.html#0a322dd106f04c0a2915e3d4f4227396" title="Destructor for future use;.">~epdf</a>() {}; |
139 | | <a name="l00205"></a><a class="code" href="classepdf.html#ca0d32aabb4cbba347e0c37fe8607562">00205</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="classepdf.html#ca0d32aabb4cbba347e0c37fe8607562" title="access function, possibly dangerous!">_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>;} |
140 | | <a name="l00207"></a><a class="code" href="classepdf.html#7fb94ce90d1ac7077d29f7d6a6c3e0a5">00207</a> <span class="keywordtype">void</span> <a class="code" href="classepdf.html#7fb94ce90d1ac7077d29f7d6a6c3e0a5" title="modifier function - useful when copying epdfs">_renewrv</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &in_rv ) {<a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a>=in_rv;} |
141 | | <a name="l00209"></a>00209 }; |
142 | | <a name="l00210"></a>00210 |
143 | | <a name="l00211"></a>00211 |
144 | | <a name="l00213"></a>00213 <span class="comment">//TODO Samplecond can be generalized</span> |
| 110 | <a name="l00163"></a>00163 <span class="keyword">class </span>mpdf; |
| 111 | <a name="l00164"></a>00164 |
| 112 | <a name="l00166"></a>00166 |
| 113 | <a name="l00167"></a><a class="code" href="classbdm_1_1epdf.html">00167</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> :<a class="code" href="classbdm_1_1base.html" title="Root class of BDM objects.">base</a> { |
| 114 | <a name="l00168"></a>00168 <span class="keyword">protected</span>: |
| 115 | <a name="l00170"></a><a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8">00170</a> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a>; |
| 116 | <a name="l00171"></a>00171 <span class="keyword">public</span>: |
| 117 | <a name="l00173"></a><a class="code" href="classbdm_1_1epdf.html#992f3de956fb3439c62225156aafb6f6">00173</a> <a class="code" href="classbdm_1_1epdf.html#992f3de956fb3439c62225156aafb6f6" title="default constructor">epdf</a>() :<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a> ( ) {}; |
| 118 | <a name="l00174"></a>00174 |
| 119 | <a name="l00176"></a><a class="code" href="classbdm_1_1epdf.html#fdfed7aa18f2870951888b1dde977415">00176</a> <a class="code" href="classbdm_1_1epdf.html#992f3de956fb3439c62225156aafb6f6" title="default constructor">epdf</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv0 ) :<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a> ( rv0 ) {}; |
| 120 | <a name="l00177"></a>00177 |
| 121 | <a name="l00178"></a>00178 <span class="comment">// //! Returns the required moment of the epdf</span> |
| 122 | <a name="l00179"></a>00179 <span class="comment">// virtual vec moment ( const int order = 1 );</span> |
| 123 | <a name="l00180"></a>00180 |
| 124 | <a name="l00182"></a>00182 <span class="keyword">virtual</span> vec <a class="code" href="classbdm_1_1epdf.html#09721eb148bc49d6ec2f1956039f3a10" title="Returns a sample, from density .">sample</a> () <span class="keyword">const</span> =0; |
| 125 | <a name="l00184"></a>00184 <span class="keyword">virtual</span> mat <a class="code" href="classbdm_1_1epdf.html#b4cf45fd83cc7573ede9fe1215256058" title="Returns N samples from density .">sample_m</a> ( <span class="keywordtype">int</span> N ) <span class="keyword">const</span>; |
| 126 | <a name="l00185"></a>00185 |
| 127 | <a name="l00187"></a>00187 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1epdf.html#a8e39e2ff5e5cf5471bc159530d3b2d3" title="Compute log-probability of argument val.">evallog</a> ( <span class="keyword">const</span> vec &val ) <span class="keyword">const</span> =0; |
| 128 | <a name="l00188"></a>00188 |
| 129 | <a name="l00190"></a><a class="code" href="classbdm_1_1epdf.html#34956d4dd3176eeb5937cf48a1546b62">00190</a> <span class="keyword">virtual</span> vec <a class="code" href="classbdm_1_1epdf.html#34956d4dd3176eeb5937cf48a1546b62" title="Compute log-probability of multiple values argument val.">evallog_m</a> ( <span class="keyword">const</span> mat &Val )<span class="keyword"> const </span>{ |
| 130 | <a name="l00191"></a>00191 vec x ( Val.cols() ); |
| 131 | <a name="l00192"></a>00192 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<Val.cols();i++ ) {x ( i ) =<a class="code" href="classbdm_1_1epdf.html#a8e39e2ff5e5cf5471bc159530d3b2d3" title="Compute log-probability of argument val.">evallog</a> ( Val.get_col ( i ) ) ;} |
| 132 | <a name="l00193"></a>00193 <span class="keywordflow">return</span> x; |
| 133 | <a name="l00194"></a>00194 } |
| 134 | <a name="l00196"></a><a class="code" href="classbdm_1_1epdf.html#e584eac5579c1b6384947ecf66166c77">00196</a> <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a>* <a class="code" href="classbdm_1_1epdf.html#e584eac5579c1b6384947ecf66166c77" title="Return conditional density on the given RV, the remaining rvs will be in conditioning...">condition</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a> )<span class="keyword"> const </span>{it_warning ( <span class="stringliteral">"Not implemented"</span> ); <span class="keywordflow">return</span> NULL;} |
| 135 | <a name="l00198"></a><a class="code" href="classbdm_1_1epdf.html#3fb2ece54f720b62ad325e61214fa0a1">00198</a> <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* <a class="code" href="classbdm_1_1epdf.html#3fb2ece54f720b62ad325e61214fa0a1" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">marginal</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a> )<span class="keyword"> const </span>{it_warning ( <span class="stringliteral">"Not implemented"</span> ); <span class="keywordflow">return</span> NULL;} |
| 136 | <a name="l00199"></a>00199 |
| 137 | <a name="l00201"></a>00201 <span class="keyword">virtual</span> vec <a class="code" href="classbdm_1_1epdf.html#565300f603ca00c989e16389d9eb42f5" title="return expected value">mean</a>() <span class="keyword">const</span> =0; |
| 138 | <a name="l00202"></a>00202 |
| 139 | <a name="l00204"></a>00204 <span class="keyword">virtual</span> vec <a class="code" href="classbdm_1_1epdf.html#45c2b64faa4bf526799e4154a6ec6097" title="return expected variance (not covariance!)">variance</a>() <span class="keyword">const</span> = 0; |
| 140 | <a name="l00205"></a>00205 |
| 141 | <a name="l00207"></a><a class="code" href="classbdm_1_1epdf.html#a4fa8637e7307cb051c400c2ce0ca0c8">00207</a> <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1epdf.html#a4fa8637e7307cb051c400c2ce0ca0c8" title="Destructor for future use;.">~epdf</a>() {}; |
| 142 | <a name="l00209"></a><a class="code" href="classbdm_1_1epdf.html#a4ab378d5e004c3ff3e2d4e64f7bba21">00209</a> <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>& <a class="code" href="classbdm_1_1epdf.html#a4ab378d5e004c3ff3e2d4e64f7bba21" title="access function, possibly dangerous!">_rv</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a>;} |
| 143 | <a name="l00211"></a><a class="code" href="classbdm_1_1epdf.html#62e88cbce0ce77a8692f5e15d76e805f">00211</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1epdf.html#62e88cbce0ce77a8692f5e15d76e805f" title="modifier function - useful when copying epdfs">_renewrv</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &in_rv ) {<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a>=in_rv;} |
| 144 | <a name="l00213"></a>00213 }; |
169 | | <a name="l00246"></a><a class="code" href="classmpdf.html#95fcff214848f66f1b489459370573fa">00246</a> <span class="keyword">virtual</span> vec <a class="code" href="classmpdf.html#95fcff214848f66f1b489459370573fa" title="Matrix version of evallogcond.">evallogcond_m</a> ( <span class="keyword">const</span> mat &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#2495a04bbacb9b55fe5a3a59b78affca" title="Compute log-probability of multiple values argument val.">evallog_m</a> ( Dt );}; |
170 | | <a name="l00247"></a>00247 |
171 | | <a name="l00249"></a><a class="code" href="classmpdf.html#6788be9f3a888796499c5293a318fcfb">00249</a> <span class="keyword">virtual</span> <a class="code" href="classmpdf.html#6788be9f3a888796499c5293a318fcfb" title="Destructor for future use;.">~mpdf</a>() {}; |
172 | | <a name="l00250"></a>00250 |
173 | | <a name="l00252"></a><a class="code" href="classmpdf.html#581ecf362185d37c08bb31cb9d046d6f">00252</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 ) {}; |
174 | | <a name="l00254"></a><a class="code" href="classmpdf.html#15ef062183b1ccdf794732d5fa0b77cd">00254</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classmpdf.html#15ef062183b1ccdf794732d5fa0b77cd" title="access function">_rvc</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab" title="random variable in condition">rvc</a>;} |
175 | | <a name="l00256"></a><a class="code" href="classmpdf.html#71256ffb5fbd08f41d650e606a5bd585">00256</a> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classmpdf.html#71256ffb5fbd08f41d650e606a5bd585" title="access function">_rv</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb" title="modeled random variable">rv</a>;} |
176 | | <a name="l00258"></a><a class="code" href="classmpdf.html#e17780ee5b2cfe05922a6c56af1462f8">00258</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>;} |
177 | | <a name="l00260"></a><a class="code" href="classmpdf.html#75ded3b0f657cd7da6590691a810963c">00260</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#75ded3b0f657cd7da6590691a810963c" title="access function">_e</a>() {<span class="keywordflow">return</span> <a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>;} |
178 | | <a name="l00261"></a>00261 }; |
179 | | <a name="l00262"></a>00262 |
180 | | <a name="l00265"></a><a class="code" href="classdatalink__e2e.html">00265</a> <span class="keyword">class </span><a class="code" href="classdatalink__e2e.html">datalink_e2e</a> { |
181 | | <a name="l00266"></a>00266 <span class="keyword">protected</span>: |
182 | | <a name="l00268"></a><a class="code" href="classdatalink__e2e.html#3ce1d13efa0b133a4d202c11bd57d216">00268</a> <span class="keywordtype">int</span> <a class="code" href="classdatalink__e2e.html#3ce1d13efa0b133a4d202c11bd57d216" title="Remember how long val should be.">valsize</a>; |
183 | | <a name="l00270"></a><a class="code" href="classdatalink__e2e.html#db962bc6201d1ec12dce00d7c1a8b4f8">00270</a> <span class="keywordtype">int</span> <a class="code" href="classdatalink__e2e.html#db962bc6201d1ec12dce00d7c1a8b4f8" title="Remember how long val of &quot;Up&quot; should be.">valupsize</a>; |
184 | | <a name="l00272"></a><a class="code" href="classdatalink__e2e.html#d4c3a76395b46d9d901eb232aacdafae">00272</a> ivec <a class="code" href="classdatalink__e2e.html#d4c3a76395b46d9d901eb232aacdafae" title="val-to-val link, indeces of the upper val">v2v_up</a>; |
185 | | <a name="l00273"></a>00273 <span class="keyword">public</span>: |
186 | | <a name="l00275"></a><a class="code" href="classdatalink__e2e.html#366d0aca52e56d4108f85390f87c1b9f">00275</a> <a class="code" href="classdatalink__e2e.html#366d0aca52e56d4108f85390f87c1b9f" title="Constructor.">datalink_e2e</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv_up ) : |
187 | | <a name="l00276"></a>00276 <a class="code" href="classdatalink__e2e.html#3ce1d13efa0b133a4d202c11bd57d216" title="Remember how long val should be.">valsize</a> ( rv.count() ), <a class="code" href="classdatalink__e2e.html#db962bc6201d1ec12dce00d7c1a8b4f8" title="Remember how long val of &quot;Up&quot; should be.">valupsize</a> ( rv_up.count() ), <a class="code" href="classdatalink__e2e.html#d4c3a76395b46d9d901eb232aacdafae" title="val-to-val link, indeces of the upper val">v2v_up</a> ( rv.dataind ( rv_up ) ) { |
188 | | <a name="l00277"></a>00277 it_assert_debug ( <a class="code" href="classdatalink__e2e.html#d4c3a76395b46d9d901eb232aacdafae" title="val-to-val link, indeces of the upper val">v2v_up</a>.length() ==<a class="code" href="classdatalink__e2e.html#3ce1d13efa0b133a4d202c11bd57d216" title="Remember how long val should be.">valsize</a>,<span class="stringliteral">"rv is not fully in rv_up"</span> ); |
189 | | <a name="l00278"></a>00278 } |
190 | | <a name="l00280"></a><a class="code" href="classdatalink__e2e.html#1b114a76be7aa45bf33697e521fd041d">00280</a> vec <a class="code" href="classdatalink__e2e.html#1b114a76be7aa45bf33697e521fd041d" title="Get val for myself from val of &quot;Up&quot;.">get_val</a> ( <span class="keyword">const</span> vec &val_up ) {it_assert_debug ( <a class="code" href="classdatalink__e2e.html#db962bc6201d1ec12dce00d7c1a8b4f8" title="Remember how long val of &quot;Up&quot; should be.">valupsize</a>==val_up.length(),<span class="stringliteral">"Wrong val_up"</span> ); <span class="keywordflow">return</span> get_vec ( val_up,<a class="code" href="classdatalink__e2e.html#d4c3a76395b46d9d901eb232aacdafae" title="val-to-val link, indeces of the upper val">v2v_up</a> );} |
191 | | <a name="l00282"></a><a class="code" href="classdatalink__e2e.html#1ee38edb1778e8900a8d7535c3b3f053">00282</a> <span class="keywordtype">void</span> <a class="code" href="classdatalink__e2e.html#1ee38edb1778e8900a8d7535c3b3f053" title="Fill val of &quot;Up&quot; by my pieces.">fill_val</a> ( vec &val_up, <span class="keyword">const</span> vec &val ) { |
192 | | <a name="l00283"></a>00283 it_assert_debug ( <a class="code" href="classdatalink__e2e.html#3ce1d13efa0b133a4d202c11bd57d216" title="Remember how long val should be.">valsize</a>==val.length(),<span class="stringliteral">"Wrong val"</span> ); |
193 | | <a name="l00284"></a>00284 it_assert_debug ( <a class="code" href="classdatalink__e2e.html#db962bc6201d1ec12dce00d7c1a8b4f8" title="Remember how long val of &quot;Up&quot; should be.">valupsize</a>==val_up.length(),<span class="stringliteral">"Wrong val_up"</span> ); |
194 | | <a name="l00285"></a>00285 set_subvector ( val_up, <a class="code" href="classdatalink__e2e.html#d4c3a76395b46d9d901eb232aacdafae" title="val-to-val link, indeces of the upper val">v2v_up</a>, val ); |
195 | | <a name="l00286"></a>00286 } |
196 | | <a name="l00287"></a>00287 }; |
197 | | <a name="l00288"></a>00288 |
198 | | <a name="l00290"></a><a class="code" href="classdatalink__m2e.html">00290</a> <span class="keyword">class </span><a class="code" href="classdatalink__m2e.html" title="data link between">datalink_m2e</a>: <span class="keyword">public</span> <a class="code" href="classdatalink__e2e.html">datalink_e2e</a> { |
199 | | <a name="l00291"></a>00291 <span class="keyword">protected</span>: |
200 | | <a name="l00293"></a><a class="code" href="classdatalink__m2e.html#b3927998b71fce3ab030eba1c3c3cec3">00293</a> <span class="keywordtype">int</span> <a class="code" href="classdatalink__m2e.html#b3927998b71fce3ab030eba1c3c3cec3" title="Remember how long cond should be.">condsize</a>; |
201 | | <a name="l00295"></a><a class="code" href="classdatalink__m2e.html#6b46f983c46621b6bfe2b5da3d467d2a">00295</a> ivec <a class="code" href="classdatalink__m2e.html#6b46f983c46621b6bfe2b5da3d467d2a" title="upper_val-to-local_cond link, indeces of the upper val">v2c_up</a>; |
202 | | <a name="l00297"></a><a class="code" href="classdatalink__m2e.html#29604fb622b6a319d2d5d2709fe01f28">00297</a> ivec <a class="code" href="classdatalink__m2e.html#29604fb622b6a319d2d5d2709fe01f28" title="upper_val-to-local_cond link, ideces of the local cond">v2c_lo</a>; |
203 | | <a name="l00298"></a>00298 |
204 | | <a name="l00299"></a>00299 <span class="keyword">public</span>: |
205 | | <a name="l00301"></a><a class="code" href="classdatalink__m2e.html#ff8f6e8a974e22ced461b232fadbdce0">00301</a> <a class="code" href="classdatalink__m2e.html#ff8f6e8a974e22ced461b232fadbdce0" title="Constructor.">datalink_m2e</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rvc, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv_up ) : |
206 | | <a name="l00302"></a>00302 <a class="code" href="classdatalink__e2e.html">datalink_e2e</a> ( rv,rv_up ), <a class="code" href="classdatalink__m2e.html#b3927998b71fce3ab030eba1c3c3cec3" title="Remember how long cond should be.">condsize</a> ( rvc.count() ) { |
207 | | <a name="l00303"></a>00303 <span class="comment">//establish v2c connection</span> |
208 | | <a name="l00304"></a>00304 rvc.<a class="code" href="classRV.html#bb724fa4e2d9ed7bfd0993b5975018a4">dataind</a> ( rv_up, <a class="code" href="classdatalink__m2e.html#29604fb622b6a319d2d5d2709fe01f28" title="upper_val-to-local_cond link, ideces of the local cond">v2c_lo</a>, <a class="code" href="classdatalink__m2e.html#6b46f983c46621b6bfe2b5da3d467d2a" title="upper_val-to-local_cond link, indeces of the upper val">v2c_up</a> ); |
209 | | <a name="l00305"></a>00305 } |
210 | | <a name="l00307"></a><a class="code" href="classdatalink__m2e.html#6db351e5e2158791e97144d212844084">00307</a> vec <a class="code" href="classdatalink__m2e.html#6db351e5e2158791e97144d212844084" title="Construct condition.">get_cond</a> ( <span class="keyword">const</span> vec &val_up ) { |
211 | | <a name="l00308"></a>00308 vec tmp ( <a class="code" href="classdatalink__m2e.html#b3927998b71fce3ab030eba1c3c3cec3" title="Remember how long cond should be.">condsize</a> ); |
212 | | <a name="l00309"></a>00309 set_subvector ( tmp,<a class="code" href="classdatalink__m2e.html#29604fb622b6a319d2d5d2709fe01f28" title="upper_val-to-local_cond link, ideces of the local cond">v2c_lo</a>,val_up ( <a class="code" href="classdatalink__m2e.html#6b46f983c46621b6bfe2b5da3d467d2a" title="upper_val-to-local_cond link, indeces of the upper val">v2c_up</a> ) ); |
213 | | <a name="l00310"></a>00310 <span class="keywordflow">return</span> tmp; |
214 | | <a name="l00311"></a>00311 } |
215 | | <a name="l00312"></a>00312 <span class="keywordtype">void</span> fill_val_cond ( vec &val_up, <span class="keyword">const</span> vec &val, <span class="keyword">const</span> vec &cond ) { |
216 | | <a name="l00313"></a>00313 it_assert_debug ( <a class="code" href="classdatalink__e2e.html#3ce1d13efa0b133a4d202c11bd57d216" title="Remember how long val should be.">valsize</a>==val.length(),<span class="stringliteral">"Wrong val"</span> ); |
217 | | <a name="l00314"></a>00314 it_assert_debug ( <a class="code" href="classdatalink__e2e.html#db962bc6201d1ec12dce00d7c1a8b4f8" title="Remember how long val of &quot;Up&quot; should be.">valupsize</a>==val_up.length(),<span class="stringliteral">"Wrong val_up"</span> ); |
218 | | <a name="l00315"></a>00315 set_subvector ( val_up, <a class="code" href="classdatalink__e2e.html#d4c3a76395b46d9d901eb232aacdafae" title="val-to-val link, indeces of the upper val">v2v_up</a>, val ); |
219 | | <a name="l00316"></a>00316 set_subvector ( val_up, <a class="code" href="classdatalink__m2e.html#6b46f983c46621b6bfe2b5da3d467d2a" title="upper_val-to-local_cond link, indeces of the upper val">v2c_up</a>, cond ); |
220 | | <a name="l00317"></a>00317 } |
221 | | <a name="l00318"></a>00318 }; |
222 | | <a name="l00321"></a><a class="code" href="classdatalink__m2m.html">00321</a> <span class="keyword">class </span><a class="code" href="classdatalink__m2m.html">datalink_m2m</a>: <span class="keyword">public</span> <a class="code" href="classdatalink__m2e.html" title="data link between">datalink_m2e</a> { |
223 | | <a name="l00322"></a>00322 <span class="keyword">protected</span>: |
224 | | <a name="l00324"></a><a class="code" href="classdatalink__m2m.html#d1044bf4846f878290100429600273b2">00324</a> ivec <a class="code" href="classdatalink__m2m.html#d1044bf4846f878290100429600273b2" title="cond-to-cond link, indeces of the upper cond">c2c_up</a>; |
225 | | <a name="l00326"></a><a class="code" href="classdatalink__m2m.html#056193d459cd5e5fd323b5cbc6a55bad">00326</a> ivec <a class="code" href="classdatalink__m2m.html#056193d459cd5e5fd323b5cbc6a55bad" title="cond-to-cond link, indeces of the local cond">c2c_lo</a>; |
226 | | <a name="l00327"></a>00327 <span class="keyword">public</span>: |
227 | | <a name="l00329"></a><a class="code" href="classdatalink__m2m.html#bd64962e779b6dd89529046245a8a98d">00329</a> <a class="code" href="classdatalink__m2m.html#bd64962e779b6dd89529046245a8a98d" title="Constructor.">datalink_m2m</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rvc, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv_up, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rvc_up ) : |
228 | | <a name="l00330"></a>00330 <a class="code" href="classdatalink__m2e.html" title="data link between">datalink_m2e</a> ( rv, rvc, rv_up) { |
229 | | <a name="l00331"></a>00331 <span class="comment">//establish c2c connection</span> |
230 | | <a name="l00332"></a>00332 rvc.<a class="code" href="classRV.html#bb724fa4e2d9ed7bfd0993b5975018a4">dataind</a> ( rvc_up, <a class="code" href="classdatalink__m2m.html#056193d459cd5e5fd323b5cbc6a55bad" title="cond-to-cond link, indeces of the local cond">c2c_lo</a>, <a class="code" href="classdatalink__m2m.html#d1044bf4846f878290100429600273b2" title="cond-to-cond link, indeces of the upper cond">c2c_up</a> ); |
231 | | <a name="l00333"></a>00333 it_assert_debug(<a class="code" href="classdatalink__m2m.html#056193d459cd5e5fd323b5cbc6a55bad" title="cond-to-cond link, indeces of the local cond">c2c_lo</a>.length()+<a class="code" href="classdatalink__m2e.html#29604fb622b6a319d2d5d2709fe01f28" title="upper_val-to-local_cond link, ideces of the local cond">v2c_lo</a>.length()==<a class="code" href="classdatalink__m2e.html#b3927998b71fce3ab030eba1c3c3cec3" title="Remember how long cond should be.">condsize</a>, <span class="stringliteral">"cond is not fully given"</span>); |
232 | | <a name="l00334"></a>00334 } |
233 | | <a name="l00336"></a><a class="code" href="classdatalink__m2m.html#51dd05760f99282a1da5f51eb88e7e42">00336</a> vec <a class="code" href="classdatalink__m2m.html#51dd05760f99282a1da5f51eb88e7e42" title="Get cond for myself from val and cond of &quot;Up&quot;.">get_cond</a> ( <span class="keyword">const</span> vec &val_up, <span class="keyword">const</span> vec &cond_up ) { |
234 | | <a name="l00337"></a>00337 vec tmp ( <a class="code" href="classdatalink__m2e.html#b3927998b71fce3ab030eba1c3c3cec3" title="Remember how long cond should be.">condsize</a> ); |
235 | | <a name="l00338"></a>00338 set_subvector ( tmp,<a class="code" href="classdatalink__m2e.html#29604fb622b6a319d2d5d2709fe01f28" title="upper_val-to-local_cond link, ideces of the local cond">v2c_lo</a>,val_up ( <a class="code" href="classdatalink__m2e.html#6b46f983c46621b6bfe2b5da3d467d2a" title="upper_val-to-local_cond link, indeces of the upper val">v2c_up</a> ) ); |
236 | | <a name="l00339"></a>00339 set_subvector ( tmp,<a class="code" href="classdatalink__m2m.html#056193d459cd5e5fd323b5cbc6a55bad" title="cond-to-cond link, indeces of the local cond">c2c_lo</a>,cond_up ( <a class="code" href="classdatalink__m2m.html#d1044bf4846f878290100429600273b2" title="cond-to-cond link, indeces of the upper cond">c2c_up</a> ) ); |
237 | | <a name="l00340"></a>00340 <span class="keywordflow">return</span> tmp; |
238 | | <a name="l00341"></a>00341 } |
239 | | <a name="l00343"></a>00343 |
240 | | <a name="l00344"></a>00344 }; |
241 | | <a name="l00345"></a>00345 |
242 | | <a name="l00349"></a><a class="code" href="classmepdf.html">00349</a> <span class="keyword">class </span><a class="code" href="classmepdf.html" title="Unconditional mpdf, allows using epdf in the role of mpdf.">mepdf</a> : <span class="keyword">public</span> <a class="code" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> { |
243 | | <a name="l00350"></a>00350 <span class="keyword">public</span>: |
244 | | <a name="l00352"></a><a class="code" href="classmepdf.html#0f39973ffd94c1e20e2d8aacc4adc6fa">00352</a> <a class="code" href="classmepdf.html#0f39973ffd94c1e20e2d8aacc4adc6fa" title="Default constructor.">mepdf</a> (<span class="keyword">const</span> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* em ) :<a class="code" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> ( em-><a class="code" href="classmpdf.html#71256ffb5fbd08f41d650e606a5bd585" title="access function">_rv</a>(),<a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>() ) {<a class="code" href="classmpdf.html#7aa894208a32f3487827df6d5054424c" title="pointer to internal epdf">ep</a>=<span class="keyword">const_cast<</span><a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>*<span class="keyword">></span>(em);}; |
245 | | <a name="l00353"></a><a class="code" href="classmepdf.html#bc87d89dbc3cf5eb6a0ad7d6d572488f">00353</a> <span class="keywordtype">void</span> <a class="code" href="classmepdf.html#bc87d89dbc3cf5eb6a0ad7d6d572488f" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &cond ) {} |
246 | | <a name="l00354"></a>00354 }; |
247 | | <a name="l00355"></a>00355 |
248 | | <a name="l00358"></a><a class="code" href="classcompositepdf.html">00358</a> <span class="keyword">class </span><a class="code" href="classcompositepdf.html" title="Abstract composition of pdfs, a base for specific classes this abstract class is...">compositepdf</a> { |
249 | | <a name="l00359"></a>00359 <span class="keyword">protected</span>: |
250 | | <a name="l00361"></a><a class="code" href="classcompositepdf.html#c1646fe41ff5934d010e54ccaa46133f">00361</a> <span class="keywordtype">int</span> <a class="code" href="classcompositepdf.html#c1646fe41ff5934d010e54ccaa46133f" title="Number of mpdfs in the composite.">n</a>; |
251 | | <a name="l00363"></a><a class="code" href="classcompositepdf.html#637877061b917a16a0421bb5c4cd480d">00363</a> Array<mpdf*> <a class="code" href="classcompositepdf.html#637877061b917a16a0421bb5c4cd480d" title="Elements of composition.">mpdfs</a>; |
252 | | <a name="l00364"></a>00364 <span class="keyword">public</span>: |
253 | | <a name="l00365"></a>00365 <a class="code" href="classcompositepdf.html" title="Abstract composition of pdfs, a base for specific classes this abstract class is...">compositepdf</a> ( Array<mpdf*> A0 ) : <a class="code" href="classcompositepdf.html#c1646fe41ff5934d010e54ccaa46133f" title="Number of mpdfs in the composite.">n</a> ( A0.length() ), <a class="code" href="classcompositepdf.html#637877061b917a16a0421bb5c4cd480d" title="Elements of composition.">mpdfs</a> ( A0 ) {}; |
254 | | <a name="l00367"></a>00367 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classcompositepdf.html#635d219fb3e32852400d6f98aa4bdc93" title="find common rv, flag">getrv</a> ( <span class="keywordtype">bool</span> checkoverlap=<span class="keyword">false</span> ); |
255 | | <a name="l00369"></a>00369 <span class="keywordtype">void</span> <a class="code" href="classcompositepdf.html#5a4479785c1fdb2cc351fbea07b899ac" title="common rvc of all mpdfs is written to rvc">setrvc</a> ( <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rv, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &rvc ); |
256 | | <a name="l00370"></a>00370 }; |
257 | | <a name="l00371"></a>00371 |
258 | | <a name="l00379"></a><a class="code" href="classDS.html">00379</a> <span class="keyword">class </span><a class="code" href="classDS.html" title="Abstract class for discrete-time sources of data.">DS</a> { |
259 | | <a name="l00380"></a>00380 <span class="keyword">protected</span>: |
260 | | <a name="l00382"></a><a class="code" href="classDS.html#1012025a1a3a1fdd24aa48698a3d3454">00382</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>; |
261 | | <a name="l00384"></a><a class="code" href="classDS.html#0a88ffaeb3c7c2cf30c69bc41a000629">00384</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> |
262 | | <a name="l00385"></a>00385 <span class="keyword">public</span>: |
263 | | <a name="l00387"></a>00387 <span class="keywordtype">void</span> <a class="code" href="classDS.html#db2dacc9e71a36eeb9c5c2ee402eeeb1" title="Returns full vector of observed data.">getdata</a> ( vec &dt ); |
264 | | <a name="l00389"></a>00389 <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 ); |
265 | | <a name="l00391"></a>00391 <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 ); |
266 | | <a name="l00393"></a>00393 <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 ); |
267 | | <a name="l00399"></a>00399 <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 ); |
268 | | <a name="l00400"></a>00400 |
269 | | <a name="l00402"></a>00402 <span class="keywordtype">void</span> <a class="code" href="classDS.html#470ba89e8e7c3c4d830803221b4e9be6" title="Moves from to , i.e. perfroms the actions and reads response of the system.">step</a>(); |
270 | | <a name="l00403"></a>00403 |
271 | | <a name="l00404"></a>00404 }; |
| 169 | <a name="l00246"></a><a class="code" href="classbdm_1_1mpdf.html#6336a8a72462e2a56a3989a220f18b1b">00246</a> <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mpdf.html#6336a8a72462e2a56a3989a220f18b1b" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evallogcond</a> ( <span class="keyword">const</span> vec &dt, <span class="keyword">const</span> vec &cond ) {<span class="keywordtype">double</span> tmp; this-><a class="code" href="classbdm_1_1mpdf.html#db94784a9aacf74c65c5a014f6743530" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( cond );tmp = <a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>-><a class="code" href="classbdm_1_1epdf.html#a8e39e2ff5e5cf5471bc159530d3b2d3" title="Compute log-probability of argument val.">evallog</a> ( dt ); it_assert_debug(std::isfinite(tmp),<span class="stringliteral">"Infinite value"</span>); <span class="keywordflow">return</span> tmp; |
| 170 | <a name="l00247"></a>00247 }; |
| 171 | <a name="l00248"></a>00248 |
| 172 | <a name="l00250"></a><a class="code" href="classbdm_1_1mpdf.html#0b0ed1ed663071bb7cf4a1349eb94fcb">00250</a> <span class="keyword">virtual</span> vec <a class="code" href="classbdm_1_1mpdf.html#0b0ed1ed663071bb7cf4a1349eb94fcb" title="Matrix version of evallogcond.">evallogcond_m</a> ( <span class="keyword">const</span> mat &Dt, <span class="keyword">const</span> vec &cond ) {this-><a class="code" href="classbdm_1_1mpdf.html#db94784a9aacf74c65c5a014f6743530" 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="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>-><a class="code" href="classbdm_1_1epdf.html#34956d4dd3176eeb5937cf48a1546b62" title="Compute log-probability of multiple values argument val.">evallog_m</a> ( Dt );}; |
| 173 | <a name="l00251"></a>00251 |
| 174 | <a name="l00253"></a><a class="code" href="classbdm_1_1mpdf.html#2d83cf2a5ba40cab11dfe158ced9ee9a">00253</a> <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1mpdf.html#2d83cf2a5ba40cab11dfe158ced9ee9a" title="Destructor for future use;.">~mpdf</a>() {}; |
| 175 | <a name="l00254"></a>00254 |
| 176 | <a name="l00256"></a><a class="code" href="classbdm_1_1mpdf.html#5fd998aa9e223231ab20f29762e594f7">00256</a> <a class="code" href="classbdm_1_1mpdf.html#5fd998aa9e223231ab20f29762e594f7" title="Default constructor.">mpdf</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rvc0 ) :<a class="code" href="classbdm_1_1mpdf.html#9bcfb45435d30983f436d41c298cbb51" title="modeled random variable">rv</a> ( rv0 ),<a class="code" href="classbdm_1_1mpdf.html#5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a> ( rvc0 ) {}; |
| 177 | <a name="l00258"></a><a class="code" href="classbdm_1_1mpdf.html#b3aba7311038bf990d706a64cab60cf8">00258</a> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1mpdf.html#b3aba7311038bf990d706a64cab60cf8" title="access function">_rvc</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mpdf.html#5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>;} |
| 178 | <a name="l00260"></a><a class="code" href="classbdm_1_1mpdf.html#222d5280e309c5a053ba73841e98c151">00260</a> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1mpdf.html#222d5280e309c5a053ba73841e98c151" title="access function">_rv</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mpdf.html#9bcfb45435d30983f436d41c298cbb51" title="modeled random variable">rv</a>;} |
| 179 | <a name="l00262"></a><a class="code" href="classbdm_1_1mpdf.html#1892fe3933488942253679f068e9e7f6">00262</a> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>& <a class="code" href="classbdm_1_1mpdf.html#1892fe3933488942253679f068e9e7f6" title="access function">_epdf</a>() {<span class="keywordflow">return</span> *<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>;} |
| 180 | <a name="l00264"></a><a class="code" href="classbdm_1_1mpdf.html#05e843fd11c410a99dad2b88c55aca80">00264</a> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* <a class="code" href="classbdm_1_1mpdf.html#05e843fd11c410a99dad2b88c55aca80" title="access function">_e</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>;} |
| 181 | <a name="l00265"></a>00265 }; |
| 182 | <a name="l00266"></a>00266 |
| 183 | <a name="l00269"></a><a class="code" href="classbdm_1_1datalink__e2e.html">00269</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1datalink__e2e.html">datalink_e2e</a> { |
| 184 | <a name="l00270"></a>00270 <span class="keyword">protected</span>: |
| 185 | <a name="l00272"></a><a class="code" href="classbdm_1_1datalink__e2e.html#eb4ee03764c2531083ec19759b7a52d3">00272</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1datalink__e2e.html#eb4ee03764c2531083ec19759b7a52d3" title="Remember how long val should be.">valsize</a>; |
| 186 | <a name="l00274"></a><a class="code" href="classbdm_1_1datalink__e2e.html#ed0830e7a13f4f0f4beaae939cf11f6b">00274</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1datalink__e2e.html#ed0830e7a13f4f0f4beaae939cf11f6b" title="Remember how long val of &quot;Up&quot; should be.">valupsize</a>; |
| 187 | <a name="l00276"></a><a class="code" href="classbdm_1_1datalink__e2e.html#fa38045c8f1230757d62d38e71a49b97">00276</a> ivec <a class="code" href="classbdm_1_1datalink__e2e.html#fa38045c8f1230757d62d38e71a49b97" title="val-to-val link, indeces of the upper val">v2v_up</a>; |
| 188 | <a name="l00277"></a>00277 <span class="keyword">public</span>: |
| 189 | <a name="l00279"></a><a class="code" href="classbdm_1_1datalink__e2e.html#c85912b85a0a47ff0931d07e2d653264">00279</a> <a class="code" href="classbdm_1_1datalink__e2e.html#c85912b85a0a47ff0931d07e2d653264" title="Constructor.">datalink_e2e</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv_up ) : |
| 190 | <a name="l00280"></a>00280 <a class="code" href="classbdm_1_1datalink__e2e.html#eb4ee03764c2531083ec19759b7a52d3" title="Remember how long val should be.">valsize</a> ( rv.count() ), <a class="code" href="classbdm_1_1datalink__e2e.html#ed0830e7a13f4f0f4beaae939cf11f6b" title="Remember how long val of &quot;Up&quot; should be.">valupsize</a> ( rv_up.count() ), <a class="code" href="classbdm_1_1datalink__e2e.html#fa38045c8f1230757d62d38e71a49b97" title="val-to-val link, indeces of the upper val">v2v_up</a> ( rv.dataind ( rv_up ) ) { |
| 191 | <a name="l00281"></a>00281 it_assert_debug ( <a class="code" href="classbdm_1_1datalink__e2e.html#fa38045c8f1230757d62d38e71a49b97" title="val-to-val link, indeces of the upper val">v2v_up</a>.length() ==<a class="code" href="classbdm_1_1datalink__e2e.html#eb4ee03764c2531083ec19759b7a52d3" title="Remember how long val should be.">valsize</a>,<span class="stringliteral">"rv is not fully in rv_up"</span> ); |
| 192 | <a name="l00282"></a>00282 } |
| 193 | <a name="l00284"></a><a class="code" href="classbdm_1_1datalink__e2e.html#4938c157340dc0dbc8f7bd3491678d86">00284</a> vec <a class="code" href="classbdm_1_1datalink__e2e.html#4938c157340dc0dbc8f7bd3491678d86" title="Get val for myself from val of &quot;Up&quot;.">get_val</a> ( <span class="keyword">const</span> vec &val_up ) {it_assert_debug ( <a class="code" href="classbdm_1_1datalink__e2e.html#ed0830e7a13f4f0f4beaae939cf11f6b" title="Remember how long val of &quot;Up&quot; should be.">valupsize</a>==val_up.length(),<span class="stringliteral">"Wrong val_up"</span> ); <span class="keywordflow">return</span> get_vec ( val_up,<a class="code" href="classbdm_1_1datalink__e2e.html#fa38045c8f1230757d62d38e71a49b97" title="val-to-val link, indeces of the upper val">v2v_up</a> );} |
| 194 | <a name="l00286"></a><a class="code" href="classbdm_1_1datalink__e2e.html#7646ec2f0f83bee2852e0fae6b0756a2">00286</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1datalink__e2e.html#7646ec2f0f83bee2852e0fae6b0756a2" title="Fill val of &quot;Up&quot; by my pieces.">fill_val</a> ( vec &val_up, <span class="keyword">const</span> vec &val ) { |
| 195 | <a name="l00287"></a>00287 it_assert_debug ( <a class="code" href="classbdm_1_1datalink__e2e.html#eb4ee03764c2531083ec19759b7a52d3" title="Remember how long val should be.">valsize</a>==val.length(),<span class="stringliteral">"Wrong val"</span> ); |
| 196 | <a name="l00288"></a>00288 it_assert_debug ( <a class="code" href="classbdm_1_1datalink__e2e.html#ed0830e7a13f4f0f4beaae939cf11f6b" title="Remember how long val of &quot;Up&quot; should be.">valupsize</a>==val_up.length(),<span class="stringliteral">"Wrong val_up"</span> ); |
| 197 | <a name="l00289"></a>00289 set_subvector ( val_up, <a class="code" href="classbdm_1_1datalink__e2e.html#fa38045c8f1230757d62d38e71a49b97" title="val-to-val link, indeces of the upper val">v2v_up</a>, val ); |
| 198 | <a name="l00290"></a>00290 } |
| 199 | <a name="l00291"></a>00291 }; |
| 200 | <a name="l00292"></a>00292 |
| 201 | <a name="l00294"></a><a class="code" href="classbdm_1_1datalink__m2e.html">00294</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1datalink__m2e.html" title="data link between">datalink_m2e</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1datalink__e2e.html">datalink_e2e</a> { |
| 202 | <a name="l00295"></a>00295 <span class="keyword">protected</span>: |
| 203 | <a name="l00297"></a><a class="code" href="classbdm_1_1datalink__m2e.html#3fb26525e0bfa7932a37c5cd404801f9">00297</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1datalink__m2e.html#3fb26525e0bfa7932a37c5cd404801f9" title="Remember how long cond should be.">condsize</a>; |
| 204 | <a name="l00299"></a><a class="code" href="classbdm_1_1datalink__m2e.html#43fe3e2d7aa04134053ec15793722783">00299</a> ivec <a class="code" href="classbdm_1_1datalink__m2e.html#43fe3e2d7aa04134053ec15793722783" title="upper_val-to-local_cond link, indeces of the upper val">v2c_up</a>; |
| 205 | <a name="l00301"></a><a class="code" href="classbdm_1_1datalink__m2e.html#9e0048d87bda78e9b8d38761440c7abc">00301</a> ivec <a class="code" href="classbdm_1_1datalink__m2e.html#9e0048d87bda78e9b8d38761440c7abc" title="upper_val-to-local_cond link, ideces of the local cond">v2c_lo</a>; |
| 206 | <a name="l00302"></a>00302 |
| 207 | <a name="l00303"></a>00303 <span class="keyword">public</span>: |
| 208 | <a name="l00305"></a><a class="code" href="classbdm_1_1datalink__m2e.html#31bb5b6cd04b4d99a02fc8d1ad5ce202">00305</a> <a class="code" href="classbdm_1_1datalink__m2e.html#31bb5b6cd04b4d99a02fc8d1ad5ce202" title="Constructor.">datalink_m2e</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rvc, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv_up ) : |
| 209 | <a name="l00306"></a>00306 <a class="code" href="classbdm_1_1datalink__e2e.html">datalink_e2e</a> ( rv,rv_up ), <a class="code" href="classbdm_1_1datalink__m2e.html#3fb26525e0bfa7932a37c5cd404801f9" title="Remember how long cond should be.">condsize</a> ( rvc.count() ) { |
| 210 | <a name="l00307"></a>00307 <span class="comment">//establish v2c connection</span> |
| 211 | <a name="l00308"></a>00308 rvc.<a class="code" href="classbdm_1_1RV.html#cbebdb5e0d30101a6eb63550ef701c55">dataind</a> ( rv_up, <a class="code" href="classbdm_1_1datalink__m2e.html#9e0048d87bda78e9b8d38761440c7abc" title="upper_val-to-local_cond link, ideces of the local cond">v2c_lo</a>, <a class="code" href="classbdm_1_1datalink__m2e.html#43fe3e2d7aa04134053ec15793722783" title="upper_val-to-local_cond link, indeces of the upper val">v2c_up</a> ); |
| 212 | <a name="l00309"></a>00309 } |
| 213 | <a name="l00311"></a><a class="code" href="classbdm_1_1datalink__m2e.html#7ba850822e3cf9a4b079afc7e7c01703">00311</a> vec <a class="code" href="classbdm_1_1datalink__m2e.html#7ba850822e3cf9a4b079afc7e7c01703" title="Construct condition.">get_cond</a> ( <span class="keyword">const</span> vec &val_up ) { |
| 214 | <a name="l00312"></a>00312 vec tmp ( <a class="code" href="classbdm_1_1datalink__m2e.html#3fb26525e0bfa7932a37c5cd404801f9" title="Remember how long cond should be.">condsize</a> ); |
| 215 | <a name="l00313"></a>00313 set_subvector ( tmp,<a class="code" href="classbdm_1_1datalink__m2e.html#9e0048d87bda78e9b8d38761440c7abc" title="upper_val-to-local_cond link, ideces of the local cond">v2c_lo</a>,val_up ( <a class="code" href="classbdm_1_1datalink__m2e.html#43fe3e2d7aa04134053ec15793722783" title="upper_val-to-local_cond link, indeces of the upper val">v2c_up</a> ) ); |
| 216 | <a name="l00314"></a>00314 <span class="keywordflow">return</span> tmp; |
| 217 | <a name="l00315"></a>00315 } |
| 218 | <a name="l00316"></a>00316 <span class="keywordtype">void</span> fill_val_cond ( vec &val_up, <span class="keyword">const</span> vec &val, <span class="keyword">const</span> vec &cond ) { |
| 219 | <a name="l00317"></a>00317 it_assert_debug ( <a class="code" href="classbdm_1_1datalink__e2e.html#eb4ee03764c2531083ec19759b7a52d3" title="Remember how long val should be.">valsize</a>==val.length(),<span class="stringliteral">"Wrong val"</span> ); |
| 220 | <a name="l00318"></a>00318 it_assert_debug ( <a class="code" href="classbdm_1_1datalink__e2e.html#ed0830e7a13f4f0f4beaae939cf11f6b" title="Remember how long val of &quot;Up&quot; should be.">valupsize</a>==val_up.length(),<span class="stringliteral">"Wrong val_up"</span> ); |
| 221 | <a name="l00319"></a>00319 set_subvector ( val_up, <a class="code" href="classbdm_1_1datalink__e2e.html#fa38045c8f1230757d62d38e71a49b97" title="val-to-val link, indeces of the upper val">v2v_up</a>, val ); |
| 222 | <a name="l00320"></a>00320 set_subvector ( val_up, <a class="code" href="classbdm_1_1datalink__m2e.html#43fe3e2d7aa04134053ec15793722783" title="upper_val-to-local_cond link, indeces of the upper val">v2c_up</a>, cond ); |
| 223 | <a name="l00321"></a>00321 } |
| 224 | <a name="l00322"></a>00322 }; |
| 225 | <a name="l00325"></a><a class="code" href="classbdm_1_1datalink__m2m.html">00325</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1datalink__m2m.html">datalink_m2m</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1datalink__m2e.html" title="data link between">datalink_m2e</a> { |
| 226 | <a name="l00326"></a>00326 <span class="keyword">protected</span>: |
| 227 | <a name="l00328"></a><a class="code" href="classbdm_1_1datalink__m2m.html#d64dda6f92654628276bbcebb7600d0d">00328</a> ivec <a class="code" href="classbdm_1_1datalink__m2m.html#d64dda6f92654628276bbcebb7600d0d" title="cond-to-cond link, indeces of the upper cond">c2c_up</a>; |
| 228 | <a name="l00330"></a><a class="code" href="classbdm_1_1datalink__m2m.html#0ea05c47de4538b7042ff878e6e309a5">00330</a> ivec <a class="code" href="classbdm_1_1datalink__m2m.html#0ea05c47de4538b7042ff878e6e309a5" title="cond-to-cond link, indeces of the local cond">c2c_lo</a>; |
| 229 | <a name="l00331"></a>00331 <span class="keyword">public</span>: |
| 230 | <a name="l00333"></a><a class="code" href="classbdm_1_1datalink__m2m.html#540c4b60686fdf1a7915300ae11bc41b">00333</a> <a class="code" href="classbdm_1_1datalink__m2m.html#540c4b60686fdf1a7915300ae11bc41b" title="Constructor.">datalink_m2m</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rvc, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv_up, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rvc_up ) : |
| 231 | <a name="l00334"></a>00334 <a class="code" href="classbdm_1_1datalink__m2e.html" title="data link between">datalink_m2e</a> ( rv, rvc, rv_up) { |
| 232 | <a name="l00335"></a>00335 <span class="comment">//establish c2c connection</span> |
| 233 | <a name="l00336"></a>00336 rvc.<a class="code" href="classbdm_1_1RV.html#cbebdb5e0d30101a6eb63550ef701c55">dataind</a> ( rvc_up, <a class="code" href="classbdm_1_1datalink__m2m.html#0ea05c47de4538b7042ff878e6e309a5" title="cond-to-cond link, indeces of the local cond">c2c_lo</a>, <a class="code" href="classbdm_1_1datalink__m2m.html#d64dda6f92654628276bbcebb7600d0d" title="cond-to-cond link, indeces of the upper cond">c2c_up</a> ); |
| 234 | <a name="l00337"></a>00337 it_assert_debug(<a class="code" href="classbdm_1_1datalink__m2m.html#0ea05c47de4538b7042ff878e6e309a5" title="cond-to-cond link, indeces of the local cond">c2c_lo</a>.length()+<a class="code" href="classbdm_1_1datalink__m2e.html#9e0048d87bda78e9b8d38761440c7abc" title="upper_val-to-local_cond link, ideces of the local cond">v2c_lo</a>.length()==<a class="code" href="classbdm_1_1datalink__m2e.html#3fb26525e0bfa7932a37c5cd404801f9" title="Remember how long cond should be.">condsize</a>, <span class="stringliteral">"cond is not fully given"</span>); |
| 235 | <a name="l00338"></a>00338 } |
| 236 | <a name="l00340"></a><a class="code" href="classbdm_1_1datalink__m2m.html#911fb7fcfa80d4e31db8e0cc03141a90">00340</a> vec <a class="code" href="classbdm_1_1datalink__m2m.html#911fb7fcfa80d4e31db8e0cc03141a90" title="Get cond for myself from val and cond of &quot;Up&quot;.">get_cond</a> ( <span class="keyword">const</span> vec &val_up, <span class="keyword">const</span> vec &cond_up ) { |
| 237 | <a name="l00341"></a>00341 vec tmp ( <a class="code" href="classbdm_1_1datalink__m2e.html#3fb26525e0bfa7932a37c5cd404801f9" title="Remember how long cond should be.">condsize</a> ); |
| 238 | <a name="l00342"></a>00342 set_subvector ( tmp,<a class="code" href="classbdm_1_1datalink__m2e.html#9e0048d87bda78e9b8d38761440c7abc" title="upper_val-to-local_cond link, ideces of the local cond">v2c_lo</a>,val_up ( <a class="code" href="classbdm_1_1datalink__m2e.html#43fe3e2d7aa04134053ec15793722783" title="upper_val-to-local_cond link, indeces of the upper val">v2c_up</a> ) ); |
| 239 | <a name="l00343"></a>00343 set_subvector ( tmp,<a class="code" href="classbdm_1_1datalink__m2m.html#0ea05c47de4538b7042ff878e6e309a5" title="cond-to-cond link, indeces of the local cond">c2c_lo</a>,cond_up ( <a class="code" href="classbdm_1_1datalink__m2m.html#d64dda6f92654628276bbcebb7600d0d" title="cond-to-cond link, indeces of the upper cond">c2c_up</a> ) ); |
| 240 | <a name="l00344"></a>00344 <span class="keywordflow">return</span> tmp; |
| 241 | <a name="l00345"></a>00345 } |
| 242 | <a name="l00347"></a>00347 |
| 243 | <a name="l00348"></a>00348 }; |
| 244 | <a name="l00349"></a>00349 |
| 245 | <a name="l00353"></a><a class="code" href="classbdm_1_1mepdf.html">00353</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mepdf.html" title="Unconditional mpdf, allows using epdf in the role of mpdf.">mepdf</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> { |
| 246 | <a name="l00354"></a>00354 <span class="keyword">public</span>: |
| 247 | <a name="l00356"></a><a class="code" href="classbdm_1_1mepdf.html#27cc32d1a810516c25bda51ddf886376">00356</a> <a class="code" href="classbdm_1_1mepdf.html#27cc32d1a810516c25bda51ddf886376" title="Default constructor.">mepdf</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* em ) :<a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> ( em-><a class="code" href="classbdm_1_1mpdf.html#222d5280e309c5a053ba73841e98c151" title="access function">_rv</a>(),<a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>() ) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=<span class="keyword">const_cast<</span><a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>*<span class="keyword">></span>(em);}; |
| 248 | <a name="l00357"></a><a class="code" href="classbdm_1_1mepdf.html#b2b898058169e7ed9a6dc7cd4e1c147c">00357</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mepdf.html#b2b898058169e7ed9a6dc7cd4e1c147c" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &cond ) {} |
| 249 | <a name="l00358"></a>00358 }; |
| 250 | <a name="l00359"></a>00359 |
| 251 | <a name="l00362"></a><a class="code" href="classbdm_1_1compositepdf.html">00362</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1compositepdf.html" title="Abstract composition of pdfs, a base for specific classes this abstract class is...">compositepdf</a> { |
| 252 | <a name="l00363"></a>00363 <span class="keyword">protected</span>: |
| 253 | <a name="l00365"></a><a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a">00365</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a>; |
| 254 | <a name="l00367"></a><a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a">00367</a> Array<mpdf*> <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a>; |
| 255 | <a name="l00368"></a>00368 <span class="keyword">public</span>: |
| 256 | <a name="l00369"></a>00369 <a class="code" href="classbdm_1_1compositepdf.html" title="Abstract composition of pdfs, a base for specific classes this abstract class is...">compositepdf</a> ( Array<mpdf*> A0 ) : <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ( A0.length() ), <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( A0 ) {}; |
| 257 | <a name="l00371"></a>00371 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1compositepdf.html#c73d39acc4378eee6a63155c3517d3c9" title="find common rv, flag">getrv</a> ( <span class="keywordtype">bool</span> checkoverlap=<span class="keyword">false</span> ); |
| 258 | <a name="l00373"></a>00373 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1compositepdf.html#c71fc2c51f49d797e61f479f543c75ce" title="common rvc of all mpdfs is written to rvc">setrvc</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rvc ); |
| 259 | <a name="l00374"></a>00374 }; |
| 260 | <a name="l00375"></a>00375 |
| 261 | <a name="l00383"></a><a class="code" href="classbdm_1_1DS.html">00383</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1DS.html" title="Abstract class for discrete-time sources of data.">DS</a> { |
| 262 | <a name="l00384"></a>00384 <span class="keyword">protected</span>: |
| 263 | <a name="l00386"></a><a class="code" href="classbdm_1_1DS.html#d8db125ac35f3b8eeb773fc9a4cb45ec">00386</a> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1DS.html#d8db125ac35f3b8eeb773fc9a4cb45ec" title="Observed variables, returned by getdata().">Drv</a>; |
| 264 | <a name="l00388"></a><a class="code" href="classbdm_1_1DS.html#9ac5970128fd39f4f6226723cd1de702">00388</a> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1DS.html#9ac5970128fd39f4f6226723cd1de702" title="Action variables, accepted by write().">Urv</a>; <span class="comment">//</span> |
| 265 | <a name="l00389"></a>00389 <span class="keyword">public</span>: |
| 266 | <a name="l00390"></a>00390 <a class="code" href="classbdm_1_1DS.html" title="Abstract class for discrete-time sources of data.">DS</a>():<a class="code" href="classbdm_1_1DS.html#d8db125ac35f3b8eeb773fc9a4cb45ec" title="Observed variables, returned by getdata().">Drv</a>(RV0),<a class="code" href="classbdm_1_1DS.html#9ac5970128fd39f4f6226723cd1de702" title="Action variables, accepted by write().">Urv</a>(RV0) {}; |
| 267 | <a name="l00392"></a>00392 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1DS.html#cbffe794e02eb88b5856b83119b7c23c" title="Returns full vector of observed data.">getdata</a> ( vec &dt ); |
| 268 | <a name="l00394"></a>00394 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1DS.html#cbffe794e02eb88b5856b83119b7c23c" title="Returns full vector of observed data.">getdata</a> ( vec &dt, ivec &indeces ); |
| 269 | <a name="l00396"></a>00396 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1DS.html#653a30e5bb76fb231429dae52216c851" title="Accepts action variable and schedule it for application.">write</a> ( vec &ut ); |
| 270 | <a name="l00398"></a>00398 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1DS.html#653a30e5bb76fb231429dae52216c851" title="Accepts action variable and schedule it for application.">write</a> ( vec &ut, ivec &indeces ); |
| 271 | <a name="l00404"></a>00404 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1DS.html#edd136e9046c08ac615cbe3c741de21e" title="Method that assigns random variables to the datasource. Typically, the datasource...">linkrvs</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &drv, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &urv ); |
273 | | <a name="l00410"></a><a class="code" href="classBM.html">00410</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> { |
274 | | <a name="l00411"></a>00411 <span class="keyword">protected</span>: |
275 | | <a name="l00413"></a><a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88">00413</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>; |
276 | | <a name="l00415"></a><a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979">00415</a> <span class="keywordtype">double</span> <a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a>; |
277 | | <a name="l00417"></a><a class="code" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129">00417</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>; |
278 | | <a name="l00418"></a>00418 <span class="keyword">public</span>: |
279 | | <a name="l00419"></a>00419 |
280 | | <a name="l00421"></a><a class="code" href="classBM.html#43d2ad6a6c9f1bcd22fe8906c477e50e">00421</a> <a class="code" href="classBM.html#43d2ad6a6c9f1bcd22fe8906c477e50e" 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, <span class="keywordtype">double</span> ll0=0,<span class="keywordtype">bool</span> evalll0=<span class="keyword">true</span> ) :<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> ( ll0 ),<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> ( evalll0 ) {<span class="comment">//Fixme: test rv</span> |
281 | | <a name="l00422"></a>00422 }; |
282 | | <a name="l00424"></a><a class="code" href="classBM.html#e8fc5fae042f2b46d4d3827f9587d47d">00424</a> <a class="code" href="classBM.html#43d2ad6a6c9f1bcd22fe8906c477e50e" title="Default constructor.">BM</a> ( <span class="keyword">const</span> <a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> &B ) : <a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a> ( B.<a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a> ), <a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a> ( B.<a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a> ), <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> ( B.<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> ) {} |
283 | | <a name="l00425"></a>00425 |
284 | | <a name="l00429"></a>00429 <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; |
285 | | <a name="l00431"></a>00431 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBM.html#0186270f75189677f390fe088a9947e9" title="Batch Bayes rule (columns of Dt are observations).">bayesB</a> ( <span class="keyword">const</span> mat &Dt ); |
286 | | <a name="l00433"></a>00433 <span class="keyword">virtual</span> <span class="keyword">const</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#8554809fec160bee279bcd5fa14ead5c" title="Returns a reference to the epdf representing posterior density on parameters.">_epdf</a>() <span class="keyword">const</span> =0; |
287 | | <a name="l00434"></a>00434 |
288 | | <a name="l00436"></a>00436 <span class="keyword">virtual</span> <span class="keyword">const</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#db500c4836f883c175a3cf3ab5a3ce24" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_e</a>() <span class="keyword">const</span> =0; |
289 | | <a name="l00437"></a>00437 |
290 | | <a name="l00440"></a><a class="code" href="classBM.html#8a8ce6df431689964c41cc6c849cfd06">00440</a> <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classBM.html#8a8ce6df431689964c41cc6c849cfd06">logpred</a> ( <span class="keyword">const</span> vec &dt )<span class="keyword"> const</span>{it_error ( <span class="stringliteral">"Not implemented"</span> );<span class="keywordflow">return</span> 0.0;} |
291 | | <a name="l00442"></a><a class="code" href="classBM.html#cd0660f2a1a344b56ac39802708ff165">00442</a> vec <a class="code" href="classBM.html#cd0660f2a1a344b56ac39802708ff165" title="Matrix version of logpred.">logpred_m</a> ( <span class="keyword">const</span> mat &dt )<span class="keyword"> const</span>{vec tmp ( dt.cols() );<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<dt.cols();i++ ) {tmp ( i ) =<a class="code" href="classBM.html#8a8ce6df431689964c41cc6c849cfd06">logpred</a> ( dt.get_col ( i ) );}<span class="keywordflow">return</span> tmp;} |
292 | | <a name="l00443"></a>00443 |
293 | | <a name="l00445"></a><a class="code" href="classBM.html#5594d68ee9aa6fc8c1e79019da5c9d56">00445</a> <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#5594d68ee9aa6fc8c1e79019da5c9d56" title="Constructs a predictive density (marginal density on data).">predictor</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#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a> )<span class="keyword"> const </span>{it_error ( <span class="stringliteral">"Not implemented"</span> );<span class="keywordflow">return</span> NULL;}; |
294 | | <a name="l00446"></a>00446 |
295 | | <a name="l00448"></a><a class="code" href="classBM.html#ca0f02b3b4144e0895cc14f7e0374bdd">00448</a> <span class="keyword">virtual</span> <a class="code" href="classBM.html#ca0f02b3b4144e0895cc14f7e0374bdd" title="Destructor for future use;.">~BM</a>() {}; |
296 | | <a name="l00450"></a><a class="code" href="classBM.html#126bd2595c48e311fc2a7ab72876092a">00450</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>;} |
297 | | <a name="l00452"></a><a class="code" href="classBM.html#87f4a547d2c29180be88175e5eab9c88">00452</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>;} |
298 | | <a name="l00454"></a><a class="code" href="classBM.html#1ffa9f23669aabecc3760c06c6987522">00454</a> <span class="keywordtype">void</span> <a class="code" href="classBM.html#1ffa9f23669aabecc3760c06c6987522" title="access function">set_evalll</a> ( <span class="keywordtype">bool</span> evl0 ) {<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>=evl0;} |
299 | | <a name="l00455"></a>00455 |
300 | | <a name="l00458"></a><a class="code" href="classBM.html#eb58c81d6a7b75b05fc6f276eed78887">00458</a> <span class="keyword">virtual</span> <a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a>* <a class="code" href="classBM.html#eb58c81d6a7b75b05fc6f276eed78887">_copy_</a> ( <span class="keywordtype">bool</span> changerv=<span class="keyword">false</span> ) {it_error ( <span class="stringliteral">"function _copy_ not implemented for this BM"</span> ); <span class="keywordflow">return</span> NULL;}; |
301 | | <a name="l00459"></a>00459 }; |
| 273 | <a name="l00407"></a>00407 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1DS.html#478b4438640c36e7dca1c269a31ff11e" title="Moves from to , i.e. perfroms the actions and reads response of the system.">step</a>(); |
| 274 | <a name="l00408"></a>00408 |
| 275 | <a name="l00409"></a>00409 }; |
| 276 | <a name="l00410"></a>00410 |
| 277 | <a name="l00415"></a><a class="code" href="classbdm_1_1BM.html">00415</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> { |
| 278 | <a name="l00416"></a>00416 <span class="keyword">protected</span>: |
| 279 | <a name="l00418"></a><a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca">00418</a> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca" title="Random variable of the posterior.">rv</a>; |
| 280 | <a name="l00420"></a><a class="code" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a">00420</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a" title="Logarithm of marginalized data likelihood.">ll</a>; |
| 281 | <a name="l00422"></a><a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee">00422</a> <span class="keywordtype">bool</span> <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a>; |
| 282 | <a name="l00423"></a>00423 <span class="keyword">public</span>: |
| 283 | <a name="l00424"></a>00424 |
| 284 | <a name="l00426"></a><a class="code" href="classbdm_1_1BM.html#a33000bb124c32e58742f056ecab4293">00426</a> <a class="code" href="classbdm_1_1BM.html#a33000bb124c32e58742f056ecab4293" title="Default constructor.">BM</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rv0, <span class="keywordtype">double</span> ll0=0,<span class="keywordtype">bool</span> evalll0=<span class="keyword">true</span> ) :<a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca" title="Random variable of the posterior.">rv</a> ( rv0 ), <a class="code" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a" title="Logarithm of marginalized data likelihood.">ll</a> ( ll0 ),<a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ( evalll0 ) {<span class="comment">//Fixme: test rv</span> |
| 285 | <a name="l00427"></a>00427 }; |
| 286 | <a name="l00429"></a><a class="code" href="classbdm_1_1BM.html#241b3701190ff1f729fe873a2eef0055">00429</a> <a class="code" href="classbdm_1_1BM.html#a33000bb124c32e58742f056ecab4293" title="Default constructor.">BM</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> &B ) : <a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca" title="Random variable of the posterior.">rv</a> ( B.<a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca" title="Random variable of the posterior.">rv</a> ), <a class="code" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a" title="Logarithm of marginalized data likelihood.">ll</a> ( B.<a class="code" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a" title="Logarithm of marginalized data likelihood.">ll</a> ), <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ( B.<a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ) {} |
| 287 | <a name="l00430"></a>00430 |
| 288 | <a name="l00434"></a>00434 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1BM.html#60b1779a577367c369a932cabd3a6188" title="Incremental Bayes rule.">bayes</a> ( <span class="keyword">const</span> vec &dt ) = 0; |
| 289 | <a name="l00436"></a>00436 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1BM.html#1dee3fddaf021e62d925289660a707dc" title="Batch Bayes rule (columns of Dt are observations).">bayesB</a> ( <span class="keyword">const</span> mat &Dt ); |
| 290 | <a name="l00438"></a>00438 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>& <a class="code" href="classbdm_1_1BM.html#963258c4c2dd05be001003b19aceefef" title="Returns a reference to the epdf representing posterior density on parameters.">_epdf</a>() <span class="keyword">const</span> =0; |
| 291 | <a name="l00439"></a>00439 |
| 292 | <a name="l00441"></a>00441 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* <a class="code" href="classbdm_1_1BM.html#4ed0f8b880e606316ae800f3a011c3a6" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_e</a>() <span class="keyword">const</span> =0; |
| 293 | <a name="l00442"></a>00442 |
| 294 | <a name="l00445"></a><a class="code" href="classbdm_1_1BM.html#50257e0c1e5b5c73153ea6e716ad8ae0">00445</a> <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1BM.html#50257e0c1e5b5c73153ea6e716ad8ae0">logpred</a> ( <span class="keyword">const</span> vec &dt )<span class="keyword"> const</span>{it_error ( <span class="stringliteral">"Not implemented"</span> );<span class="keywordflow">return</span> 0.0;} |
| 295 | <a name="l00447"></a><a class="code" href="classbdm_1_1BM.html#0e8ebe61fb14990abe1254bd3dda5fae">00447</a> vec <a class="code" href="classbdm_1_1BM.html#0e8ebe61fb14990abe1254bd3dda5fae" title="Matrix version of logpred.">logpred_m</a> ( <span class="keyword">const</span> mat &dt )<span class="keyword"> const</span>{vec tmp ( dt.cols() );<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<dt.cols();i++ ) {tmp ( i ) =<a class="code" href="classbdm_1_1BM.html#50257e0c1e5b5c73153ea6e716ad8ae0">logpred</a> ( dt.get_col ( i ) );}<span class="keywordflow">return</span> tmp;} |
| 296 | <a name="l00448"></a>00448 |
| 297 | <a name="l00450"></a><a class="code" href="classbdm_1_1BM.html#710e7d69c0d8791fb41a7cd4683cca2c">00450</a> <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* <a class="code" href="classbdm_1_1BM.html#710e7d69c0d8791fb41a7cd4683cca2c" title="Constructs a predictive density (marginal density on data).">predictor</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &<a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca" title="Random variable of the posterior.">rv</a> )<span class="keyword"> const </span>{it_error ( <span class="stringliteral">"Not implemented"</span> );<span class="keywordflow">return</span> NULL;}; |
| 298 | <a name="l00451"></a>00451 |
| 299 | <a name="l00453"></a><a class="code" href="classbdm_1_1BM.html#374281cad3caa16fa30609bb4ac16505">00453</a> <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1BM.html#374281cad3caa16fa30609bb4ac16505" title="Destructor for future use;.">~BM</a>() {}; |
| 300 | <a name="l00455"></a><a class="code" href="classbdm_1_1BM.html#40a3c891996391e3135518053a917793">00455</a> <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>& <a class="code" href="classbdm_1_1BM.html#40a3c891996391e3135518053a917793" title="access function">_rv</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca" title="Random variable of the posterior.">rv</a>;} |
| 301 | <a name="l00457"></a><a class="code" href="classbdm_1_1BM.html#5be65d37dedfe33a3671e7065f523a70">00457</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1BM.html#5be65d37dedfe33a3671e7065f523a70" title="access function">_ll</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a" title="Logarithm of marginalized data likelihood.">ll</a>;} |
| 302 | <a name="l00459"></a><a class="code" href="classbdm_1_1BM.html#236b3abbcc93594fc97cd86d82c1a83f">00459</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1BM.html#236b3abbcc93594fc97cd86d82c1a83f" title="access function">set_evalll</a> ( <span class="keywordtype">bool</span> evl0 ) {<a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a>=evl0;} |