Full_Name: Bonnie Version: 1.6.1 OS: Windows Submission from: (NULL) (160.129.25.106) glm() seems to converge, even when it shouldn't. I am trying to fit a model where $converge=FALSE and I am fitting models that do not converge in SAS, but they seem to converge in R ... Thank you.
Could you please supply an example? 1) There is nothing we can reproduce here (see the FAQ on BUGS), and 2) we don't take SAS as the gold standard, and 3) R does have glm.control() to control how convergence is determined, and you do sometimes need to work with it. There are models/datasets which do not have an MLE within the parameter set: for those R does converge to a value near the boundary. But R *should* converge then. There are also situations in which R will converge (correctly) but simple IRLS will not. On Tue, 10 Jun 2003 bonnie.lafleur@vanderbilt.edu wrote:> Full_Name: Bonnie > Version: 1.6.1 > OS: Windows > Submission from: (NULL) (160.129.25.106) > > > glm() seems to converge, even when it shouldn't. I am trying to fit a model > where $converge=FALSE and I am fitting models that do not converge in SAS, > but they seem to converge in R ...-- Brian D. Ripley, ripley@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
Dear Bonnie, thanks for trying to be helpful, but you weren't really.. Could you type ?bug.report in R and read the bottom of that page carefully, and then send a report {with a reproducible example}? Thank you in advance, Martin Maechler <maechler@stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <><
On Tue, 10 Jun 2003 bonnie.lafleur@vanderbilt.edu wrote:> glm() seems to converge, even when it shouldn't. I am trying to fit a model > where $converge=FALSE and I am fitting models that do not converge in SAS, > but they seem to converge in R ...While it wouldn't be the first time there was a bug in glm, it's hard to tell from your report whether the problem is with R, SAS, or your expectations. Can you give an example? -thomas
Full_Name: Bonnie LaFleur Version: 1.6.1 OS: Windows Submission from: (NULL) (160.129.25.106) All, I sincerely apologize for being so vague with my "bugs" query. Part of this is that it is not directly related to a specific data analysis, but rather a part of a bigger project I am working on. I also apologize if the bugs forum is not appropriate for this problem. Thank you Prof Brian Ripley for your point to the glm.control() command, I will work with this for now and it will solve my most immediate problems. Specifically, I am running about 10,000 + permutations through an R program on a bewoulf cluster of machines, and needed to get a handle on whether the lines and columns of my report output file are consistant, so I can use this in debugging the overall program for the parallel processing, as well as to keep track of any permutations for which a nonlinear program may not converge. In trying to answer the number of columns question I tried to find a problem which I pretty much know has no reason to converge. It is totally nonsensical data (as you can tell). It does not converge in SAS or Splus for Windows, it does however converge in R (version 1.6.1) for Windows and R (version 1.3.1) on linux - though, of course the stimates are obviously suspect. I am enclosing simple R commands for these silly data for your perusal. Thank you for you time, and again, I am sorry for the premature post last night. Bonnie R : Version 1.3.1 (2001-08-31) (on linux) Y <- c(1,1,1,1,0) X1 <- factor(c(0,0,0,1,1)) X2 <- factor(c(0,0,1,0,0)) logist<- glm(Y ~ X1*X2, family=binomial(link="logit")) summary(logist) ## usual logistic output logist$converged ## TRUE _______________________________________________________ Alternatively in S-Plus, the same model produces a warning message that linear convergence was not obtained in 10 iterations. S-PLUS 2000 professional release 1
At 01:37 AM 12/06/2003, bonnie.lafleur@vanderbilt.edu wrote:>Full_Name: Bonnie LaFleur >Version: 1.6.1 >OS: Windows >Submission from: (NULL) (160.129.25.106) > >All, > >I sincerely apologize for being so vague with my "bugs" query. Part of this >is that it is not directly related to a specific data analysis, but rather >a part of a bigger project I am working on. I also apologize if the bugs >forum is not appropriate for this problem. Thank you Prof Brian Ripley for >your point to the glm.control() command, I will work with this for now and >it will solve my most immediate problems. > >Specifically, I am running about 10,000 + permutations through an R program >on a bewoulf cluster of machines, and needed to get a handle on whether the >lines and columns of my report output file are consistant, so I can use this >in debugging the overall program for the parallel processing, as well as >to keep track of any permutations for which a nonlinear program may not >converge. >In trying to answer the number of columns question I tried to find a problem >which I pretty much know has no reason to converge. It is totally nonsensical >data (as you >can tell). It does not converge in SAS or Splus for Windows, it does however >converge in R (version 1.6.1) for Windows and R (version 1.3.1) on linux - >though, of course the stimates are obviously suspect. I am enclosing >simple R >commands >for these silly data for your perusal. Thank you for you time, and again, >I am sorry for the premature post last night. > > >Bonnie > >R : Version 1.3.1 (2001-08-31) (on linux) > >Y <- c(1,1,1,1,0) >X1 <- factor(c(0,0,0,1,1)) >X2 <- factor(c(0,0,1,0,0)) > >logist<- glm(Y ~ X1*X2, family=binomial(link="logit")) >summary(logist) > ## usual logistic output >logist$converged > ## TRUEWell, others can speak for themselves, but R does for this data exactly what I would want a generalized linear model program to do. R finds the correct fitted values c(1,1,1,0.5,0,5) to 5 decimal places and the correct residual deviance -4*log(0.5) to 4 decimal places. The fitted values for the coefficients and theoreticaly infinite, but R does the best that can be done by giving large finite values and small t-statistics. It is true that the fitted coefficients cannot converge for these data, because the stationary values are at infinity, but the fitted values and residual deviance can and do converge. Gordon