1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
---|
5 | <title>mixpp: Introduction to Bayesian Decision Making Toolbox BDM</title> |
---|
6 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
---|
7 | <link href="doxygen.css" rel="stylesheet" type="text/css"/> |
---|
8 | </head> |
---|
9 | <body> |
---|
10 | <!-- Generated by Doxygen 1.6.1 --> |
---|
11 | <script type="text/javascript"> |
---|
12 | <!-- |
---|
13 | function changeDisplayState (e){ |
---|
14 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
15 | var button=this.firstChild; |
---|
16 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
17 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
18 | sectionDiv.style.display='block'; |
---|
19 | button.src='open.gif'; |
---|
20 | }else{ |
---|
21 | sectionDiv.style.display='none'; |
---|
22 | button.src='closed.gif'; |
---|
23 | } |
---|
24 | } |
---|
25 | function initDynSections(){ |
---|
26 | var divs=document.getElementsByTagName('div'); |
---|
27 | var sectionCounter=1; |
---|
28 | for(var i=0;i<divs.length-1;i++){ |
---|
29 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
30 | var header=divs[i]; |
---|
31 | var section=divs[i+1]; |
---|
32 | var button=header.firstChild; |
---|
33 | if (button!='IMG'){ |
---|
34 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
35 | button=document.createElement('img'); |
---|
36 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
37 | } |
---|
38 | header.style.cursor='pointer'; |
---|
39 | header.onclick=changeDisplayState; |
---|
40 | header.id='dynheader'+sectionCounter; |
---|
41 | button.src='closed.gif'; |
---|
42 | section.id='dynsection'+sectionCounter; |
---|
43 | section.style.display='none'; |
---|
44 | section.style.marginLeft='14px'; |
---|
45 | sectionCounter++; |
---|
46 | } |
---|
47 | } |
---|
48 | } |
---|
49 | window.onload = initDynSections; |
---|
50 | --> |
---|
51 | </script> |
---|
52 | <div class="navigation" id="top"> |
---|
53 | <div class="tabs"> |
---|
54 | <ul> |
---|
55 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
56 | <li class="current"><a href="pages.html"><span>Related Pages</span></a></li> |
---|
57 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
58 | <li><a href="files.html"><span>Files</span></a></li> |
---|
59 | </ul> |
---|
60 | </div> |
---|
61 | <div class="navpath"><a class="el" href="dev_guide.html">Howto Use BDM in C++ for your needs</a> |
---|
62 | </div> |
---|
63 | </div> |
---|
64 | <div class="contents"> |
---|
65 | |
---|
66 | |
---|
67 | <h1><a class="anchor" id="intro">Introduction to Bayesian Decision Making Toolbox BDM </a></h1><p>This is a brief introduction into elements used in the BDM. The toolbox was designed for two principle tasks:</p> |
---|
68 | <ul> |
---|
69 | <li> |
---|
70 | Design of Bayesian decisions-making startegies, </li> |
---|
71 | <li> |
---|
72 | Bayesian system identification for on-line and off-line scenarios. </li> |
---|
73 | </ul> |
---|
74 | <p>Theoretically, the latter is a special case of the former, however we list it separately to highlight its importance in practical applications.</p> |
---|
75 | <p>Here, we describe basic objects that are required for implementation of the Bayesian parameter estimation.</p> |
---|
76 | <p>Key objects are: </p> |
---|
77 | <dl> |
---|
78 | <dt>Bayesian Model: class <code>BM</code> </dt> |
---|
79 | <dd>which is an encapsulation of the likelihood function, the prior and methodology of evaluation of the Bayes rule. This methodology may be either exact or approximate. </dd> |
---|
80 | <dt>Posterior density of the parameter: class <code>epdf</code> </dt> |
---|
81 | <dd>representing posterior density of the parameter. Methods defined on this class allow any manipulation of the posterior, such as moment evaluation, marginalization and conditioning. </dd> |
---|
82 | </dl> |
---|
83 | <h2><a class="anchor" id="bm"> |
---|
84 | Class BM</a></h2> |
---|
85 | <p>The class BM is designed for both on-line and off-line estimation. We make the following assumptions about data: </p> |
---|
86 | <ul> |
---|
87 | <li> |
---|
88 | an individual data record is stored in a vector, <code>vec</code> <code>dt</code>, </li> |
---|
89 | <li> |
---|
90 | a set of data records is stored in a matrix,<code>mat</code> <code>D</code>, where each column represent one individual data record </li> |
---|
91 | </ul> |
---|
92 | <p>On-line estimation is implemented by method </p> |
---|
93 | <div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> bayes(vec dt) |
---|
94 | </pre></div><p> Off-line estimation is implemented by method </p> |
---|
95 | <div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> bayesB(mat D) |
---|
96 | </pre></div><p>As an intermediate product, the bayes rule computes marginal likelihood of the data records <img class="formulaInl" alt="$ f(D) $" src="form_114.png"/>. Numerical value of this quantity which is important e.g. for model selection can be obtained by calling method <code>_ll()</code>.</p> |
---|
97 | <h2><a class="anchor" id="epdf"> |
---|
98 | Getting results from BM</a></h2> |
---|
99 | <p>Class <code>BM</code> offers several ways how to obtain results: </p> |
---|
100 | <ul> |
---|
101 | <li> |
---|
102 | generation of posterior or predictive pdfs, methods <code>_epdf()</code> and <code>predictor()</code> </li> |
---|
103 | <li> |
---|
104 | direct evaluation of predictive likelihood, method <code>logpred()</code> </li> |
---|
105 | </ul> |
---|
106 | <p>Underscore in the name of method <code>_epdf()</code> indicate that the method returns a pointer to the internal posterior density of the model. On the other hand, <code>predictor</code> creates a new structure of type <code>epdf()</code>.</p> |
---|
107 | <p>Direct evaluation of predictive pdfs via logpred offers a shortcut for more efficient implementation.</p> |
---|
108 | <h2><a class="anchor" id="epdf"> |
---|
109 | Getting results from BM</a></h2> |
---|
110 | <p>As introduced above, the results of parameter estimation are in the form of probability density function conditioned on numerical values. This type of information is represented by class <code>epdf</code>.</p> |
---|
111 | <p>This class allows such as moment evaluation via methods <code>mean()</code> and <code>variance()</code>, marginalization via method <code>marginal()</code>, and conditioning via method <code>condition()</code>.</p> |
---|
112 | <p>Also, it allows generation of a sample via <code>sample()</code> and evaluation of one value of the posterior parameter likelihood via <code>evallog()</code>. Multivariate versions of these operations are also available by adding suffix <code>_m</code>, i.e. <code>sample_m()</code> and <code>evallog_m()</code>. These methods providen multiple samples and evaluation of likelihood in multiple points respectively.</p> |
---|
113 | <h2><a class="anchor" id="pc"> |
---|
114 | Classes for probability calculus</a></h2> |
---|
115 | <p>When a more demanding task then generation of point estimate of the parameter is required, the power of general probability claculus can be used. The following classes (together with <code>epdf</code> introduced above) form the basis of the calculus: </p> |
---|
116 | <ul> |
---|
117 | <li> |
---|
118 | <code>mpdf</code> a pdf conditioned on another symbolic variable, </li> |
---|
119 | <li> |
---|
120 | <code>RV</code> a symbolic variable on which pdfs are defined. </li> |
---|
121 | </ul> |
---|
122 | <p>The former class is an extension of mpdf that allows conditioning on a symbolic variable. Hence, when numerical results - such as samples - are required, numericla values of the condition must be provided. The names of methods of the <code>epdf</code> are used extended by suffix <code>cond</code>, i.e. <code>samplecond()</code>, <code>evallogcond()</code>, where <code>cond</code> precedes matrix estension, i.e. <code>samplecond_m()</code> and <code>evallogcond_m()</code>.</p> |
---|
123 | <p>The latter class is used to identify how symbolic variables are to be combined together. For example, consider the task of composition of pdfs via the chain rule: </p> |
---|
124 | <p class="formulaDsp"> |
---|
125 | <img class="formulaDsp" alt="\[ f(a,b,c) = f(a|b,c) f(b) f(c) \]" src="form_115.png"/> |
---|
126 | </p> |
---|
127 | <p> In our setup, <img class="formulaInl" alt="$ f(a|b,c) $" src="form_116.png"/> is represented by an <code>mpdf</code> while <img class="formulaInl" alt="$ f(b) $" src="form_117.png"/> and <img class="formulaInl" alt="$ f(c) $" src="form_118.png"/> by two <code>epdfs</code>. We need to distinguish the latter two from each other and to deside in which order they should be added to the mpdf. This distinction is facilitated by the class <code>RV</code> which uniquely identify a random varibale.</p> |
---|
128 | <p>Therefore, each pdf keeps record on which RVs it represents; <code>epdf</code> needs to know only one <code>RV</code> stored in the attribute <code>rv</code>; <code>mpdf</code> needs to keep two <code>RVs</code>, one for variable on which it is defined (<code>rv</code>) and one for variable incondition which is stored in attribute <code>rvc</code>. </p> |
---|
129 | </div> |
---|
130 | <hr size="1"/><address style="text-align: right;"><small>Generated on Tue Sep 15 23:42:47 2009 for mixpp by |
---|
131 | <a href="http://www.doxygen.org/index.html"> |
---|
132 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> |
---|
133 | </body> |
---|
134 | </html> |
---|