[210] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 3 | <title>mixpp: Introduction to Bayesian Decision Making Toolbox BDM</title> |
---|
[290] | 4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
[210] | 5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
| 6 | </head><body> |
---|
[398] | 7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
[271] | 8 | <script type="text/javascript"> |
---|
| 9 | <!-- |
---|
| 10 | function changeDisplayState (e){ |
---|
| 11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
| 12 | var button=this.firstChild; |
---|
| 13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
| 14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
| 15 | sectionDiv.style.display='block'; |
---|
| 16 | button.src='open.gif'; |
---|
| 17 | }else{ |
---|
| 18 | sectionDiv.style.display='none'; |
---|
| 19 | button.src='closed.gif'; |
---|
| 20 | } |
---|
| 21 | } |
---|
| 22 | function initDynSections(){ |
---|
| 23 | var divs=document.getElementsByTagName('div'); |
---|
| 24 | var sectionCounter=1; |
---|
| 25 | for(var i=0;i<divs.length-1;i++){ |
---|
| 26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
| 27 | var header=divs[i]; |
---|
| 28 | var section=divs[i+1]; |
---|
| 29 | var button=header.firstChild; |
---|
| 30 | if (button!='IMG'){ |
---|
| 31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
| 32 | button=document.createElement('img'); |
---|
| 33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
| 34 | } |
---|
| 35 | header.style.cursor='pointer'; |
---|
| 36 | header.onclick=changeDisplayState; |
---|
| 37 | header.id='dynheader'+sectionCounter; |
---|
| 38 | button.src='closed.gif'; |
---|
| 39 | section.id='dynsection'+sectionCounter; |
---|
| 40 | section.style.display='none'; |
---|
| 41 | section.style.marginLeft='14px'; |
---|
| 42 | sectionCounter++; |
---|
| 43 | } |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | window.onload = initDynSections; |
---|
| 47 | --> |
---|
| 48 | </script> |
---|
[210] | 49 | <div class="navigation" id="top"> |
---|
| 50 | <div class="tabs"> |
---|
| 51 | <ul> |
---|
[271] | 52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
[290] | 53 | <li class="current"><a href="pages.html"><span>Related Pages</span></a></li> |
---|
[271] | 54 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
[290] | 55 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
[210] | 56 | <li><a href="files.html"><span>Files</span></a></li> |
---|
| 57 | </ul> |
---|
| 58 | </div> |
---|
[271] | 59 | <div class="navpath"><a class="el" href="manual.html">User Manual</a> |
---|
| 60 | </div> |
---|
[210] | 61 | </div> |
---|
| 62 | <div class="contents"> |
---|
| 63 | <h1><a class="anchor" name="intro">Introduction to Bayesian Decision Making Toolbox BDM </a></h1>This is a brief introduction into elements used in the BDM. The toolbox was designed for two principle tasks:<p> |
---|
| 64 | <ul> |
---|
| 65 | <li> |
---|
| 66 | Design of Bayesian decisions-making startegies, </li> |
---|
| 67 | <li> |
---|
| 68 | Bayesian system identification for on-line and off-line scenarios. </li> |
---|
| 69 | </ul> |
---|
| 70 | Theoretically, the latter is a special case of the former, however we list it separately to highlight its importance in practical applications.<p> |
---|
[271] | 71 | Here, we describe basic objects that are required for implementation of the Bayesian parameter estimation.<p> |
---|
| 72 | Key objects are: <dl> |
---|
| 73 | <dt>Bayesian Model: class <code>BM</code> </dt> |
---|
| 74 | <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> |
---|
| 75 | <dt>Posterior density of the parameter: class <code>epdf</code> </dt> |
---|
| 76 | <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> |
---|
[210] | 77 | </dl> |
---|
[271] | 78 | <h2><a class="anchor" name="bm"> |
---|
| 79 | Class BM</a></h2> |
---|
| 80 | The class BM is designed for both on-line and off-line estimation. We make the following assumptions about data: <ul> |
---|
[210] | 81 | <li> |
---|
[271] | 82 | an individual data record is stored in a vector, <code>vec</code> <code>dt</code>, </li> |
---|
[210] | 83 | <li> |
---|
[271] | 84 | 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> |
---|
[210] | 85 | </ul> |
---|
| 86 | <p> |
---|
[271] | 87 | On-line estimation is implemented by method <div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> bayes(vec dt) |
---|
| 88 | </pre></div> Off-line estimation is implemented by method <div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> bayesB(mat D) |
---|
| 89 | </pre></div><p> |
---|
[397] | 90 | As an intermediate product, the bayes rule computes marginal likelihood of the data records <img class="formulaInl" alt="$ f(D) $" src="form_103.png">. Numerical value of this quantity which is important e.g. for model selection can be obtained by calling method <code>_ll()</code>.<h2><a class="anchor" name="epdf"> |
---|
[271] | 91 | Getting results from BM</a></h2> |
---|
| 92 | Class <code>BM</code> offers several ways how to obtain results: <ul> |
---|
| 93 | <li> |
---|
| 94 | generation of posterior or predictive pdfs, methods <code>_epdf()</code> and <code>predictor()</code> </li> |
---|
| 95 | <li> |
---|
| 96 | direct evaluation of predictive likelihood, method <code>logpred()</code> </li> |
---|
| 97 | </ul> |
---|
| 98 | 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> |
---|
| 99 | Direct evaluation of predictive pdfs via logpred offers a shortcut for more efficient implementation.<h2><a class="anchor" name="epdf"> |
---|
| 100 | Getting results from BM</a></h2> |
---|
| 101 | 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> |
---|
[354] | 102 | 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> |
---|
[271] | 103 | 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.<h2><a class="anchor" name="pc"> |
---|
| 104 | Classes for probability calculus</a></h2> |
---|
| 105 | 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: <ul> |
---|
| 106 | <li> |
---|
| 107 | <code>mpdf</code> a pdf conditioned on another symbolic variable, </li> |
---|
| 108 | <li> |
---|
| 109 | <code>RV</code> a symbolic variable on which pdfs are defined. </li> |
---|
| 110 | </ul> |
---|
| 111 | 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> |
---|
| 112 | 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 class="formulaDsp"> |
---|
[397] | 113 | <img class="formulaDsp" alt="\[ f(a,b,c) = f(a|b,c) f(b) f(c) \]" src="form_104.png"> |
---|
[271] | 114 | <p> |
---|
[397] | 115 | In our setup, <img class="formulaInl" alt="$ f(a|b,c) $" src="form_105.png"> is represented by an <code>mpdf</code> while <img class="formulaInl" alt="$ f(b) $" src="form_106.png"> and <img class="formulaInl" alt="$ f(c) $" src="form_107.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> |
---|
[271] | 116 | 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>. </div> |
---|
[398] | 117 | <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 24 21:53:05 2009 for mixpp by |
---|
[210] | 118 | <a href="http://www.doxygen.org/index.html"> |
---|
[398] | 119 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
[210] | 120 | </body> |
---|
| 121 | </html> |
---|