I generate this data in R:
set.seed(111)
ds=rnorm(1000)
When I perform Box-Ljung test to test the independency:
Box.test(ds,type='Ljung',lag=log(length(ds)))
it gave me p-value=0.5957, which is reasonable. However, when I perform this:
Box.test(ds[180:299],type='Ljung',lag=log(length(ds[180:299])))
it gave me p-value=0.00162045, which means the autocorrelation of this sub-sequence is significantly different from zero. This also happens for some other subsequences. However, I generated the time series using $rnorm$
function in R with 1000 data points. Could anybody please explain this? Thanks very much in advance.
For the convenience of you readers who are not using R, the sub-sequence ds[180:299] can be obtained here: http://ykang.hostoi.com/ds120.pdf
rnorm
will give you a non-dependent signal. $\endgroup$