hegy-boot-pval.Rd
Compute p-values for the HEGY test statistics by means of bootstrap.
a univariate seasonal time series.
the fitted.model
returned by hegy.test
for the original data.
the statistics
returned by hegy.test
for the original data.
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.
a character specifying the lag order selection method.
the maximum lag order to be considered by lag.method
.
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.
the number of bootstrap replicates.
optional matrix of integers giving the indices of the resampled residuals. Intended for debugging.
numeric, if positive, the bootstrap replicate of the data generated
at iteratin debug.tid
is returned (intended for debugging).
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.
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).
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 .
if (FALSE) {
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)}