Re: [R] Degrees of freedom for lm in logLik and AIC

From: peter dalgaard <>
Date: Wed, 30 Mar 2011 17:40:32 +0200

On Mar 28, 2011, at 16:53 , Ben Bolker wrote:

> Rubén Roa <rroa <at>> writes:

>> However, shouldn't _free parameters_ only be counted for degrees of 
>> freedom and for calculation of AIC?
>> The sigma parameter is profiled out in a least-squares 
>> linear regression, so it's not free, it's not a
>> dimension of the likelihood.
>> Just wondering ...

> For AIC I think this distinction should only matter for the purposes
> of consistency between computations in different packages/languages/contexts.
> Only the differences between AIC values matter for inference. (If you were
> talking about AICc then I would tend to agree with you -- nuisance
> parameters should not affect 'residual degrees of freedom'/finite-size
> corrections.)

You're having me confused... AIC and friends are not within my "core competences" (i.e., I know what they are about, but I don't use them intensively on a daily basis), so I may be completely off base, but AFAICS _residual_ degrees of freedom never enters in the logLik computations. Also, I don't get the point about profiling -- you're just maximizing in two steps: first over sigma then over everything else, how is that different from just maximizing?

On the other hand, I suppose it might be argued that the REML variant really only makes sense as a likelihood for sigma, so should have df=1. After all, it is by definition based on a transformation which makes the mean value parameters disappear.

Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email:  Priv:

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 30 Mar 2011 - 15:51:02 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Mar 2011 - 16:20:25 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive