Description Usage Arguments Details Value References See Also Examples
Hylleberg, Engle, Granger and Yoo (HEGY) test statistics for the null hypothesis seasonal unit roots.
1 2 3 4 5 6 7  hegy.test(x, deterministic = c(1,0,0),
lag.method = c("fixed", "AIC", "BIC", "AICc"), maxlag = 0,
pvalue = c("RS", "bootstrap", "raw"), rs.nobsreg = 15,
boot.args = list(seed = 123, lag.method = lag.method[1], maxlag = maxlag,
byseason = FALSE, nb = 1000, BTdim = c(100, 10), debug.tid = 1))
hegy.regressors(x)

x 
a univariate seasonal time series. 
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 
pvalue 
a character specifying the method employed to compute pvalues:

rs.nobsreg 
an integer indicating the number of points employed in the response surface
regression (only for 
boot.args 
a list containing the parameters employed in the bootstrap. See details below. 
The regression equation employed to obtain the tests statistics may include
the following deterministic terms: a constant, a linear trend, seasonal dummies.
These terms are selected by setting to 1 the corresponding element
in the vector deterministic
:
deterministic = c(0,0,0)
no deterministic components,
deterministic = c(1,0,0)
includes a constant,
deterministic = c(1,0,1)
a constant and seasonal dummies,
deterministic = c(1,1,0)
a constant and a trend and
deterministic = c(1,1,1)
includes the three components.
The regression equation may include lags of the dependent variable.
When lag.method = "fixed"
, the lag order is fixed to maxlag
;
otherwise, maxlag
is the maximum number of lags considered in a
lag selection procedure that minimises the lag.method
criterion,
which can be AIC
or BIC
or
corrected AIC, AICc
, obtained as AIC + (2k(k+1))/(nk1),
where k is the number of parameters and n is the number of
available observations in the model.
Response surface based pvalues, pvalue="RS"
, is not available
with option lag.method = "AICc"
.
Pvalues based on response surface regressions follow the method described in
MacKinnon (1994), Harvey+vanDijk (2006) and DíazEmparanza (2014).
Gretl code provided by DíazEmparanza (2014)
has been ported to function hegy.rs.pvalue
.
Note: the case deterministic = c(0,0,0)
is not considered;
NA
s are returned if pvalues based on response surfaces are selected for that case.
Bootstrapped pvalues follow the approach described in
Burridge and Robert Taylor (2004).
The following arguments can be defined in boot.args
:
seed
: a numeric, the seed of the random generator employed for resampling the residuals.
lag.method
: a character, the lag order selection method. This is the same
as lag.method
employed in the original regression, except that here,
the AIC, BIC and AICc are obtained upon the residual sums of squares rather than the likelihood value.
maxlag
: a numeric, maximum number of lags. Same behaviour as maxlag
explained above for the original regression.
byseason
: logical, should the residuals be resampled by season? If TRUE
,
the residuals belonging to the same season are resampled
(at each time t, the residuals belonging to the corresponding season
at time t are resampled);
otherwise, the entire series of residuals is resampled regardless of the season they
belong to.
nb
: a numeric, the number of bootstrap replicates.
BTdim
: a vector of length two containing the number of blocks and the number
of threads per block to be run on parallel on the GPU. The product of these two elements must
be equal or greater than nb
.
debug.tid
: an integer employed for debugging. Currently ignored.
By default boot.args$lag.method
and boot.args$maxlag
are set equal
to the same options employed for the original data in arguments lag.method
and maxlag
; if the default options are desired, these values need not be explicitly
defined in the list boot.args
.
The standard definition of the AIC, BIC and AICc criteria is used for the original series. For the bootstrapped series, these criteria are defined upon the residual sum squares of the model:
AIC = n log RSS/n + 2 k
BIC = n log RSS/n + k log(n)
AICc = AIC + (2 k (k+1)) / (n  k  1)
where RSS is the residual sum of squares, k is the number of parameters in the model and n is the number of available observations.
Given a maximum lag, maxlag
, the first maxlag
observations are removed
before fitting the models to be compared by the selected criterion. In this way,
all the models contain the same number of observations.
Once the lag order is selected, the statistics are obtained using
the entire sample (except those observations that are missed due to the eventually chosen lags).
The HEGY regressors were originally proposed in Hylleberg etal. (1990)
for quarterly data. They are generalized to monthly series in Beaulieu and Miron (1993)
and to weekly data in Cáceres (1996).
Franses and Hobijn (1997) show tabulated values for bimonthly and biannual data
as well as quarterly and monthly data.
hegy.rergessors
follows the expressions given in
Smith etal. (2009), which define the regressors for a general periodicity
of the time series.
hegy.test
returns a list of class "HEGYtest"
with the following components:
statistics 
the value of the test statistics. 
pvalues 
the pvalues for each test statistics. 
method 
a character string describing the type of test. 
data.name 
a character string giving the name of the data. 
fitted.model 
the fitted regression model. 
lag.method 
a character, the lag order selection criterion. 
lag.order 
a numeric, the number of lags included in the regression. 
strdet 
a character, auxiliary element for 
type.pvalue 
a character, the value of the input argument codepvalue. 
bootstrap 
a list, parameter options employed in the bootstrap (if 
boot.chosen.lags 
a vector, the lag orders chosen for each bootstrap replicate
(if 
pvlabels 
a vector of characters containing a label related to each pvalues.
Auxiliary element for 
The method print
displays the test statistics and pvalues;
summary
shows the same output and includes the fitted regression model;
residuals
returns the residuals from the regression model fitted to the
original data.
hegy.regressors
returns a matrix containing the HEGY regressors
which are used to test null of unit root at different frequencies.
Beaulieu, J. J. Miron, J. A. (1993) "Seasonal unit roots in aggregate U.S. data." Journal of Econometrics 55(12), pp. 305328. DOI: http://dx.doi.org/10.1016/03044076(93)90018Z.
Burridge, P. and Taylor, R. (2004) "Bootstrapping the HEGY seasonal unit root tests." Journal of Econometrics 123(1), pp. 6787. DOI: http://dx.doi.org/10.1016/j.jeconom.2003.10.029.
Cáceres, J. J. (1996) "Contraste de raíces unitarias en datos semanales." Estadística Española 38(41), pp. 139159.
DíazEmparanza, I. (2014) "Numerical distribution functions for seasonal unit root tests" Computational Statistics and Data Analysis, 76, pp. 237247. DOI: http://dx.doi.org/10.1016/j.csda.2013.03.006. Gretl code: http://www.ehu.eus/ignacio.diazemparanza/packages/GHegy.gfn.
Franses, F. H. (1991) "Seasonality, nonstationarity and the forecasting of monthly time series." International Journal of Forecasting 7(2), pp. 199208. DOI: http://dx.doi.org/10.1016/01692070(91)90054Y.
Franses, P. H. and Hobijn, H. (1997) "Critical values for unit root tests in seasonal time series." Journal of Applied Statistics 24(1), pp. 2547.
Harvey D. I. and van Dijk D. (2006). "Sample size, lag order and critical values of seasonal unit root tests." Computational Statistics & Data Analysis, 50(10), 27342751. DOI: http://dx.doi.org/10.1016/j.csda.2005.04.011.
Hylleberg, S., Engle, R., Granger, C. and Yoo, B. (1990) "Seasonal integration and cointegration." Journal of Econometrics 44(1), pp. 215238. DOI: http://dx.doi.org/10.1016/03044076(90)90080D.
MacKinnon J. G. (1994). "Approximate asymptotic distribution functions for unitroot and cointegration tests." Journal of Business and Economic Statistics, 12(2), 167176. DOI: http://dx.doi.org/10.1080/07350015.1994.10510005.
Smith, R. J., Taylor, A. M. R. and del Barrio Castro, T. (2009) "Regressionbased seasonal unit roots."Econometric Theory 25(2), pp. 527560. DOI: http://dx.doi.org/10.1017/S0266466608090166.
hegy.rs.pvalue
, uroot.raw.pvalue
.
1 2 3 4 5 6 7 8 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.