Changeset 1190 for library/tests
- Timestamp:
- 09/17/10 11:47:39 (14 years ago)
- Location:
- library/tests/stresssuite
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/stresssuite/kalman_stress.cpp
r1158 r1190 103 103 vec dt; 104 104 tt.tic(); 105 vec mu=mu0; 106 mat iRy; 107 mat Ry; 108 mat P=P0; 109 mat K; 110 vec ut; 111 vec yt; 105 112 for ( int t = 1; t < Ndat; t++ ) { 106 113 dt = Dt.get_col ( t ); 107 KFu.bayes ( dt.get ( 0, C.rows() - 1 ), dt.get ( C.rows(), dt.length() - 1 ) ); 108 Xtu.set_col ( t, KFuep.mean() ); 114 yt= dt.get ( 0, C.rows() - 1 ); 115 ut = dt.get ( C.rows(), dt.length() - 1 ) ; 116 117 mu = A*mu + B*ut; 118 P = A*P*A.T() + Q; 119 120 //Data update 121 Ry = C*P*C.T() + R; 122 iRy = inv(Ry); 123 K = P*C.T()*iRy; 124 P = P- K*C*P; // P = P -KCP; 125 mu = mu + K*(yt-C*mu-D*ut); 126 Xtu.set_col ( t, KFuep.mean() ); 109 127 } 110 128 exec_times ( 0 ) = tt.toc(); -
library/tests/stresssuite/kalman_stress.m
r1158 r1190 74 74 plot(x'); 75 75 hold on 76 plot([ xth]','--'); % shift the predldmatictions76 plot([Mu]','--'); % shift the predldmatictions 77 77 plot(xth2','+'); 78 78 plot(xthE','o'); … … 81 81 exec_times 82 82 exec_matlab./exec_times 83 keyboard83 %keyboard 84 84 end