Re: [R] Box.test degrees of freedom

From: David Stoffer <>
Date: Mon, 11 Aug 2008 07:15:30 -0700 (PDT)

No, the df are H-(p+q), against what your intuition tells you. The problem is that you're thinking of the residuals as losing a df for each parameter, but the asymptotics of the problem involve the sample autocorrelations of the residuals. You can read the details in the original paper by Box and Pierce (?Box.test for the reference). By the way, you're not alone, Minitab makes the same mistake you did.

raf.rossignol wrote:
> David Stoffer wrote:

>> I stand corrected.  I thought I checked this a long time ago, but
>> apparently not.  tsdiag.Arima DOES NOT use the fact that the series it is
>> testing (or diagnosing, if you will) are residuals from an ARIMA fit. 
>> I keep a list of R time series bloopers here: 
>> along with some
>> work-arounds over here:

> Thanks,
> by the way, if an intercept is included in the model (which is the default
> setting for arima()), it seems to me that the good number of degrees of
> freedom sould be (h-p-q-1). Do you agree ?

The power of accurate observation is commonly called cynicism by those who have not got it. George Bernard Shaw
View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 11 Aug 2008 - 14:27:16 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 Mon 11 Aug 2008 - 15:33:25 GMT.

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

list of date sections of archive