smooth_update.m
上传用户:mozhenmi
上传日期:2008-02-18
资源大小:13k
文件大小:1k
源码类别:

其他小程序

开发平台:

Matlab

  1. function [xsmooth, Vsmooth, VVsmooth_future] = smooth_update(xsmooth_future, Vsmooth_future, ...
  2.     xfilt, Vfilt,  Vfilt_future, VVfilt_future, F, Q)
  3. % One step of the backwards RTS smoothing equations.
  4. % [xnew, Vnew, VVnew] = smooth_update(xsmooth, Vsmooth, xfilt, Vfilt, VVfil, F, Q)
  5. %
  6. % Inputs:
  7. % xsmooth_future = E[X_t+1|T]
  8. % Vsmooth_future = Cov[X_t+1|T]
  9. % xfilt = E[X_t|t]
  10. % Vfilt = Cov[X_t|t]
  11. % Vfilt_future = Cov[X_t+1|t+1]
  12. % VVfilt_future = Cov[X_t+1,X_t|t+1]
  13. % F = F(:,:,t+1)
  14. % Q = Q(:,:,t+1)
  15. %
  16. % Outputs:
  17. % xsmooth = E[X_t|T]
  18. % Vsmooth = Cov[X_t|T]
  19. % VVsmooth_future = Cov[X_t+1,X_t|T]
  20. %
  21. % xpred = E[X_t+1 | t]
  22. % Vpred = Cov[X_t+1 | t]
  23. xpred = F*xfilt;
  24. Vpred = F*Vfilt*F' + Q;
  25. J = Vfilt * F' * inv(Vpred); % smoother gain matrix
  26. xsmooth = xfilt + J*(xsmooth_future - xpred);
  27. Vsmooth = Vfilt + J*(Vsmooth_future - Vpred)*J';
  28. VVsmooth_future = VVfilt_future + (Vsmooth_future - Vfilt_future)*inv(Vfilt_future)*VVfilt_future;