ac.test: Testing zero autocorrelation

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

View source: R/testcorr.R

Description

The function ac.test computes the test statistics for examining the null hypothesis of zero autocorrelation for univariate time series given in Dalla, Giraitis and Phillips (2020).

Usage

1
2
ac.test(x, max.lag, alpha = 0.05, lambda = 2.576, 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.

lambda

Threshold in Q-tilde test statistics. Default is 2.576.

plot

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

table

Logical. If TRUE the sample autocorrelations, the confidence bands, 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 standard t and robust t-tilde statistics are for testing the null hypothesis H[0]:ρ[k]=0 at lags k=1,...,max.lag, and the standard LB and robust Q-tilde statistics are for testing the null hypothesis H[0]:ρ[1]=...=ρ[m]=0 at lags m=1,...,max.lag, where ρ[k] denotes the autocorrelation of x[t] at lag k.

Value

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

lag

The lags used.

ac

The sample autocorrelations.

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.

pvttilde

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

lb

The LB test statistics.

pvlb

The p-values for the LB 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
x <- rnorm(100)
ac.test(x, max.lag = 10)

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