search for: qr

Displaying 20 results from an estimated 841 matches for "qr".

Did you mean: rq
2006 Jan 12
0
bug in qr.coef() and (therefore) in qr.solve (PR#8476)
[I thought I'd submitted this bug report some time ago, but it's never showed up on the bug tracking system, so I'm submitting again.] qr.solve() gives incorrect results when dealing with complex matrices or with qr objects that have been computed with LAPACK=TRUE, whenever the b argument has more than one column. This bug flows from qr.coef(), which has a similar problem. I believe the problem is the line coef[qr$pivot, ] <-...
2012 Dec 03
1
qr.qy and qr.qty give an error message when y is integer and LAPACK=TRUE
With this example set.seed(123) A <- matrix(runif(40), nrow = 8) y <- 1:nrow(A) A.laqr <- qr(A, LAPACK=TRUE) both qr.qy(A.laqr,y) and qr.qty(A.laqr,y) give the respective error messages Error in qr.qy(A.laqr, y) : 'b' must be a numeric matrix Error in qr.qty(A.laqr, y) : 'b' must be a numeric matrix However when Lapack is not used as in A.liqr <- qr(A,...
2007 May 15
2
QR Decompositon and qr.qty
Dear R people, I do not have much knowledge about linear algebra but currently I need to understand what the function qr.qty is actually doing. The documentation states that it calculates t(Q) %*% y via a previously performed QR matrix decomposition. In order to do that, I tried following basic example: m<-matrix(c(1,0,0,0,1,0,0,0,1,0,0,1),ncol=3) # 4x3 matrix qr.qty(qr(m),matrix(c(1,2,3,4,2,3,4,5,1,1,1,1,2,2,...
2004 Mar 01
0
se.contrast ....too hard??? .... Too easy????? .....too trivial???? ...... Too boring.....too????????
...site 10 61.885 6.189 Error: Within Df Sum Sq Mean Sq F value Pr(>F) Residuals 180 318.56 1.77 > > table(ddata$shp) reserve strip 96 96 > > se.contrast(repmod2, list(shp=="strip", shp=="reserve"),data=ddata) Error in qr.qty(strata$qr, scontrast) : qr and y must have the same number of rows > ????????????????????? Thanks, Duncan ...............and here is what debug says:- > debug("qr.qty") > se.contrast(repmod2, list(shp=="strip", shp=="reserve"),data=ddata) debugging i...
2007 May 01
1
(PR#9623) qr.coef: permutes dimnames; inserts NA; promises
...n Thu, 19 Apr 2007, brech at delphioutpost.com wrote: > Full_Name: Christian Brechbuehler > Version: 2.4.1 Patched (2007-03-25 r40917) > OS: Linux 2.6.15-27-adm64-xeon; Ubuntu 6.06.1 LTS > Submission from: (NULL) (24.61.47.236) > > > Splus and R have different ideas about what qr.coef(qr()) should return, > which is fine... but I believe that R has a bug in that it is not > internally consistent, and another separate bug in the documentation. I agree with the bug in the dimnames, and and have corrected that in 2.5.0 patched. But I think the rest stems from the foll...
2011 Aug 23
0
Matrix:::qr.qy and signature(qr = "sparseQR", y = "dgCMatrix")
...and an adjustment to the standard errors to study the four regressors that I am interested in. I want to calculate standardized residuals and need the diagonal elements of the hat matrix. I tried to adjust function hat() in the "stats" package for use with sparse matrices. But the method qr.qy does not seem to have a function available for the following signature: signature(qr = "sparseQR", y = "dgCMatrix") - although it indicates that it understands this signature. Following is a minimal example (in my application dd2 is too large for my memory): library(Matrix)...
2011 Nov 21
0
Suggested improvement for src/library/base/man/qraux.Rd
Here is a modified version of qraux.Rd, an edited version of R-2.14.0/src/library/base/man/qraux.Rd This gives some details and an example for the case of pivoting. In this case, it is not true that X = QR; rather X[, pivot] = QR. It may save some other people bugs and time to have this information. Tim Hesterberg -------------...
2012 Sep 07
1
Suggest adding a 'pivot' argument to qr.R
I suggest adding a 'pivot' argument to qr.R, to obtain columns in the same order as the original x, so that a <- qr(x) qr.Q(a) %*% qr.R(a, pivot=TRUE) returns x. -------------------------------------------------- # File src/library/base/R/qr.R qr.R <- function(qr, complete = FALSE, pivot = FALSE) { # Args: # qr: a QR dec...
2009 Jun 17
3
Matrix inversion-different answers from LAPACK and LINPACK
Hello. I am trying to invert a matrix, and I am finding that I can get different answers depending on whether I set LAPACK true or false using "qr". I had understood that LAPACK is, in general more robust and faster than LINPACK, so I am confused as to why I am getting what seems to be invalid answers. The matrix is ostensibly the Hessian for a function I am optimizing. I want to get the parameter correlations, so I need to invert the ma...
2008 Nov 03
1
qr() and Gram-Schmidt
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) ########################## # G...
2007 Apr 19
0
qr.coef: permutes dimnames; inserts NA; promises minimum-length (PR#9623)
Full_Name: Christian Brechbuehler Version: 2.4.1 Patched (2007-03-25 r40917) OS: Linux 2.6.15-27-adm64-xeon; Ubuntu 6.06.1 LTS Submission from: (NULL) (24.61.47.236) Splus and R have different ideas about what qr.coef(qr()) should return, which is fine... but I believe that R has a bug in that it is not internally consistent, and another separate bug in the documentation. In particular, on this problem, Splus generates a permuted solution vector: Splus 6.2.1: > A <- matrix(c(0,0,0, 1,1,1), nrow...
2018 May 19
1
Bug on qr.coef when qr is created by a zero matrix with colnames and all y equals zero
Dear maintainers, I'm reporting a bug in qr.coef that mishandles the colnames of matrix. A minimal reproducible example is as follows: x <- cbind(rep(0, 10), rep(0, 10)) y <- rep(0, 10) q <- qr.default(x) qr.coef(q, y) [1] NA NA If x has colnames, then qr.coef will end up with an error: x <- cbind(x1 = rep(0, 10), x2 = rep(0,...
2003 Jul 16
2
Is there a bug in qr(..,LAPACK=T)
The following snippet suggests that there is either a bug in qr(,LAPACK=T), or some bug in my understanding. Note that the detected rank is correct (= 2) using the default LINPACK qr, but incorrect (=3) using LAPACK. This is running on Linux Redhat 9.0, using the lapack library that comes with the Redhat distribution. I'm running R 1.7.1 compiled from...
2019 Aug 13
0
behaviour and documentation of qr.solve
Greetings, In my opinion the documentation or behaviour of qr.solve, qr.coef, qr.resid, and qr.fitted is not easily comprehensible and unfortunate. We all know that a linear system Ax=b can have 0, one or infinitely many solutions. To treat all these cases uniformly we can rephrase the problem as x = argmin_u||Au-b||,...
2000 Mar 01
1
"is.qr" definition (PR#465)
Might it be possible to tighten the definition of "is.qr". I noticed that after I mistakenly typed example(lm) # make lm object named lm.D9 qr.Q(lm.D9) which exhausted the heap memory and produced two warning messages. As an object of class "lm" has a "qr" component, "is.qr" failed to detect that "lm.D9"...
2002 May 30
0
se.contrast: matrix contrast.obj doesn't work as documented (PR#1613)
...man page for se.contrast, when describing the contrast.obj parameter, states that "Multiple contrasts should be specified by a matrix as returned by contrasts." When doing an unbalanced single factor ANOVA, using a contrast.obj as returned by contrasts results in the following error from qr.qty when se.contrast is called: Error in qr.qty(object$qr, contrast) : qr and y must have the same number of rows In fact, the matrix contrast.obj parameter that se.contrast requires is not a contrast matrix as returned by contrasts. It is a matrix each of whose columns is in the same form as the...
2016 Oct 24
3
typo or stale info in qr man
man for `qr` says that the function uses LINPACK's DQRDC, while it in fact uses DQRDC2. ``` The QR decomposition of the matrix as computed by LINPACK or LAPACK. The components in the returned value correspond directly to the values returned by DQRDC/DGEQP3/ZGEQP3 ```
2012 May 03
2
GAM, how to set qr=TRUE
Hello, I don't understand what went wrong or how to fix this. How do I set qr=TRUE for gam? When I produce a fit using gam like this: fit = gam(y~s(x),data=as.data.frame(l_yx),family=family,control = list(keepData=T)) ...then try to use predict: (see #1 below in the traceback() ) > traceback() 6: stop("lm object does not have a proper 'qr' component.\n Ra...
2006 Jan 12
1
follow-up on qr.coef bug (PR#8478)
...e bug data base, so I have no ID for it) included a suggested fix that is not correct. It worked for the examples I gave because there was no pivoting in fact, or only pivot permutations that were idempotent. A correction that works in general on the examples I gave makes these two changes in qr.coef(): ## coef[qr$pivot, ] <- .Call("qr_coef_cmplx", qr, y, PACKAGE = "base")[1:p] coef[qr$pivot,] <- .Call("qr_coef_cmplx", qr, y, PACKAGE = "base")[1:p,] ##coef[qr$pivot,] <- .Call("qr_coef_real", qr, y, PACKA...
2005 May 18
2
R -SQL
Hello, I've got a problem in a sql query! for(j in 1:length(criteria$Title)) { graphe_par<-sqlQuery(channel,"select q.type,crit.Title, r.Value from criteria crit, reply r,question_reply qr, question q, question_criteria qc, form_question fq where qr.reply=r.ID and qr.question=q.ID and qc.question=q.ID and crit.ID=qc.criteria and fq.question=q.ID and fq.form=4 and crit.Title=" & criteria$Title[j] &";") ............} > criteria$Title [1] Content L...