[Rd] follow-up on qr.coef bug (PR#8478)

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Thu Jan 12 17:21:38 CET 2006

It certainly _was_ there, in incoming as PR#8476, and also in the R-devel 

BTW, you have not given the minimal information required, e.g. the R 
version.  The pivot logic _is_ correct (your patch was broken), but there 
was a problem with multiple RHSs, now fixed.

On Thu, 12 Jan 2006 sims at princeton.edu wrote:

> This is a multi-part message in MIME format.
> --------------090308090600080800090200
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
> The bug I submitted yesterday (It's not entered in the 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, PACKAGE =
> "base")[1:p]
>        coef[qr$pivot,] <- .Call("qr_coef_real", qr, y, PACKAGE =
> "base")[1:p,]
> I'm not sure why the [1:p,] on the right is needed.  For my examples, it
> works without this extraction operation, but maybe there is some case in
> which the output of qr_coef_real or qr_coef_cmplx could have more than p
> rows.

Read the C code: B is a copy of Bin (y) and so no, it cannot happen any 
more (it could in an earlier version).

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-devel mailing list