Re: [R] Box.test degrees of freedom

2008-08-11 Thread David Stoffer
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 an

Re: [R] Box.test degrees of freedom

2008-08-11 Thread raf.rossignol
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: > h

Re: [R] Box.test degrees of freedom

2008-08-10 Thread David Stoffer
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/R

Re: [R] Box.test degrees of freedom

2008-08-09 Thread David Stoffer
I believe tsdiag() uses the correct degrees of freedom in applying Box.test, but the graphic shows "lag" on the horizontal axis when it should display "degrees of freedom". raf.rossignol wrote: > > Hello, > > Prof Brian Ripley wrote: >> >> I think you are referring to its application to t

Re: [R] Box.test degrees of freedom

2008-08-08 Thread raf.rossignol
Hello, Prof Brian Ripley wrote: > > I think you are referring to its application to the residuals of an > ARMA(p, q) fit, and that is not what Box.test says it does. > > It is very easy to edit the code if you want to use a different degrees of > freedom. > I am also new to R, but it seems to

Re: [R] Box.test degrees of freedom

2008-05-16 Thread Prof Brian Ripley
Bear in mind that Box.test knows nothing about p or q: it says Compute the Box-Pierce or Ljung-Box test statistic for examining the null hypothesis of independence in a given time series. I think you are referring to its application to the residuals of an ARMA(p, q) fit, and that is n

Re: [R] Box.test degrees of freedom

2008-05-16 Thread markleeds
Spencer Graves has discussed this recently ( in the last couple of months ) in a thread and I think his FinTS package has a variant of the Box.test function that does what you need. On Fri, May 16, 2008 at 11:45 AM, Nuno Prista wrote: Dear colleagues, I am new to R and statistics so ple

[R] Box.test degrees of freedom

2008-05-16 Thread Nuno Prista
Dear colleagues, I am new to R and statistics so please keep that in mind. I have doubts on the df calculation of Ljung-Box test (Box.test). The function seems to use always the df=lag=m and not df=m-p-q like suggested in Ljung and Box (1978) paper (that is referenced). Do you agree wi