root/applications/bdmtoolbox/tutorial/userguide/arx_basic_example.m @ 979

Revision 979, 0.8 kB (checked in by smidl, 14 years ago)

estimator returns the array of posterior estimators as second argument

  • Property svn:eol-style set to native
RevLine 
[630]1% load data created by the MpdfDS_example
[934]2clear all
[700]3load pdfds_results
[630]4
5DS.class   = 'MemDS';
6DS.Data    = Data;
7DS.drv     = drv;
8
9%%%%%% ARX estimator
10
11A1.class = 'ARX';
[964]12A1.yrv = y;
[968]13A1.rv = RV({'theta','r'},[3,1]);
[630]14A1.rgr = RVtimes([y,u],[-3,-1]) ; % correct structure is {y,y}
[871]15A1.log_level = 'logbounds,logevidence';
[630]16
[979]17[M,Apost]=estimator(DS,{A1});
[630]18
19%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20% plot results
[933]21ndat = size(M.DS_dt_u,1);
[630]22
23subplot(1,2,1);
24hold off
[700]25plotestimates(true_theta, ...
26    M.Est0_apost_mean_theta, ...
[933]27    M.Est0_apost_lbound_theta, ...
28    M.Est0_apost_ubound_theta);
[630]29set(gca,'YLim',[-1.5,1]);
30
31subplot(1,2,2);
32hold off
[700]33plotestimates(true_R, ...
34    M.Est0_apost_mean_r, ...
[933]35    M.Est0_apost_lbound_r, ...
36    M.Est0_apost_ubound_r);
[700]37
[630]38title('Variance parameters r')
Note: See TracBrowser for help on using the browser.