Dear lapack developer:
I used clapck to solve a linear least square problem (Ax=b), but I found
the solutions were different from SAS 9.1 and Matlab R2010a.
Routine dgeqp3 was used for a *QR* Factorization with Column Pivoting, after
removing dependent columns, the dormqr was used for Q'*y, finaly, dtrtrs for
inv(R)*Q'*y.
The routines I used are dgeqp3, dormqr and dtrtrs, and the design matrix A
is rankdeficient.
please find the attached files as the data, please help.
A is a 324*61 matrix stored by columns, and b is a 324*1 vector stored by
column.
R code:
A < scan("A")
b < scan("b")
A < matrix(A,nrow=324,ncol=61)
b < matrix(b,nrow=324,ncol=1)
tol < 1e8
m < nrow(A)
n < ncol(A)
qrA < qr(A,LAPACK=TRUE)
jpvt < qrA$pivot
R < qr.R(qrA)
Q < qr.Q(qrA)
p < sum(abs(diag(R))>tol)
R < R[1:p,1:p]
Q < Q[,1:p]
jpvt < jpvt[1:p]
x < rep(0,n)
x[jpvt] < solve(R, t(Q)%*%b)

???
He Jianbo
 next part 
An HTML attachment was scrubbed...
URL:
http://lists.eecs.utk.edu/mailman/private/lapack/attachments/20101107/0a0d5c8b/attachment0001.html
 next part 
A nontext attachment was scrubbed...
Name: A
Type: application/octetstream
Size: 41363 bytes
Desc: not available
Url :
http://lists.eecs.utk.edu/mailman/private/lapack/attachments/20101107/0a0d5c8b/A0001.obj
 next part 
A nontext attachment was scrubbed...
Name: b
Type: application/octetstream
Size: 2003 bytes
Desc: not available
Url :
http://lists.eecs.utk.edu/mailman/private/lapack/attachments/20101107/0a0d5c8b/b0001.obj
