Changeset 271 for doc/latex/intro.tex

Show
Ignore:
Timestamp:
02/16/09 10:03:13 (15 years ago)
Author:
smidl
Message:

Next major revision

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • doc/latex/intro.tex

    r210 r271  
    1 This is a brief introduction into elements used in the BDM. The toolbox was designed for two principle tasks: 
    2  
    3 \begin{itemize} 
    4 \item Design of Bayesian decisions-making startegies,  \item Bayesian system identification for on-line and off-line scenarios.  \end{itemize} 
    5 Theoretically, the latter is a special case of the former, however we list it separately to highlight its importance in practical applications. 
    6  
    7 In order to achieve these principal goals in full generality, we need to implement full range of probabilistic operations such as: marginalization, conditioning, Bayes rule, combination of probability densities. Furthermore, many supportive operations are also required, such as data handling and logging of results. Here, we explain the basic classes for each task and point to advanced topics on the issue.\hypertarget{intro_phil}{}\section{Philosophy of the Toolbox}\label{intro_phil} 
    8 The primary obstacle for creation of any any Bayesian software is how to address inherent computational intractability of the calculus. Typically, toolboxes implementing Bayesian calculus choose one particular task or one particular approximation methodology. For example, \char`\"{}BUGS\char`\"{} is a toolbox focused on evaluation using Gibbs sampling, \char`\"{}BNT\char`\"{} is focused on Bayesian Networks, \char`\"{}NFT\char`\"{} on Bayesian filtering. BDM takes another approach: {\bf  all tasks are defined via their functional form, detailed implementation is an internal matter of each class.} 
    9  
    10 This philosophy results in a tree structure of inheritance, where the root is an abstract class. Different approaches to Bayesian calculus are implemented as specialization of this class. Interoperability of these classes is achieved by data classes, representing mathematical objects arising in the Bayesian calculus. 
    11  
    12 The task of Bayesian estimation decribed in the next Section is a good illustration of the philosophy.\hypertarget{intro_bayes}{}\section{Bayesian parameter estimation}\label{intro_bayes} 
    13 Bayesian parameter estimation is, in essence, straightforward application of the Bayes rule:\[ f(\theta|D) =\frac{f(D|\theta)f(\theta)}{f(D)}\] where, $ \theta $ is an unknown parameter, $ D $ denotes the observed data, $ f(D|\theta) $ is the likelihood function, $ f(\theta) $ is the prior density, and $ f(D) $ is \char`\"{}evidence\char`\"{} of the data. 
    14  
    15 This simple rule has, however, many incarnations for various types of the likelihood, prior and evidence. For example, the Bayes rule can be evaluated exactly for likelihood function from the Exponential Family and conjugate prior, where the whole functional operation reduces to algebraic operation on sufficient statistics. For other likelihood functions and priors, various approximate schemes (such as Monte Carlo sampling, or maximum-likelihood optimizations) were proposed. To capture all of these options, we abstract the core functionality in the class {\tt \hyperlink{classBM}{BM}:}  
    16  
    17 \begin{description} 
    18 \end{description} 
    19 \hyperlink{classBM}{BM}, abstract class defining two key methods: \begin{itemize} 
    20 \item  
    21  
    22 \begin{Code}\begin{verbatim} void bayes(vec dt)  
    23 \end{verbatim} 
    24 \end{Code} 
    25  
    26  or  
    27  
    28 \begin{Code}\begin{verbatim} void bayesB(mat D)  
    29 \end{verbatim} 
    30 \end{Code} 
    31  
    32   \item  
    33  
    34 \begin{Code}\begin{verbatim} epdf& _epdf().  
    35 \end{verbatim} 
    36 \end{Code} 
    37  
    38   \end{itemize} 
    39  
    40  
    41 Hence, the class represent an \char`\"{}estimator\char`\"{} that is capable of returning a posterior density (via method {\tt \_\-epdf} ) and application of the Bayes rule vis method {\tt bayes} . 
    42  
    43 Functions {\tt bayes} and {\tt bayesB} denotes on-line and off-line scenario, respectively. Function {\tt bayes} assumes that \begin{Desc} 
    44 \item[Parameters:] 
    45 \begin{description} 
    46 \item[{\em dt}]is an incremental data record and applies the Bayes rule using posterior density for the previous step as a prior. On the other hand, {\tt bayesB} assumes that \item[{\em D}]is the full data record, and uses the original prior created during construction of the object.\end{description} 
    47 \end{Desc} 
    48 Posterior density is represented by a class {\tt \hyperlink{classepdf}{epdf}} . When we are interested only in part of the posterior density we can apply probability calculus via methods of this class.\hypertarget{intro_calc}{}\section{Probability calculus}\label{intro_calc} 
    49 Key objects of probability calculus are probability density functions, pdfs. We distinguish two types of pdfs: \begin{description} 
    50 \end{description} 
    51 \hyperlink{classepdf}{epdf}, a pdf fully defined by statistics: $ f(a | S)$, with numerical statics $ S $, and   \hyperlink{classmpdf}{mpdf}, a pdf conditioned on another random variable: $ f(a| b) $, where $ b $ is a variable.  
    52  
    53 The principal distinction between these types is that operations defined on these classes have different results. For example, the first moment of the former is a numeric value, while for the latter it is a functional form. 
    54  
    55 The most important operations on pdfs are: \begin{description} 
    56 \end{description} 
    57 evaluation in a point: implemented by methods  
    58  
    59 \begin{Code}\begin{verbatim} double evallog(vec dt) 
    60 \end{verbatim} 
    61 \end{Code} 
    62  
    63  for {\tt \hyperlink{classepdf}{epdf}} and  
    64  
    65 \begin{Code}\begin{verbatim} double evallogcond() 
    66 \end{verbatim} 
    67 \end{Code} 
    68  
    69  for {\tt \hyperlink{classmpdf}{mpdf}}.   marginalization: implemented by method  
    70  
    71 \begin{Code}\begin{verbatim} epdf* marginal(RV rv) 
    72 \end{verbatim} 
    73 \end{Code} 
    74  
    75  for \hyperlink{classepdf}{epdf},   conditioning: implemented by method  
    76  
    77 \begin{Code}\begin{verbatim} mpdf* conditional(RV rv) 
    78 \end{verbatim} 
    79 \end{Code} 
    80  
    81  for \hyperlink{classepdf}{epdf}.   
    82  
    83 Note that a new data class, {\tt \hyperlink{classRV}{RV}}, is introduced. This class represents description of a multivariate random variable.\hypertarget{intro_RVs}{}\section{Random Variables}\label{intro_RVs} 
    84 In mathematics, variable is a symbol of quantity that has no assigned value. Its purpose is to distinguish one variable from another. Hence, in software representation it has a meaning of unique identifier. Since we allow multivariate random variables, the variable also carries its dimensionality. Moreover, for dealing with time-varying estimation it also makes sense to distinguish different time-shift of variables. 
    85  
    86 The main purpose of this class is to mediate composition and decomposition of pdfs. See,...