cc.test: Testing zero cross-correlation

Description Usage Arguments Details Value Note Author(s) References Examples

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

1
2
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 Q-tilde 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 t-tilde statistics are for testing the null hypothesis H[0]:ρ[k]=0 at lags k=-max.lag,...,-1,0,1,max.lag, and the standard HB and robust Q-tilde statistics are for testing the null hypothesis H[0]:ρ[0]=...=ρ[m]=0 at lags m=-max.lag,...,-1,0,1,max.lag, where ρ[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 t-tilde test statistics.

pvtttilde

The p-values for the t-tilde test statistics.

hb

The HB test statistics.

pvhb

The p-values for the HB test statistics.

qtilde

The Q-tilde test statistics.

pvqtilde

The p-values for the Q-tilde 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

1
2
3
x <- rnorm(100)
y <- rnorm(100)
cc.test(x, y, max.lag = 10)

Example output

Tests for zero cross-correlation of x and y

| Lag|     CC|  Stand. CB(95%)|  Robust CB(95%)| Lag|      t| p-value| t-tilde| p-value| Lag|    HB| p-value| Q-tilde| p-value|
|---:|------:|---------------:|---------------:|---:|------:|-------:|-------:|-------:|---:|-----:|-------:|-------:|-------:|
| -10|  0.085| (-0.196, 0.196)| (-0.189, 0.189)| -10|  0.851|   0.395|   0.884|   0.377| -10| 9.939|   0.536|  10.061|   0.525|
|  -9|  0.065| (-0.196, 0.196)| (-0.170, 0.170)|  -9|  0.654|   0.513|   0.752|   0.452|  -9| 9.135|   0.519|   9.279|   0.506|
|  -8| -0.097| (-0.196, 0.196)| (-0.168, 0.168)|  -8| -0.970|   0.332|  -1.132|   0.258|  -8| 8.666|   0.469|   9.202|   0.419|
|  -7| -0.118| (-0.196, 0.196)| (-0.165, 0.165)|  -7| -1.182|   0.237|  -1.407|   0.159|  -7| 7.644|   0.469|   7.921|   0.441|
|  -6|  0.025| (-0.196, 0.196)| (-0.194, 0.194)|  -6|  0.255|   0.799|   0.258|   0.797|  -6| 6.141|   0.523|   5.941|   0.547|
|  -5| -0.047| (-0.196, 0.196)| (-0.221, 0.221)|  -5| -0.469|   0.639|  -0.416|   0.678|  -5| 6.072|   0.415|   5.874|   0.437|
|  -4|  0.014| (-0.196, 0.196)| (-0.201, 0.201)|  -4|  0.138|   0.891|   0.134|   0.893|  -4| 5.840|   0.322|   5.702|   0.336|
|  -3|  0.164| (-0.196, 0.196)| (-0.246, 0.246)|  -3|  1.644|   0.100|   1.312|   0.190|  -3| 5.821|   0.213|   5.684|   0.224|
|  -2|  0.116| (-0.196, 0.196)| (-0.183, 0.183)|  -2|  1.158|   0.247|   1.238|   0.216|  -2| 3.033|   0.386|   3.963|   0.265|
|  -1| -0.022| (-0.196, 0.196)| (-0.187, 0.187)|  -1| -0.219|   0.827|  -0.229|   0.819|  -1| 1.666|   0.435|   3.169|   0.205|
|   0| -0.127| (-0.196, 0.196)| (-0.163, 0.163)|   0| -1.272|   0.203|  -1.525|   0.127|   0| 1.618|   0.203|   2.326|   0.127|
|   1|  0.028| (-0.196, 0.196)| (-0.159, 0.159)|   1|  0.285|   0.776|   0.351|   0.726|   1| 1.700|   0.427|   2.449|   0.294|
|   2|  0.206| (-0.196, 0.196)| (-0.205, 0.205)|   2|  2.058|   0.040|   1.971|   0.049|   2| 6.023|   0.110|   6.333|   0.096|
|   3|  0.056| (-0.196, 0.196)| (-0.178, 0.178)|   3|  0.564|   0.573|   0.621|   0.535|   3| 6.351|   0.174|   6.718|   0.152|
|   4| -0.104| (-0.196, 0.196)| (-0.194, 0.194)|   4| -1.040|   0.298|  -1.048|   0.295|   4| 7.478|   0.187|   7.817|   0.167|
|   5|  0.015| (-0.196, 0.196)| (-0.232, 0.232)|   5|  0.155|   0.877|   0.131|   0.896|   5| 7.503|   0.277|   7.834|   0.251|
|   6|  0.070| (-0.196, 0.196)| (-0.213, 0.213)|   6|  0.702|   0.483|   0.645|   0.519|   6| 8.027|   0.330|   8.250|   0.311|
|   7|  0.009| (-0.196, 0.196)| (-0.187, 0.187)|   7|  0.092|   0.927|   0.096|   0.924|   7| 8.036|   0.430|   8.259|   0.409|
|   8| -0.022| (-0.196, 0.196)| (-0.212, 0.212)|   8| -0.215|   0.830|  -0.199|   0.843|   8| 8.086|   0.525|   8.299|   0.504|
|   9| -0.054| (-0.196, 0.196)| (-0.182, 0.182)|   9| -0.544|   0.587|  -0.586|   0.558|   9| 8.411|   0.589|   8.642|   0.566|
|  10|  0.040| (-0.196, 0.196)| (-0.202, 0.202)|  10|  0.404|   0.686|   0.392|   0.695|  10| 8.593|   0.659|   8.796|   0.641|

testcorr documentation built on April 5, 2021, 5:06 p.m.