Skip to content
Back to formatted view

Raw Message

Message-ID: <B4952483D428483F9A2DACBC1CC786E8@RMHHP>
Date: 2009-03-20T14:42:12Z
From: Richard M. Heiberger
Subject: Finding determinants of x-loaded matrix?
In-Reply-To: <B8933A84-D203-4949-8919-03AF6EBF5845@comcast.net>

This is an eigenvalue problem with 0 on the main diagonal.
It is almost always inefficient to find the determinant
as an intermediate step.  The original poster is looking for the
ngative of the eigenvalues of the matrix with the x replaced by zeros.

> tmp <- matrix(c(0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0),4,4)
> tmp
     [,1] [,2] [,3] [,4]
[1,]    0    1    0    0
[2,]    1    0    1    0
[3,]    0    1    0    1
[4,]    0    0    1    0
> eigen(tmp)
$values
[1]  1.618034  0.618034 -0.618034 -1.618034

$vectors
         [,1]      [,2]      [,3]      [,4]
[1,] 0.371748  0.601501  0.601501  0.371748
[2,] 0.601501  0.371748 -0.371748 -0.601501
[3,] 0.601501 -0.371748 -0.371748  0.601501
[4,] 0.371748 -0.601501  0.601501 -0.371748

> ee <- eigen(tmp)
> ee$values^4 - 3*ee$values^2 + 1
[1]  8.881784e-16 -3.774758e-15  1.776357e-15 -3.108624e-14
>