File: lindquist.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (31 lines) | stat: -rw-r--r-- 796 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function [Pn,Rt,T]=lindquist(n,H,F,G,r0)
//[Pn,Rt,T]=lindquist(n,H,F,G,r0)
//macro which computes iteratively the minimal solution of the algebraic
//Riccati equation and gives the matrices Rt and Tt of the filter model,
//by the lindquist algorithm.
//   n     : number of iterations.
//   H,F,G : estimated triple from the covariance sequence of y.
//   r0    : E(yk*yk')
//   Pn    : solution of the Riccati equation after n iterations.
//   Rt,Tt : gain matrices of the filter.
//!
//author: G. Le Vey  Date: 16 Febr. 1989
// Copyright INRIA

//initialization
   [d,m]=size(H);
   gam=G;
   Rt=r0;
   k=0*ones(m,d);
//recursion
   for j=1:n,..
     k=k+gam/Rt*gam'*H';
     r1=r0-H*k;
     gam=(F-(G-F*k)/r1*H)*gam;
     Rt=Rt-gam'*H'/r1*H*gam;
   end
   Rt=inv(r0-H*k);
   tt=(G-F*k)/Rt;