cc.test {testcorr}R Documentation

Testing zero cross-correlation

Description

The function cc.test computes the test statistics for examining the null hypothesis of zero cross-correlation for bivariate time series given in Dalla, Giraitis and Phillips (2020).

Usage

cc.test(x, y, max.lag, alpha = 0.05, lambda = 2.576, plot = TRUE,
        table = TRUE, var.names = NULL, scale.font = 1)

Arguments

x

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

y

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.

lambda

Threshold in \widetilde{Q} test statistics. Default is 2.576.

plot

Logical. If TRUE the sample cross-correlations with their confidence bands and the cumulative statistics with their critical values are plotted. Default is TRUE.

table

Logical. If TRUE the sample cross-correlations, the confidence bands, the test statistics and their p-values are printed out. Default is TRUE.

var.names

NULL or a character string specifying the variable names. If NULL and x,y have names, the names of x,y are used. If NULL and x,y have no names, the string c("x","y") 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 standard t and robust \widetilde{t} statistics are for testing the null hypothesis H_0:\rho_k=0 at lags k=-max.lag,...,-1,0,1,max.lag, and the standard HB and robust \widetilde{Q} statistics are for testing the null hypothesis H_0:\rho_0=...=\rho_m=0 at lags m=-max.lag,...,-1,0,1,max.lag, where \rho_k denotes the cross-correlation of x_t and y_{t-k} at lag k.

Value

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

lag

The lags used.

cc

The sample cross-correlations.

scb

The lower and upper limit of the confidence bands based on the standard test statistics.

rcb

The lower and upper limit of the confidence bands based on the robust test statistics.

t

The t test statistics.

pvt

The p-values for the t test statistics.

ttilde

The \widetilde{t} test statistics.

pvtttilde

The p-values for the \widetilde{t} test statistics.

hb

The HB test statistics.

pvhb

The p-values for the HB test statistics.

qtilde

The \widetilde{Q} test statistics.

pvqtilde

The p-values for the \widetilde{Q} 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)
y <- rnorm(100)
cc.test(x, y, max.lag = 10)

[Package testcorr version 0.2.0 Index]