root/applications/bdmtoolbox/tutorial/userguide/pdfds_example.m @ 944

Revision 944, 0.9 kB (checked in by smidl, 14 years ago)

Doc + new examples

  • Property svn:eol-style set to native
RevLine 
[934]1clear all
[615]2% name random variables
[944]3x = RV({'x'},2);
[615]4
5
[944]6fx.class  = 'mgnorm<ldmat>';             
7fx.rv     = x;             
8fx.rvc    = RVtimes(x,-1);             
9fx.g      = 'mexFunction';              % function is evaluated in matlab
10fx.g.function = 'test_function';         % name of the matlab function to evaluate
11fx.g.dim  = 2;                          % expected dimension of output
12fx.g.dimc = 2;                          % expected dimension of input
13fx.R      = eye(2);                     % variance R
[615]14
[944]15
[615]16% create DS
[701]17DS.class = 'PdfDS';
18DS.pdf.class  = 'mprod';
[944]19DS.pdf.pdfs  = {fx, fu};
20DS.init_rv = RVtimes([x], [-1]);
21DS.init_values = [0.1, 0.2];
[615]22
23experiment.ndat=100;
24
[940]25M=simulator(DS,experiment);
[617]26%M=estimator(DS,{},experiment);
[630]27
28%%% store results
[934]29Data=[M.DS_dt_y'; M.DS_dt_u'];
[631]30drv = RVjoin([y,u]);
31true_theta=[fy.A fy.const];
32true_R=[fy.R];
[701]33save pdfds_results Data drv y u true_theta true_R
Note: See TracBrowser for help on using the browser.