All of my resources for numerical analysis show that the spectral
decomposition is

A = CBC'

Where C are the eigenvectors and B is a diagonal matrix of eigen values.
Now, using the eigen function in R

# Original matrix
aa <- matrix(c(1,-1,-1,1), ncol=2)

ss <- eigen(aa)

# This results yields back the original matrix according to the formula
above
ss$vectors %*% diag(ss$values) %*% t(ss$vectors)

However, for the following I do not get back the original matrix using
the general formula for the spectral decomposition:

set.seed(123)

aa <- matrix(rnorm(16), ncol=4)

ss <- eigen(aa)

ss$vectors %*% diag(ss$values) %*% t(ss$vectors)

However, if I do the following

A = CBC^{-1}

I get back the original matrix A

ss$vectors %*% diag(ss$values) %*% solve(ss$vectors)

In my lit search I am not finding an explanation for why this works, so
I am seeking R-help since there may be a computational rationale that
can be explained by users (or authors) of the function. In my
experimentation with some computations it seems that the latter approach
is more general in that it yields back the matrix I began with, but
deviates from the formula I commonly see in texts.

Thanks,
Harold

> sessionInfo()
R version 2.5.0 (2007-04-23) 
i386-pc-mingw32 

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"
"methods"   "base"     

other attached packages:
 MiscPsycho     statmod      mlmRev        lme4      Matrix     lattice 
      "1.0"     "1.3.0"   "0.995-1" "0.99875-2" "0.99875-3"    "0.15-4" 


	[[alternative HTML version deleted]]

