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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

sims-3
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.



--------------090308090600080800090200
Content-Type: text/x-vcard; charset=utf-8;
 name="sims.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="sims.vcf"

begin:vcard
fn:Chris Sims
n:Sims;Chris
org:Princeton University;Department of Economics
adr:;;Fisher Hall;Princeton;NJ;08544-1021;USA
email;internet:[hidden email]
tel;work:609 258 4033
tel;fax:609 258 6419
x-mozilla-html:FALSE
url:http://www.princeton.edu/~sims
version:2.1
end:vcard


--------------090308090600080800090200--

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: follow-up on qr.coef bug (PR#8478)

Prof Brian Ripley
It certainly _was_ there, in incoming as PR#8476, and also in the R-devel
archives.

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 [hidden email] 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,                  [hidden email]
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel