by Thomas D. » Tue, 19 Aug 2008 11:36:00
I had a strange result, using the matrix inversion lema. I have a
simple example. I get the same results with octave. I think I am doing
something wrong. But, what? Has to be simple, but, I cannot see it.
tomdean
// matrix inversion lema
// given a partitioned matrix, X=[A,B;C,D] with A,D invertible,
// define
// E = D - C*inv(A)*B
// F = A - B*inv(D)*C
// then Y is the inverse of X, where Y is defined by
function [Y] = lema(W)
Y11= inv(A) + inv(A)*B*inv(W)*C*inv(A);
Y12=-inv(A)*B*inv(W);
Y21=-inv(W)*C*inv(A);
Y22=inv(W);
Y = [Y11, Y12; Y21, Y22];
endfunction;
//rand("seed",1);
A=[12,43,27;32,98,33;11,1,2];
B=[1,2,3;4,5,6;7,8,9];
C=B+11;
D=[44,87,1;8,4,9;11,43,88];
X = [A,B;C,D];
inv(A)
inv(D)
E = D - C*inv(A)*B;
F = A - B*inv(D)*C;
inv(E)
inv(F)
// assume E invertible - it is
Y=lema(E);
// clean(X*Y) - I should be zero
//disp(clean(X*Y));
disp(clean(X*Y-eye(Y))== zeros(Y));
// assume F invertible - it is
Y=lema(F);
//disp(clean(X*Y));
disp(clean(X*Y-eye(Y))== zeros(Y));
tomdean