[R] Box.test degrees of freedom

David Stoffer dsstoffer at gmail.com
Mon Aug 11 16:15:30 CEST 2008

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: 
>> http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm along with some
>> work-arounds over here:
>> http://www.stat.pitt.edu/stoffer/tsa2/Examples.htm
> 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: http://www.nabble.com/Box.test-degrees-of-freedom-tp17277964p18926678.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list