[R] Sweave glm.fit

Gavin Simpson gavin.simpson at ucl.ac.uk
Fri Jun 4 00:23:34 CEST 2010


On Thu, 2010-06-03 at 23:44 +0200, Jimmy Söderly wrote:
> Thanks for your help.
> 
> Does it have something to do with the mcmc package, the coda package, or the
> lattice package ?

Is there something stopping you checking this for yourself? You have the
code *you* are running, after all, and we don't.

The coda package contains a great many functions and as you have yet to
show us any code or your Sweave file, that would involve me looking
through the entirety of those packages to find out.

coda mentions glm() in the spectrum0() function. Are you using that?

I doubt it will be lattice - it is primarily a graphics package.

mcmc doesn't appear to have any obvious calls to glm().

Why don't you Tangle your Sweave file to extract the code, then step
through your code until it issues the warnings. Then you'll know exactly
where the code is failing to converge. I mentioned this in my earlier
reply. I'm afraid I'll be unable to provide further enlightenment unless
you can work out what code is causing the error.

HTH

G

> 
> Jimmy
> 
> 2010/6/3 Gavin Simpson <gavin.simpson at ucl.ac.uk>
> 
> > On Wed, 2010-06-02 at 20:29 +0200, Jimmy Sderly wrote:
> > > Dear R users,
> > >
> > > After running Sweave, this is what I get :
> > >
> > > Warning messages:
> > > 1: glm.fit: algorithm did not converge
> > > 2: glm.fit: algorithm did not converge
> > > There is no glm.fit function in my code.
> >
> > glm calls glm.fit did you call glm() or any code that might use glm()
> > (or glm.fit()). glm.fit() is the function that does the actual model
> > fitting etc, with glm() being a convenience wrapper providing the
> > formula interface etc.
> >
> > > Where does it come from ? From Sweave ? From system.time ?
> >
> > Your call to glm() or any function that calls glm(). This is nothing to
> > sweave or system.time.
> >
> > Your model fitting has failed to converge. There may be many reasons why
> > glm.fit is failing to converge for the model your are fitting.
> >
> > Either extract the R code or tangle the sweave file to do the
> > extraction, and then step through the code to see where the warning is
> > being generated. Then figure out why glm.fit is not converging (you
> > might need to up the number of iterations or provide better starting
> > values or rethink the type of model you are trying to fit).
> >
> > HTH
> >
> > G
> >
> > --
> > %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> >  Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
> >  ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
> >  Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk<http://gavin.simpsonatnospamucl.ac.uk/>
> >  Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
> >  UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
> > %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> >
> >
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list