Changeset 983

Show
Ignore:
Timestamp:
05/25/10 22:33:29 (14 years ago)
Author:
smidl
Message:

doc - extensions

Files:
2 added
7 modified

Legend:

Unmodified
Added
Removed
  • applications/bdmtoolbox/mex/mex_classes/mexDirac.m

    r944 r983  
    11classdef mexDirac < mexEpdf 
    22    % Dirac delta probability distribution 
    3     properties 
    4         point % point of the support 
     3    properties                                                 % DATA structures 
     4        point                                                  % point of the support 
    55    end 
    66    methods 
    7         function m=mean(obj) 
     7        function m=mean(obj)                                   % compute mean values of the density 
    88            m = obj.point; 
    99        end 
    10         function obj=validate(obj) 
     10        function obj=validate(obj)                             % check if data structures are consistent 
    1111            % point should be a column 
    1212            if (size(obj.point,2)>1) 
     
    1818            end 
    1919        end 
    20         function dim=dimension(obj) 
     20        function dim=dimension(obj)                            % inform others about your dimensions 
    2121            dim = size(obj.point,1); 
    2222        end 
    23         function v=variance(obj) 
     23        function v=variance(obj)                               % compute variance 
    2424            v=zeros(size(obj.point)); 
    2525        end 
    26         function l=evallog(obj,x) 
     26        function l=evallog(obj,x)                              % return logarithm of your density at point x 
    2727            if obj.point==x 
    2828                l = inf; 
     
    3131            end 
    3232        end 
    33         function s=sample(obj); 
     33        function s=sample(obj);                                % return random sample from your density 
    3434            s = obj.point; 
    3535        end 
  • applications/bdmtoolbox/mex/mex_classes/mexLaplaceBM.m

    r944 r983  
    33    % Maximum likelihood approximation of the Bayes rule is used, posterior is in the form of dirac. 
    44    properties 
    5         max_window_length = 10;   % max window length 
    6         data_window =[];          % estimate of mu is median of observations 
     5        max_window_length = 10;                               % max window length (default = 10) 
     6        data_window =[];                                      % sliding window of data  
    77    end 
    88    methods 
    9         function obj=validate(obj) 
    10             % prepare all internal objects for use 
     9        function obj=validate(obj)                            % prepare all internal objects for use 
    1110            obj.apost_pdf = mexDirac; 
    1211            obj.apost_pdf.point = [0;0]; 
    13             obj.log_evidence = 0; % evidence is not computed! 
     12            obj.log_evidence = 0;                             % evidence is not computed! 
    1413            disp('val'); 
    1514        end 
    1615 
    1716        function dims=dimensions(obj) 
    18             %please fill 
    19             %dims = [size_of_posterior size_of_data size_of_condition] 
    20             dims = [2,1,0] % we have: [2d parameters, 1d observations, 0d condition] 
     17            %please fill: dims = [size_of_posterior size_of_data size_of_condition] 
     18            dims = [2,1,0]                                    % we have: [2d parameters, 1d observations, 0d condition] 
    2119        end 
    22         function obj=bayes(obj,dt,cond) 
     20        function obj=bayes(obj,dt,cond)                       % approximate bayes rule 
    2321            if size(obj.data_window,2)>=obj.max_window_length 
    2422                obj.data_window = [dt obj.data_window(1:end-1)]; 
     
    2927            m_hat = mean(obj.data_window); 
    3028            b_hat = sum(abs(obj.data_window-m_hat))/ size(obj.data_window,2); 
    31             obj.apost_pdf.point = [m_hat; b_hat]; 
     29            obj.apost_pdf.point = [m_hat; b_hat];             % store result in psoterior pdf 
    3230        end 
    33         function p=epredictor(obj,cond) 
     31        function p=epredictor(obj,cond)                       % when predictive density is needed approximate it by Laplace with point estimates 
    3432            % return predictive density (max likelihood) 
    3533            p = mexLaplace; 
  • library/doc/tutorial/000install.dox

    r948 r983  
    66 
    77BDM comes in two basic versions: 
    8 \li \b binary   with precompiled executables and matlab mex files that can be configured by external text files 
    9 \li \b source \b code  that can be compiled into any required form.  
     8 - \b binary   with precompiled executables and matlab mex files that can be configured by external text files 
     9 - \b source \b code  that can be compiled into any required form.  
    1010 
    1111\section in_bin Binaries for BDMtoolbox 
     
    1313 
    1414Installation: 
    15 \li svn checkout http://mys.utia.cas.cz:1800/svn/mixpp/applications/bdmtoolbox/ into your local directory of your choice (this will be denoted \<toolbox_dir\>) 
    16 \li or download a prepared zip file from http://staff.utia.cas.cz/smidl/Public/bdmtoolbox_win32.zip and extract it to any directory (will be denoted \<toolbox_dir\>) 
    17 \li open matlab and type: 
     15 - svn checkout http://mys.utia.cas.cz:1800/svn/mixpp/applications/bdmtoolbox/ into your local directory of your choice (this will be denoted \<toolbox_dir\>) 
     16 - or download a prepared zip file from http://staff.utia.cas.cz/smidl/Public/bdmtoolbox_win32.zip and extract it to any directory (will be denoted \<toolbox_dir\>) 
     17 - open matlab and type: 
    1818\code  
    1919>> addpath <toolbox_dir>/mex;  
     
    2929\endcode 
    3030For linux, the default build dir is \<toolbox_dir\>/mex, hence only me and mex_classes need to be in the path. 
    31 \li the toolbox is ready to be used, test it e.g. by:  
     31 - the toolbox is ready to be used, test it e.g. by:  
    3232\code >> cd tutorial/userguide;  
    3333>> pdfds_example \endcode 
    34 \li if no error is given, the toolbox is installed correctly 
    35 \li proceed to tutorial at http://mys.utia.cas.cz:1800/trac/bdm/doxygen/pages.html to learn how to use it 
     34 - if no error is given, the toolbox is installed correctly 
     35 - proceed to tutorial at http://mys.utia.cas.cz:1800/trac/bdm/doxygen/pages.html to learn how to use it 
    3636 
    3737\section src Source code 
     
    4747 
    4848You need to have the following tools available on your system: 
    49 \li working C++ compiler, e.g. gcc on Linux, or Visual Studio on windows 
    50 \li CMake, a cross-platform build system, http://www.cmake.org 
     49 - working C++ compiler, e.g. gcc on Linux, or Visual Studio on windows 
     50 - CMake, a cross-platform build system, http://www.cmake.org 
    5151  
    5252\section lin Linux 
     
    8989Compilation of BDM: 
    9090 
    91  * When everything is set-up, make a copy of library\system\win32\run_cmake.bat, edit it  
     91 - When everything is set-up, make a copy of library\system\win32\run_cmake.bat, edit it  
    9292  to reflect your environment (i.e. change paths to cmake and your C++ target environment)  
    9393  and run it. 
    9494 
    95  * Alternatively, you can run CMake GUI and specify address to your \<bdm_dir\> 
     95 - Alternatively, you can run CMake GUI and specify address to your \<bdm_dir\> 
    9696 
    9797 
    98  * It should generate build files for your compiler in the main BDM  
     98 - It should generate build files for your compiler in the main BDM  
    9999  directory 
    100100 
     
    108108 
    109109Right now, Cmake configuration is hard-coded for one testing machine. Look for the paths in SetBDMEnv.cmake and correct them. 
    110 Open CMake GUI, clisk Configure followed by Create. 
     110Open CMake GUI, click Configure followed by Create. 
    111111Configuration files for your favourite build environment should be created in the BDM directory. 
    112112 
  • library/doc/tutorial/005userguide0.dox

    r944 r983  
    4141 - \ref userguide_pdf 
    4242 - \ref userguide_sim 
    43 - \ref userguide_estim 
     43 - \ref userguide_estim 
    4444 
    4545*/ 
  • library/doc/tutorial/01userguide_sim.dox

    r948 r983  
    7070 -# return data observed at time \f$ t \f$,  
    7171 -# perform one a time step. 
    72  -# describe what these data are, via class RV, introduced in ref \ug_pdf_marg, 
     72 -# describe what these data are, via class RV, introduced in ref \ref ug_pdf_marg, 
    7373 -# store log of its activity into dedicated logger. 
    7474 
  • library/doc/tutorial/02userguide_estim.dox

    r948 r983  
    2828\li Result Logger is an object (class logger) dedicated to storing important data from the experiment. 
    2929 
    30 Since objects  datasource and the logger has already been introduced in section \ref userguide, it remains to introduce  
     30Since objects  datasource and the logger has already been introduced in section \ref userguide_sim, it remains to introduce  
    3131object \c Bayesian \c Model (bdm::BM). 
    3232 
     
    6262 - logbounds - store also lower and upper bounds on estimates (obtained by calling BM::posterior().qbounds()), 
    6363 - logevidence - store also evidence of each step of the Bayes rule. 
    64 These values are stored in given logger (\ref ug_loggers). By default, only mean values of the estimate are stored. 
     64These values are stored in given logger (\ref ug_store). By default, only mean values of the estimate are stored. 
    6565 
    6666Storing of the evidence is useful, e.g. in model selection task when two models are compared. 
     
    179179Similarly to the extension of pdf, the estimators (or filters) can be extended via prepared class \c mexBM in directory bdmtoolbox/mex/mex_classes. 
    180180 
    181 An example of such class is mexLaplaceBM in \<toolbox_dir\>\tutorial\userguide\laplace_example.m 
     181An example of such class is mexLaplaceBM in \<toolbox_dir\>/tutorial/userguide/laplace_example.m 
    182182 
    183183Note that matlab-extended classes of mexEpdf, specifically, mexDirac and mexLaplace are used as outputs of methods posterior and epredictor, respectively. 
  • library/doc/tutorial/030userguide3.dox

    r948 r983  
    22\page userguide_ctrl BDM Use - Control and Design of Decision Making Strategy 
    33 
    4 Bayesian estimation as introduced in Section \ref userguide2 is a special case of Decision Strategy, see. .... 
     4Bayesian estimation as introduced in Section \ref userguide_estim is a special case of Decision Strategy, see. .... 
    55A more demanding scenario is to design a control strategy that will influence the system operating under uncertainty, this is implemented as scenario \c closedloop. 
    66