LjungBox: LjungBox

Description Usage Arguments Value

Description

The Ljung–Box test checks that data whithin the time series are independently distributed (i.e. the correlations in the population from which the sample is taken are 0, so that any observed correlations in the data result from randomness of the sampling process). Data are no independently distributed, if they exhibit serial correlation. The test statistic is:

Q = n≤ft(n+2\right)∑_{k=1}^h\frac{\hat{ρ}^2_k}{n-k}

where ”n” is the sample size, \hat{ρ}k is the sample autocorrelation at lag ”k”, and ”h” is the number of lags being tested. Under H_0 the statistic Q follows a χ^2{(h)}. For significance level α, the critical region for rejection of the hypothesis of randomness is:

Q > χ_{1-α,h}^2

where χ_{1-α,h}^2 is the α -quantile of the chi-squared distribution with ”h” degrees of freedom.

Usage

1
LjungBox(tss, lags)

Arguments

tss

Expects an input array whose dimension zero is the length of the time series (all the same) and dimension one indicates the number of time series.

lags

Number of lags being tested.

Value

Array containing the Ljung-Box statistic test.


shapelets/khiva-r documentation built on June 10, 2019, 4:58 a.m.