Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We know that Ljung-Box test can be used to test for the residuals of a fitted model. But to test for the serial correlation of a time series itself, is there a way to do that?

share|improve this question
You could always just run autocorrelations on the raw response data, instead of the residuals. Have you searched the site? This strikes me as a question that's been addressed before. – gung Jan 13 '13 at 3:51
Yes I have searched the site but didn't get any clear answers. There should be some test for time series itself but failed to find it. – yanfei kang Jan 13 '13 at 23:20
up vote 1 down vote accepted

You can still use the Ljung-Box test for the time series itself as @gung says. For a series $\{Y_t\}$ think of it as testing the residuals from the model $Y_t=0+\varepsilon_t$ if you like.

share|improve this answer
@Scotchi ... I think you mean Y(t)=constant + e(t) – IrishStat Jan 14 '13 at 15:56
@IrishStat Why? The sample autocorrelations that go into Ljung-Box will be the same if it's zero or a constant. – Scortchi Jan 14 '13 at 16:06
You indeed might be right. Can you validate that as I don't have routine access. Post the results and copy them to me at Thanks in advance. – IrishStat Jan 15 '13 at 12:41
The sample autocorrelation for $k$ lags is $\sum(Y_t-\bar{Y})(Y_{t-k}-\bar{Y})/\sum(Y_t-\bar{Y})^2$, so adding a constant $c$ cancels out: $(Y_t+c-\sum(Y_t+c)/n)=Y_t+c-\bar{Y}-c=Y_t-\bar{Y}$. In any case my point was just that if you were to choose that $c=0$ model your residuals would be equal to the raw response data - illustrating why you can use the Ljung-Box test on the time series itself. – Scortchi Jan 15 '13 at 14:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.