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

Revision 940, 0.7 kB (checked in by suzdalev, 15 years ago)

simulator

  • Property svn:eol-style set to native
RevLine 
[934]1clear all
[615]2% name random variables
[630]3y = RV({'y'},1);
4u = RV({'u'},1);
[615]5
6% create f(y_t| y_{t-3}, u_{t-1})
7fy.class = 'mlnorm<ldmat>';
8fy.rv    = y;
[630]9fy.rvc   = RVtimes([y,u], [-3, -1]);
[615]10fy.A     = [0.5, -0.9];
11fy.const = 0;
[701]12fy.R     = 1e-2;
[615]13
14% create f(u_t| )
15fu.class = 'enorm<ldmat>';
16fu.rv    = u;
17fu.mu    = 0;
[630]18fu.R     = 1e-1;
[615]19
20% create DS
[701]21DS.class = 'PdfDS';
22DS.pdf.class  = 'mprod';
23DS.pdf.pdfs  = {fy, fu};
[630]24DS.init_rv = RVtimes([y,y,y], [-1,-2,-3]);
[615]25DS.init_values = [0.1, 0.2, 0.3];
26
27experiment.ndat=100;
28
[940]29M=simulator(DS,experiment);
[617]30%M=estimator(DS,{},experiment);
[630]31
32%%% store results
[934]33Data=[M.DS_dt_y'; M.DS_dt_u'];
[631]34drv = RVjoin([y,u]);
35true_theta=[fy.A fy.const];
36true_R=[fy.R];
[701]37save pdfds_results Data drv y u true_theta true_R
Note: See TracBrowser for help on using the browser.