root/applications/bdmtoolbox/tutorial/userguide/prodbm_example.m @ 1392

Revision 1034, 1.0 kB (checked in by smidl, 14 years ago)

examples: partial forgetting + prodbm

Line 
1% load data created by the MpdfDS_example
2clear all
3load pdfds_results
4
5DS.class   = 'MemDS';
6DS.Data    = Data;
7DS.drv     = drv;
8
9%%%%%% ARX estimator
10
11A1.class = 'ARX';
12A1.yrv = y;
13A1.rv = RV({'theta','r'},[3,1]);
14A1.rgr = RVtimes([y,u],[-3,-1]) ; % correct structure is {y,y}
15A1.log_level = 'logbounds,logevidence';
16
17A2.class = 'ARX';
18A2.yrv = u;
19%A2.rv = RV({'theta','r'},[3,1]);
20A2.rgr = RVtimes([y,u],[-3,-1]) ; % correct structure is {y,y}
21A2.log_level = 'logbounds,logevidence';
22
23P.class='ProdBM';
24P.BMs={A1,A2};
25P.log_level = 'logbounds';
26
27[M,Apost]=estimator(DS,{P});
28
29%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30% plot results
31ndat = size(M.DS_dt_u,1);
32
33subplot(1,2,1);
34hold off
35plotestimates(true_theta, ...
36    M.Est0_apost_mean_theta, ...
37    M.Est0_apost_lbound_theta, ...
38    M.Est0_apost_ubound_theta);
39set(gca,'YLim',[-1.5,1]);
40
41subplot(1,2,2);
42hold off
43plotestimates(true_R, ...
44    M.Est0_apost_mean_r, ...
45    M.Est0_apost_lbound_r, ...
46    M.Est0_apost_ubound_r);
47
48title('Variance parameters r')
Note: See TracBrowser for help on using the browser.