Re: R-alpha: glm and substitute bugs

Gordon K Smyth (
Tue, 14 Jan 1997 17:48:30 +1100

Message-Id: <>
Date: Tue, 14 Jan 1997 17:48:30 +1100
To: Ross Ihaka <>, Jim Lindsey <>
From: Gordon K Smyth <>
Subject: Re: R-alpha: glm and substitute bugs

At 03:30 PM 1/14/97 +1300, Ross Ihaka wrote:
[ stuff deleted]
>Which gets back to the original problem of how to handle singular
>design matrices.  The problem is that when the design is singular,
>the coefficients come back with NAs in positions corresponding to
>dependent columns.  This makes all the starting values be NA which is
>a disaster.  Another possible fix is to add
>	start[] <- 0
>immediately after
>	start <- qr.coef(fit, w*z)
>BUT there are some other problems when the design matrix is singular.
>It may be time to bite the bullet and really redo glm.

What about deleting the aliased columns of weights*X before entering IRLS
iteration?  This would avoid having the QR decomposition flail around anew
on each iteration, when the aliased columns cannot change.  The same could
be said of rows for which weights=0.

It would be closer to the spirit of glms (and to the GLIM and S
implementations) to have "start" refer to fitted values rather than
coefficients, i.e., to set starting values for the fitted values rather than
the coefficients.

It would be good to move closer to the GLIM treatment of singular matrices,
which is so much better than that of S.

Dr Gordon K Smyth           Telephone:  7-3365-3116, Fax:  7-3365-1477
Department of Mathematics, University of Queensland, Q 4072, Australia
E-mail:,     URL:

r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: