root/applications/bdmtoolbox/doc/local/035userguide_merging.dox @ 1461

Revision 1092, 2.4 kB (checked in by smidl, 14 years ago)

doc

Line 
1/*!
2\page userguide_merg BDM Use - Merging of probability distributions
3
4Merging is an operation which combines information from many \c source pdfs into one, the \c merger.
5
6The very basic merger requires that the sources are defined on the same variables.
7
8\section ug_mer_mat Matlab class mexMerger
9
10All mergers in Matlab are derived from a class mexMerger which has only the list of \c sources, their \c weights, the resulting pdf, the \c merger, and operations merge() and validate().
11
12\code
13classdef mexMerger
14    properties
15        %> weights of the merged densities
16        weights
17        %> source pdfs to be merged
18            sources
19        %> merged density - any pdf understood by epdf_* functions
20        merger
21    end
22
23    methods
24        function obj=validate(obj)
25            % e.g. check if all sources are compatible
26        end
27        %> Merge sources into the merger
28        function obj=merge(obj)
29            % transform old estimate into new estimate
30        end
31     end
32  end
33\endcode
34Validate has the same meaning as in previous chapters, i.e. it is called before any use of the class to check that all elements has been set-up correctly.
35
36Except form that, only few technical functions are needed for integration with C++ classes in BDM, see mexMerger.
37
38mexMErger is an abstract class, which has no operation defined. In order to achieve some functionality an offspring need to be defined.
39An example of one possible offspring is in class mexGaussMergerArit which implements Arithmetic merging of source pdfs which are converted into Gaussians using moment matching.
40
41The offspring only redefines methods validate and merge.
42
43An example how to use this class is in bdmtoolbox/tutorial/merging/merge_mex.m
44\code
45clear all
46pdfs
47
48% merger
49M=mexGaussMergerArit;
50M.weights = [0.5, 0.5];
51M.sources = {N1a,Ga};
52M=M.validate();
53
54M=M.merge();
55
56figure(1);
57h=epdf_1dplot(N1a);
58set(h,'LineStyle','--');
59hold on
60h=epdf_1dplot(Ga);
61set(h,'LineStyle','--');
62
63
64epdf_1dplot(M.merger);
65\endcode
66
67
68For list of all Matlab mergers, see <a href="annotated.html"> list </a>.
69
70\section ug_mer_c Mergers from BDM
71
72More advanced mergers allowing to merge pdfs on partially overlapping variables are available in BDM, specifically, classes bdm::MergerBase and bdm::merger_mix.
73
74Their use is demonstrated in examples: bdmtoolbox/tutorial/merging/merge_grid.m and merge_mix.m, respectively.
75*/
Note: See TracBrowser for help on using the browser.