|
Revision 979, 0.8 kB
(checked in by smidl, 15 years ago)
|
|
estimator returns the array of posterior estimators as second argument
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | % load data created by the MpdfDS_example |
|---|
| 2 | clear all |
|---|
| 3 | load pdfds_results |
|---|
| 4 | |
|---|
| 5 | DS.class = 'MemDS'; |
|---|
| 6 | DS.Data = Data; |
|---|
| 7 | DS.drv = drv; |
|---|
| 8 | |
|---|
| 9 | %%%%%% ARX estimator |
|---|
| 10 | |
|---|
| 11 | A1.class = 'ARX'; |
|---|
| 12 | A1.yrv = y; |
|---|
| 13 | A1.rv = RV({'theta','r'},[3,1]); |
|---|
| 14 | A1.rgr = RVtimes([y,u],[-3,-1]) ; % correct structure is {y,y} |
|---|
| 15 | A1.log_level = 'logbounds,logevidence'; |
|---|
| 16 | |
|---|
| 17 | [M,Apost]=estimator(DS,{A1}); |
|---|
| 18 | |
|---|
| 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 20 | % plot results |
|---|
| 21 | ndat = size(M.DS_dt_u,1); |
|---|
| 22 | |
|---|
| 23 | subplot(1,2,1); |
|---|
| 24 | hold off |
|---|
| 25 | plotestimates(true_theta, ... |
|---|
| 26 | M.Est0_apost_mean_theta, ... |
|---|
| 27 | M.Est0_apost_lbound_theta, ... |
|---|
| 28 | M.Est0_apost_ubound_theta); |
|---|
| 29 | set(gca,'YLim',[-1.5,1]); |
|---|
| 30 | |
|---|
| 31 | subplot(1,2,2); |
|---|
| 32 | hold off |
|---|
| 33 | plotestimates(true_R, ... |
|---|
| 34 | M.Est0_apost_mean_r, ... |
|---|
| 35 | M.Est0_apost_lbound_r, ... |
|---|
| 36 | M.Est0_apost_ubound_r); |
|---|
| 37 | |
|---|
| 38 | title('Variance parameters r') |
|---|