Stefano Sofia
2006-Sep-26 12:18 UTC
[R] about the determinant of a symmetric compound matrix
Dear R users, even if this question is not related to an issue about R, probably some of you will be able to help me. I have a square matrix of dimension k by k with alpha on the diagonal and beta everywhee else. This symmetric matrix is called symmetric compound matrix and has the form a( I + cJ), where I is the k by k identity matrix J is the k by k matrix of all ones a = alpha - beta c = beta/a I need to evaluate the determinant of this matrix. Is there any algebric formula for that? thank you for your help Stefano [[alternative HTML version deleted]]
Peter Dalgaard
2006-Sep-26 13:49 UTC
[R] about the determinant of a symmetric compound matrix
"Stefano Sofia" <stefano.sofia at regione.marche.it> writes:> Dear R users, > even if this question is not related to an issue about R, probably some of you will be able to help me. > > I have a square matrix of dimension k by k with alpha on the diagonal and beta everywhee else. > This symmetric matrix is called symmetric compound matrix and has the form > a( I + cJ), > where > I is the k by k identity matrix > J is the k by k matrix of all ones > a = alpha - beta > c = beta/a > > I need to evaluate the determinant of this matrix. Is there any algebric formula for that?Yes. Unusually, this is not from the famous "Rao p.33", but from p.32... [1]: det(A+XX') = det(A)(1+X'A^{-1}X) provided det(A) != 0 now put X = sqrt(c) times a vector of ones and get det(I+cJ) = 1+ck. Multiply by a^k for the general case. Quick sanity check:> m <- matrix(.1,7,7) > diag(m) <- .9 > det(m)[1] 0.393216> .8^7 * (1 + .1/.8 * 7)[1] 0.393216 Alternatively, you can do it via eigenvalues: The off-diagonal part (beta*J) corresponds to a single direction along the unit vector c(1,1,...,1)/sqrt(7). The diagonal part corresponds to adding (alpha - beta)*I, which has total sphericity so you can arrange that one eigenvector of it points in the same direction and you end up with (alpha - beta)^(k-1) * (alpha - beta + k*beta)> (.9-.1)^6*((.9-.1)+ 7*.1)[1] 0.393216 (Getting this right on the first try is almost impossible...) [1] CR Rao, Linear Statistical Inference and Its Applications, 2nd ed. Wiley 1973. -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Gabor Grothendieck
2006-Sep-27 06:14 UTC
[R] about the determinant of a symmetric compound matrix
If P = projection onto the one dimensional space spanned by 1, the vector consisting of n 1's, then using the usual formula for projections we have P = 11'/1'1 = J/n and writing I+cJ in terms of P we have: I+cJ = (I-P) + (cn+1)P which is an eigen expansion showing that I+cJ has one eigenvalue of cn+1 and n-1 eigenvalues of 1 so its determinant, being the product of the eigenvalues, is cn+1. That is, det(I+cJ) = cn+1 and we can verify that for n=5 and c=10 which should give cn+1 = 51:> det(diag(5) + matrix(10, 5, 5)) # 10 * 5 + 1 = 51[1] 51 Thus det(a(I+cJ)) = a^n (cn+1) On 9/26/06, Stefano Sofia <stefano.sofia at regione.marche.it> wrote:> Dear R users, > even if this question is not related to an issue about R, probably some of you will be able to help me. > > I have a square matrix of dimension k by k with alpha on the diagonal and beta everywhee else. > This symmetric matrix is called symmetric compound matrix and has the form > a( I + cJ), > where > I is the k by k identity matrix > J is the k by k matrix of all ones > a = alpha - beta > c = beta/a > > I need to evaluate the determinant of this matrix. Is there any algebric formula for that? > > thank you for your help > Stefano > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Possibly Parallel Threads
- Lapack, determinant, multivariate normal density, solution to linear system, C language
- La.svd of a symmetric matrix
- Determinant function (PR#9715)
- Sum of columns of a data frame equal to NA when all the elements are NA
- Create a vector without using an external 'if statement'