Hi all I'm using the Box-Ljung test (from within R) to test if a time-series in independently distributed. 2 questions: 1) p-value returned by Box-Ljung: IF I want to test if the time-series is independant at say 0.05 sig-level (it means that prob of erroneously accepting that the time-series is independent is 0.05 right?) --> then do I consider time-series as "independant" when --> p-value (from Box-Ljung) > 0.05 OR --> p-value < 0.05 Or should i be using (0.95) instead of (0.05) for this case. I'm confused about this (this is a goodness-of-fit test?). 2) Box-Ljung takes a lag argument, say lag=k. Does it check "all lags upto k" OR Does it check "only AT k" (i.e acf val is small at only k?) thank you in advance. I apologize if the questions are very basic. Aroon
> I'm using the Box-Ljung test (from within R) to test if a > time-series in independently distributed.I have window$r.nifty, which is a time-series of returns on the Nifty market index. # Box-Ljung test on Nifty -- test = Box.test(window$r.nifty, lag=10, type="Ljung"); cat("Box Ljung prob value: ", test$p.value, "\n") # Runs test on Nifty test = runs.test(factor(sign(window$r.nifty))); cat("Runs test prob value: ", test$p.value, "\n") -- Ajay Shah Consultant ajayshah at mayin.org Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi
1) A small p-value is evidence that there is dependence. So you want to see large p-values. But a large p-value is not really evidence of independence -- merely a lack of evidence of dependence. You might be able to get a hint of the power of your test (which is what you really care about) from the working paper about Ljung-Box on the Burns Statistics website. 2) The statistic is really an average of the lags up to the stated lag. So if the dependence is all at lag 5, tests with lags below 5 have no power, the lag 5 test has maximum power, and the power decreases as the lag of the test increases above 5. Patrick Burns Burns Statistics patrick at burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User") Aroon Nataraj wrote:> Hi all > I'm using the Box-Ljung test (from within R) to test if a time-series > in independently distributed. > > 2 questions: > 1) p-value returned by Box-Ljung: > IF I want to test if the time-series is independant at say 0.05 > sig-level (it means that prob of erroneously accepting that the > time-series is independent is 0.05 right?) > --> then do I consider time-series as "independant" when > --> p-value (from Box-Ljung) > 0.05 > OR > --> p-value < 0.05 > Or should i be using (0.95) instead of (0.05) for this case. I'm > confused about this (this is a goodness-of-fit test?). > > 2) Box-Ljung takes a lag argument, say lag=k. > Does it check "all lags upto k" > OR > Does it check "only AT k" (i.e acf val is small at only k?) > > thank you in advance. I apologize if the questions are very basic. > > Aroon > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >
> > 1) A small p-value is evidence that there is dependence. > So you want to see large p-values. But a large p-value > is not really evidence of independence -- merely a lack > of evidence of dependence.Hello Aroon, additionally to the points voiced by Patrick, only if your series at hand is normally distributed you can infer from uncorrelatedness (Ljung-Box test) to independence. These two are equivalent in the case of normally distributed random variables. Uncorrelated rv are not necessarily independent, whereas the opposite is true. Hence, you want to utilise "Jarque-Bera-test", or some test for normality, too. HTH, Bernhard> > You might be able to get a hint of the power of your test > (which is what you really care about) from the working > paper about Ljung-Box on the Burns Statistics website. > > 2) The statistic is really an average of the lags up to the > stated lag. So if the dependence is all at lag 5, tests with > lags below 5 have no power, the lag 5 test has maximum > power, and the power decreases as the lag of the test > increases above 5. > > Patrick Burns > > Burns Statistics > patrick at burns-stat.com > +44 (0)20 8525 0696 > http://www.burns-stat.com > (home of S Poetry and "A Guide for the Unwilling S User") > > Aroon Nataraj wrote: > > > Hi all > > I'm using the Box-Ljung test (from within R) to test if a > time-series > > in independently distributed. > > > > 2 questions: > > 1) p-value returned by Box-Ljung: > > IF I want to test if the time-series is independant at say 0.05 > > sig-level (it means that prob of erroneously accepting that the > > time-series is independent is 0.05 right?) > > --> then do I consider time-series as "independant" when > > --> p-value (from Box-Ljung) > 0.05 > > OR > > --> p-value < 0.05 > > Or should i be using (0.95) instead of (0.05) for this case. I'm > > confused about this (this is a goodness-of-fit test?). > > > > 2) Box-Ljung takes a lag argument, say lag=k. > > Does it check "all lags upto k" > > OR > > Does it check "only AT k" (i.e acf val is small at only k?) > > > > thank you in advance. I apologize if the questions are very basic. > > > > Aroon > > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide! > > http://www.R-project.org/posting-guide.html > > > > > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide!http://www.R-project.org/posting-guide.html -------------------------------------------------------------------------------- The information contained herein is confidential and is inte...{{dropped}}
Maybe Matching Threads
- question about the results given by the Box.test?
- Ljung-Box test (Box.test)
- Degrees of freedom in the Ljung-Box test
- Degrees of freedom using Box.test()
- How can I test if a not independently and not identically distributed time series residuals' are uncorrelated ?