Revision 871, 0.7 kB
(checked in by mido, 14 years ago)
|
adaptation of /applications to new version of LOG_LEVEL
also, a cosmetic change made in enumerations: logub -> logubound, loglb -> loglbound
|
Rev | Line | |
---|
[724] | 1 | % name random variables |
---|
| 2 | y = RV({'y'},1); |
---|
[744] | 3 | u1 = RV({'u1'},1); |
---|
| 4 | u2 = RV({'u2'},1); |
---|
[724] | 5 | |
---|
| 6 | % create f(y_t| y_{t-3}, u_{t-1}) |
---|
| 7 | fy.class = 'mlnorm<ldmat>'; |
---|
| 8 | fy.rv = y; |
---|
[744] | 9 | fy.rvc = RVtimes([y,u1,u2], [-3, 0, 0]); |
---|
| 10 | fy.A = [0.5, -0.9, 0.9]; |
---|
[724] | 11 | fy.const = 0; |
---|
| 12 | fy.R = 1e-2; |
---|
| 13 | |
---|
| 14 | DS.class = 'PdfDS'; |
---|
| 15 | DS.pdf = fy; |
---|
| 16 | |
---|
| 17 | % create ARX estimator |
---|
| 18 | A1.class = 'ARX'; |
---|
| 19 | A1.rv = y; |
---|
[744] | 20 | A1.rgr = RVtimes([y,u1,u2],[-3,0,0]) ; % correct structure is {y,y} |
---|
[871] | 21 | A1.log_level ='logbounds,logevidence'; |
---|
[724] | 22 | |
---|
| 23 | C1.class = 'LQG_ARX'; |
---|
| 24 | C1.ARX = A1; |
---|
[745] | 25 | C1.Qu = 1*eye(2); |
---|
[724] | 26 | C1.Qy = eye(1); |
---|
| 27 | C1.yreq = 1; |
---|
| 28 | C1.horizon = 100; |
---|
| 29 | |
---|
[745] | 30 | M= controlloop(DS,{C1}); |
---|
[744] | 31 | |
---|
[745] | 32 | |
---|
| 33 | %%%%%%%%%%%%%%%%%%%%% |
---|
| 34 | % PLOT |
---|
| 35 | |
---|
| 36 | figure; |
---|
| 37 | subplot(2,1,1); |
---|
| 38 | plot(M.DS_y); |
---|
| 39 | subplot(2,1,2); |
---|
| 40 | hold off |
---|
| 41 | plot(M.DS_u1); |
---|
| 42 | hold on |
---|
| 43 | plot(M.DS_u2); |
---|