Changeset 974 for applications
- Timestamp:
- 05/23/10 11:40:48 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/sandbox/mpf_arx_3.m
r971 r974 8 8 g.function = 'test_function'; 9 9 10 g.class = 'linfn';11 g.A = eye(2);12 g.B = [1;0];10 % g.class = 'linfn'; 11 % g.A = eye(2); 12 % g.B = [1;0]; 13 13 14 14 h.class = 'linfn'; … … 17 17 18 18 fx.class = 'mgnorm<chmat>'; 19 fx.R = [0. 3 -0.2; -0.2 0.5];19 fx.R = [0.03 -0.02; -0.02 0.05]; 20 20 fx.g = g; 21 21 fx.rv = x; … … 23 23 24 24 fy.class = 'mgnorm<chmat>'; 25 fy.R = 0. 1*eye(2);25 fy.R = 0.01*eye(2); 26 26 fy.g = h; 27 27 fy.rv = y; … … 39 39 A.class = 'ARX'; 40 40 A.yrv = RV('vw',4); 41 A.rv = RV('R',16); 41 42 A.rgr = RV({}); 42 43 A.dimx=4; 43 44 A.constant = 0; 44 A.frg=0.99; 45 A.frg=1.0; 46 A.prior.class='egiw'; 47 A.prior.dimx=4; 48 A.prior.V =1e-3*eye(4); 49 45 50 46 51 M.class = 'NoiseParticle'; 47 52 M.g = g; 48 53 M.h = h; 54 M.yrv = y; 49 55 M.rvx = x; 50 56 M.rvxc = RVtimes(x,-1); … … 54 60 PF.class='PF'; 55 61 PF.particle = M; 56 PF.n = 100 ;57 PF.res_threshold = 1.0;62 PF.n = 1000; 63 PF.res_threshold = 0.9; 58 64 PF.prior.class = 'enorm<ldmat>'; 59 65 PF.prior.mu = [0.2;0.3]; … … 61 67 62 68 63 exper.ndat = 200 0;69 exper.ndat = 200; 64 70 O = estimator(DS,{PF},exper); 65 71 %%%%%% ARX estimator conditioned on frg … … 69 75 figure(1); 70 76 hold off 71 plot(M.Est0_Q_Q); 72 hold on 73 plot(ones(size(M.Est0_Q_Q,1),1)* DS.pdf.pdfs{2}.R(:)','--'); 77 plot(O.Est0_apost_mean_R); 74 78 75 79 figure(2) 76 80 hold off 77 plot( M.Est0_apost_mean_);81 plot(O.Est0_apost_mean_x); 78 82 hold on 79 plot( M.DS_x,'--');83 plot(O.DS_dt_x,'--'); 80 84