hegy.boot.pval {uroot}R Documentation

Bootstrapped P-Values for the HEGY Test Statistics

Description

Compute p-values for the HEGY test statistics by means of bootstrap.

Usage

hegy.boot.pval(x, model0, stats0, 
  deterministic = c(1,0,0), lag.method = c("fixed", "AIC", "BIC"), maxlag = 0, 
  byseason = FALSE, nb = 500, u = NULL, debug.tid = -1)

Arguments

x

a univariate seasonal time series.

model0

the fitted.model returned by hegy.test for the original data.

stats0

the statistics returned by hegy.test for the original data.

deterministic

a vector of length three containing zeros or ones to indicate, respectively, whether a constant, a trend or seasonal dummies are included in the regression equation of the test.

lag.method

a character specifying the lag order selection method.

maxlag

the maximum lag order to be considered by lag.method.

byseason

logical, should the residuals be resampled by season? If TRUE, the residuals are split by the season they belong to and resampled accordingly; otherwise, the entire series of residuals is resampled regardless of the season they belong to.

nb

the number of bootstrap replicates.

u

optional matrix of integers giving the indices of the resampled residuals. Intended for debugging.

debug.tid

numeric, if positive, the bootstrap replicate of the data generated at iteratin debug.tid is returned (intended for debugging).

Details

See hegy.test for further details about the arguments that have the same name in both functions (deterministic, lag.method, maxlag).

Bootstrapped p-values follow the approach described in Burridge and Robert Taylor (2004), except that here, the residuals are resampled regardless of the season they belong to.

Value

A numeric vector containing the p-values of the the test statistics. The vector is named following the same convention as statistics and pvalues returned by hegy.test.

If the number of bootstrap replicates is nb = 1, the resampled series is returned (relevant for inspection of how the resampled series look like and for debugging).

References

Burridge, P. and Taylor, R. (2004) "Bootstrapping the HEGY seasonal unit root tests." Journal of Econometrics 123(1), pp. 67-87. DOI: doi:10.1016/j.jeconom.2003.10.029.

Hylleberg, S., Engle, R., Granger, C. and Yoo, B. (1990) "Seasonal integration and cointegration." Journal of Econometrics 44(1), pp. 215-238. DOI: doi:10.1016/0304-4076(90)90080-D.

See Also

hegy.test.

Examples

## Not run: 
x <- bgt.data[["LCONSEXPCO"]]
# this requires CUDA capable GPU
hegy.test(x, deterministic = c(1,1,1), lag.method = "fixed", maxlag = 1, 
  pvalue = "bootstrap")
# alternatively, full R non-parallel version
res <- hegy.test(x, deterministic = c(1,1,1), lag.method = "fixed", maxlag = 1)
hegy.boot.pval(x, res$fit, res$stat, deterministic = c(1,1,1), 
  lag.method = "fixed", maxlag = 1, nb = 1000)
## End(Not run)

[Package uroot version 2.1-3 Index]