iid.test {testcorr}R Documentation

Testing iid property

Description

The function iid.test computes the test statistics for examining the null hypothesis of i.i.d. property for univariate series given in Dalla, Giraitis and Phillips (2020).

Usage

iid.test(x, max.lag, alpha = 0.05, plot = TRUE, table = TRUE,
         var.name = NULL, scale.font = 1)

Arguments

x

A numeric vector or a univariate numeric time series object or a data frame.

max.lag

Maximum lag at which to calculate the test statistics.

alpha

Significance level for hypothesis testing used in the plots. Default is 0.05.

plot

Logical. If TRUE the test statistics and their critical values are plotted. Default is TRUE.

table

Logical. If TRUE the test statistics and their p-values are printed out. Default is TRUE.

var.name

NULL or a character string specifying the variable name. If NULL and x has name, the name of x is used. If NULL and x has no name, the string "x" is used. Default is NULL.

scale.font

A positive number indicating the scaling of the font size in the plots. Default is 1.

Details

The J_{x,|x|} and J_{x,x^2} statistics are for testing the null hypothesis of i.i.d. at lag k, k=1,...,max.lag, and the C_{x,|x|} and C_{x,x^2} statistics are for testing the null hypothesis of i.i.d. at lags 1,...,m, m=1,...,max.lag.

Value

An object of class "iid.test", which is a list with the following components:

lag

The lags used.

jab

The J_{x,|x|} test statistics.

pvjab

The p-values for the J_{x,|x|} test statistics.

jsq

The J_{x,x^2} test statistics.

pvjsq

The p-values for the J_{x,x^2} test statistics.

cab

The C_{x,|x|} test statistics.

pvcab

The p-values for the C_{x,|x|} test statistics.

csq

The C_{x,x^2} test statistics.

pvcsq

The p-values for the C_{x,x^2} test statistics.

Note

Missing values are not allowed.

Author(s)

Violetta Dalla, Liudas Giraitis and Peter C. B. Phillips

References

Dalla, V., Giraitis, L. and Phillips, P. C. B. (2020). "Robust Tests for White Noise and Cross-Correlation". Cowles Foundation, Discussion Paper No. 2194, https://cowles.yale.edu/sites/default/files/files/pub/d21/d2194-r.pdf.

Examples

x <- rnorm(100)
iid.test(x, max.lag = 10)

[Package testcorr version 0.2.0 Index]