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

Revision 968, 0.7 kB (checked in by smidl, 14 years ago)

New mexes + corrected tutorial

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