1 | % load data created by the MpdfDS_example |
---|
2 | load mpdfds_results |
---|
3 | |
---|
4 | DS.class = 'MemDS'; |
---|
5 | DS.Data = Data; |
---|
6 | DS.drv = drv; |
---|
7 | |
---|
8 | %%%%%% ARX estimator |
---|
9 | |
---|
10 | A1.class = 'ARX'; |
---|
11 | A1.rv = y; |
---|
12 | A1.rgr = RVtimes([y,u],[-3,-1]) ; % correct structure is {y,y} |
---|
13 | A1.options ='logbounds,logll'; |
---|
14 | |
---|
15 | M=estimator(DS,{A1}); |
---|
16 | |
---|
17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
18 | % plot results |
---|
19 | ndat = size(M.u,1); |
---|
20 | |
---|
21 | subplot(1,2,1); |
---|
22 | hold off |
---|
23 | plot((true_theta' *ones(1,ndat))','-.'); |
---|
24 | title(' Regression parameters \theta') |
---|
25 | hold on |
---|
26 | plot(M.mean_theta(1:ndat,:)); |
---|
27 | co = get(gca,'ColorOrder'); |
---|
28 | for i=1:size(M.mean_theta,2) |
---|
29 | ind =1:10:ndat; |
---|
30 | h=errorbar(ind,M.mean_theta(ind,i),... |
---|
31 | M.mean_theta(ind,i)-M.lb_theta(ind,i),M.mean_theta(ind,i)-M.ub_theta(ind,i),'.'); |
---|
32 | set(h,'color',co(i,:)); |
---|
33 | end |
---|
34 | |
---|
35 | set(gca,'YLim',[-1.5,1]); |
---|
36 | |
---|
37 | subplot(1,2,2); |
---|
38 | hold off |
---|
39 | plot(true_R*ones(1,ndat),'-.'); |
---|
40 | title('Variance parameters r') |
---|
41 | hold on |
---|
42 | plot(M.mean_r(1:ndat,:)); |
---|
43 | co = get(gca,'ColorOrder'); |
---|
44 | ind =1:10:ndat; |
---|
45 | for i=1:size(M.mean_r, 2) |
---|
46 | h=errorbar(ind,M.mean_r(ind,i),... |
---|
47 | M.mean_r(ind,i)-M.lb_r(ind,i),M.mean_r(ind,i)-M.ub_r(ind,i),'.'); |
---|
48 | set(h,'color',co(i,:)); |
---|
49 | end |
---|