Spencer,
You are quite correct. Something is very wrong.
The eigenvalues for mymatrix are a-b = .56 repeated 12 times and a+(k-1)*b)=
-0.05,
Which is what S-PLUS's eigen() and svd() give (except for positive 0.046
from svd()).
Stefano's determinant should be (a-b)^(k-1)*(a+(k-1)*b) = -0.41e-5, which is
what S-PLUS's det() gives,
but not what he gives.
Joe
-----Original Message-----
From: Spencer Graves [mailto:spencer.graves@PDF.COM]
Sent: Monday, March 31, 2003 10:58 AM
To: Lucke, Joseph F
Cc: 'Stefano Sofia'
Subject: Re: [S] inverse of a diagonal matrix
Hi, Joseph:
Well done.
However, if (1.31649e-019) is the determinant of "mymatrix", it suggests
that at least one of (a, b, k) is different from the values we read in
Stefano's email. Moreover, this would explain the numerical
instabilities he reported.
Best Wishes,
Spencer Graves
Lucke, Joseph F wrote:
> 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
> --------------------------------------------------------------------
> 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
|