[R] GLM dist Gamma-links identity and inverse
Simon Wood
s.wood at bath.ac.uk
Sun Jun 17 15:41:41 CEST 2007
If the linear predictor of the GLM becomes negative during fitting, then the
corresponding fitted values (expected value of response according to model),
will be negative if you use inverse or identity links. This is problematic,
since a Gamma r.v. can not be negative, let alone have a negative mean. The
upshot is that when the model deviance is calculated there are negative logs
to evaluate, which is the likely cause of the error.
If you use a log link then -ve linear predictor still implies strictly
positive fitted values, and everything is fine.
Simon
On Saturday 16 June 2007 20:42, laran gines wrote:
> Dear users;
>
> I am doing GLMs with the Gamma distribution, and I always get errors ("no
> valid set of coefficients: please supply starting values") or warnings
> ("NaNs produced in log(x)") when I use the links identity or inverse, but I
> don´t get them if I use the log link.
>
> For example:
> > summary(step(glm(formula=acin.x~Canais+Hetero+Indrel+Penetra+Ph2o+Pmatorg
> >+Vasa+Aguasup+Prof+Conchdisp+Conchaglom+Ostdisp+Ostaglom+
>
> Rugos+distcanais+distcosta+distsalina+disturbano+distsapal+cota,family=Gamm
>a(link="inverse"))))Start: AIC=9.18acin.x ~ Canais + Hetero + Indrel +
> Penetra + Ph2o + Pmatorg + Vasa + Aguasup + Prof + Conchdisp +
> Conchaglom + Ostdisp + Ostaglom + Rugos + distcanais + distcosta +
> distsalina + disturbano + distsapal + cota Error: no valid set of
> coefficients has been found: please supply starting valuesIn addition:
> Warning message:NaNs produced in: log(x)
>
> I am doing this to twelve species and I always get the errors with links
> identity and inverse, and never with log link.
>
> Could someone give me an explanation about what is happening?
>
> Thank you very much in advance!
>
> Best wishes;
>
> Catarina
> _________________________________________________________________
> Receba GRÁTIS as mensagens do Messenger no seu celular quando você
> estiver offline. Conheça o MSN Mobile!
>
> [[alternative HTML version deleted]]
--
> Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK
> +44 1225 386603 www.maths.bath.ac.uk/~sw283
More information about the R-help
mailing list