[R] glm with Student t for error distribution

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Oct 26 11:07:21 CEST 2007


On Fri, 26 Oct 2007, Jonas Malmros wrote:

> Hello,
>
> My response variable seems to be distributed according to Student t
> with df=4. I have 320 observations and about 20 variables.
> I am wondering whether there is a way to fit glm with Student t for
> error distribution. Student t is not one of the family choices in glm
> function.

Why should the error distribution be the same as the distribution of the 
response variable?  It almost certainly is not.

A linear model with t-distributed errors is not a GLM.  There are several 
ways in R to fit such a model, but you are almost certainly better off 
using a general robust linear model, e.g. rlm in package MASS.  Looking at 
the residuals from such a fit may give you a reasonable idea of plausible 
error distributions, if the 'true' model were close to linear in the 
explanatory variable provided (and no others).

> How should I proceed to fit glm with Student t?
> I know that Student t is the Inverse Gamma with shape parameter equal
> to degrees of freedom (=4).

That depends on your definition of 'Inverse Gamma', but that at e.g. 
http://en.wikipedia.org/wiki/Inverse-gamma_distribution is a distribution 
on (0, Inf), unlike the t.

> Would it be correct then to specify Gamma
> family and inverse link in the glm function?

No.

(I think you need to read up about what a GLM is.)


-- 
Brian D. Ripley,                  ripley at 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



More information about the R-help mailing list