Re: [R] qr() and Gram-Schmidt

2008-11-03 Thread Peter Dalgaard
cruz wrote: > Hi, > > Why the qr() produces a negative Q compared with Gram-Schmidt? (note > example below, except Q[2,3]) This is a recurrent question in various guises (related to sign issues in factor analysis and PCA). Probably the easiest answer is "Why not?". Notice that at each step of Gra

[R] qr() and Gram-Schmidt

2008-11-03 Thread cruz
Hi, Why the qr() produces a negative Q compared with Gram-Schmidt? (note example below, except Q[2,3]) Here is an example, I calculate the Q by Gram-Schmidt process and compare the output with qr.Q() a <- c(1,0,1) b <- c(1,0,0) c <- c(2,1,0) x <- matrix(c(a,b,c),3,3) ##