There is no problem with Stefano's matrix. Its singular values are .56
repeated 12 times and .05. Its condition number is twelve. S-PLUS's
solve() gives the correct inverse.
However, much of this is unnecessary. The matrix is compound symmetric.
Let a=.51, b= -0.04636364, and k=13. Let I be the identity matrix and J the
k by k matrix of ones. Then the inverse is
1/(a-b)*( I - b/(a+(k-1)*b) * J ).
Note that the conditions for non-singularity are a!=b and a != -(k-1)*b.
This gives the inverse comprising 1.55e-6 on the diagonal and -1.8 on the
off-diagonal, which is the same as the result from S-PLUS's solve().
Joe
-----Original Message-----
From: Stefano Sofia [mailto:stefano.sofia@usa.net]
Sent: Sunday, March 30, 2003 12:17 PM
To: s-news@lists.biostat.wustl.edu
Subject: [S] inverse of a diagonal matrix
Dear Splus users,
I've got some problems about inverse of a symmetric matrix.
Be mymatrix a square symmetric matrix of dimension 13, with
0.51 in the diagonal
-0.04636364 everywhere else.
Within the library Matrix, the command solve(mymatrix) gives back the
inverse of mymatrix. But I realised that the output of solve is not the
correct matrix at all; first of all the output is not a symmetric matrix,
and multiplying mymatrix with this presumed inverse I get a matrix far from
being the identity matrix. The determinant of mymatrix is very small
(1.31649e-019) but still recognised as greater than zero. Is that possible
to improve the precision of the calculations or the smallness of the
determinant makes any improvement impossible? Am I using the right method
for the inverse?
I'm using Splus4 in a Windows XP environment.
Any help will be greatly appreciated
Stefano
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with the
BODY of the message: unsubscribe s-news
|