[R] Poisson Maximum Likelihood Estimation

Gavin Simpson gavin.simpson at ucl.ac.uk
Fri Jan 25 16:14:09 CET 2008


hits=-2.6 tests=BAYES_00
X-USF-Spam-Flag: NO

On Fri, 2008-01-25 at 14:21 +0000, David Winsemius wrote:
> "Paul Sweeting" <mail at paulsweeting.co.uk> wrote in
> news:000101c85f4e$c3d25b50$4b7711f0$@co.uk: 
<snip />
> The most straightforward approach would be to use glm() with 
> family="poisson", a.k.a Poisson regression.  Don't ask me why 
> Gamma is capitalized as an R family but poisson is not, I don't know. 

That is because there already is a gamma() for the *Gamma function*.

>From ?glm:

  family: a description of the error distribution and link function to
          be used in the model. This can be a character string naming a
          family function, a family function or the result of a call to
          a family function.  (See 'family' for details of family
          functions.)

So the character string must match the *name* of the correct family
function, hence you need to use "Gamma" even though you are not calling
the function directly. This isn't a string to simply say which family
you want, it has a slightly deeper meaning, hence the presumed
inconsistency.

I guess gamma() existed before the Gamma family function was included in
R or S, hence it got the lowercase name "gamma".

G

<snip />
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 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