1 function [IR, CC, D] = adim(U, UC, IR, CC, arg5);
2 % ADIM adaptive information matrix. Estimates the inverse
3 % correlation matrix in an adaptive way.
5 % [IR, CC] = adim(U, UC [, IR0 [, CC0]]);
7 % UC update coefficient 0 < UC << 1
8 % IR0 initial information matrix
9 % CC0 initial correlation matrix
10 % IR information matrix (inverse correlation matrix)
11 % CC correlation matrix
13 % The algorithm uses the Matrix Inversion Lemma, also known as
14 % "Woodbury's identity", to obtain a recursive algorithm.
15 % IR*CC - UC*I should be approx. zero.
18 % [1] S. Haykin. Adaptive Filter Theory, Prentice Hall, Upper Saddle River, NJ, USA
19 % pp. 565-567, Equ. (13.16), 1996.
22 % $Id: adim.m 5090 2008-06-05 08:12:04Z schloegl $
23 % Copyright (C) 1998-2003 by Alois Schloegl <a.schloegl@ieee.org>
25 % This program is free software: you can redistribute it and/or modify
26 % it under the terms of the GNU General Public License as published by
27 % the Free Software Foundation, either version 3 of the License, or
28 % (at your option) any later version.
30 % This program is distributed in the hope that it will be useful,
31 % but WITHOUT ANY WARRANTY; without even the implied warranty of
32 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 % GNU General Public License for more details.
35 % You should have received a copy of the GNU General Public License
36 % along with this program. If not, see <http://www.gnu.org/licenses/>.
44 % m = zeros(size(U)+[0,Mode_E]);
48 fprintf(2,'Error ADIM: missing update coefficient\n');
51 if ~((UC > 0) & (UC <1)),
52 fprintf(2,'Error ADIM: update coefficient not within range [0,1]\n');
56 fprintf(2,'Warning ADIM: update coefficient should be smaller than 1/number_of_dimensions\n');
76 D = zeros(ur,(p+Mode_E)^2);
78 W = eye(p+Mode_E)*UC/(p+Mode_E);
79 W2 = eye(p+Mode_E)*UC*UC/(p+Mode_E);
91 CC = (1-UC)*CC + UC*(d'*d);
93 %K = (1+UC)*IR*d'/(1+(1+UC)*d*IR*d');
97 if arg5==0; % original version according to [1], can become unstable
98 IR = (1+UC)*IR - (1+UC)/(1-UC+d*v)*v*v';
100 elseif arg5==1; % this provides IR*CC == I, this seems to be stable
101 IR = IR - (1+UC)/(1-UC+d*v)*v*v' + sum(diag(IR))*W;
103 elseif arg5==6; % DEFAULT:
104 IR = ((1+UC)/2)*(IR+IR') - ((1+UC)/(1-UC+d*v))*v*v';
106 % more variants just for testing, do not use them.
108 IR = IR - (1+UC)/(1-UC+d*v)*v*v' + sum(diag(IR))*W2;
111 IR = IR - (1+UC)/(1-UC+d*v)*v*v' + eps*eye(p+Mode_E);
114 IR = (1+UC)*IR - (1+UC)/(1-UC+d*v)*v*v' + eps*eye(p+Mode_E);
117 IR = IR - (1+UC)/(1-UC+d*v)*v*v' + eps*eye(p+Mode_E);
128 IR(1,1) = IR(1,1) - 1;