UR_test: Testing for unit roots based on sample autocovariances

View source: R/urtest.R

UR_testR Documentation

Testing for unit roots based on sample autocovariances

Description

This function implements the test proposed in Chang, Cheng and Yao (2022) for the following hypothesis testing problem:

H_0:Y_t \sim I(0)\ \ \mathrm{versus}\ \ H_1:Y_t \sim I(d)\ \mathrm{for\ some\ integer\ }d \geq 1\,,

where Y_t is a univariate time series.

Usage

UR_test(Y, lagk.vec = NULL, con_vec = NULL, alpha = 0.05)

Arguments

Y

A vector {\bf Y} = (Y_1, \dots , Y_n )', where n is the number of the observations.

lagk.vec

The time lag K_0 used to calculate the test statistic [See Section 2.1 of Chang, Cheng and Yao (2022)]. It can be a vector specifying multiple time lags. If provided as a s \times 1 vector, the function will output the test results corresponding to each of the s values in lagk.vec. The default is c(0, 1, 2, 3, 4).

con_vec

The constant c_\kappa specified in (5) of Chang, Cheng and Yao (2022). The default is 0.55. Alternatively, it can be an m \times 1 vector specified by users, representing m candidate values of c_\kappa.

alpha

The significance level of the test. The default is 0.05.

Value

An object of class "urtest", which contains the following components:

statistic

A s \times 1 vector with each element representing the test statistic value associated with each of the s time lags specified in lagk.vec.

reject

An m \times s data matrix {\bf R}=(R_{i,j}) where R_{i,j} represents whether the null hypothesis H_0 should be rejected for c_\kappa specified by the i-th component of con_vec, and K_0 specified by the j-th component of lagk.vec. R_{i,j}=1 indicates rejection of the null hypothesis, while R_{i,j}=0 indicates non-rejection.

lag.vec

The time lags used in function.

References

Chang, J., Cheng, G., & Yao, Q. (2022). Testing for unit roots based on sample autocovariances. Biometrika, 109, 543–550. \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.1093/biomet/asab034")}.

Examples

# Example 1
## Generate yt
N <- 100
Y <-arima.sim(list(ar = c(0.9)), n = 2*N, sd = sqrt(1))
con_vec <- c(0.45, 0.55, 0.65)
lagk.vec <- c(0, 1, 2)

UR_test(Y, lagk.vec = lagk.vec, con_vec = con_vec, alpha = 0.05)
UR_test(Y, alpha = 0.05)

HDTSA documentation built on April 3, 2025, 11:07 p.m.