| Title: | Hatemi-J Cointegration Test with Two Unknown Regime Shifts |
|---|---|
| Description: | Implements the Hatemi-J (2008) cointegration test which allows for two unknown structural breaks (regime shifts) in the cointegrating relationship. The test provides three test statistics: ADF* (Augmented Dickey-Fuller), Zt* (Phillips-Perron Z_t), and Za* (Phillips-Perron Z_alpha), along with endogenously determined break dates. Critical values are based on simulations from Hatemi-J (2008) <doi:10.1007/s00181-007-0175-9>. |
| Authors: | Muhammad Alkhalaf [aut, cre, cph] (ORCID: <https://orcid.org/0009-0002-2677-9246>) |
| Maintainer: | Muhammad Alkhalaf <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.1 |
| Built: | 2026-05-28 07:24:57 UTC |
| Source: | https://github.com/muhammedalkhalaf/hatemicoint |
Implements the Hatemi-J (2008) cointegration test which allows for two unknown structural breaks (regime shifts) in the cointegrating relationship. The test provides three test statistics: ADF* (Augmented Dickey-Fuller), Zt* (Phillips-Perron Z_t), and Za* (Phillips-Perron Z_alpha), along with endogenously determined break dates.
The main function in this package is hatemicoint, which
performs the cointegration test with two structural breaks.
The test is particularly useful when:
Standard cointegration tests fail to reject the null of no cointegration
There is reason to believe the relationship has changed over time
Two structural breaks are suspected in the data
Augmented Dickey-Fuller test on residuals with optimal lag selection
Phillips-Perron Z_t test with kernel-based long-run variance
Phillips-Perron Z_alpha test with kernel-based long-run variance
Critical values depend on the number of regressors (k = 1, 2, 3, or 4) and are taken from Table 1 of Hatemi-J (2008). The null hypothesis of no cointegration is rejected when the test statistic is smaller (more negative) than the critical value.
Maintainer:
Hatemi-J, A. (2008). Tests for cointegration with two unknown regime shifts with an application to financial market integration. Empirical Economics, 35, 497-505. doi:10.1007/s00181-007-0175-9
Gregory, A.W., & Hansen, B.E. (1996). Residual-based tests for cointegration in models with regime shifts. Journal of Econometrics, 70(1), 99-126. doi:10.1016/0304-4076(69)41685-7
Performs the Hatemi-J (2008) cointegration test which allows for two unknown structural breaks (regime shifts) in the cointegrating relationship. The test searches over all possible break date combinations and returns the minimum test statistics along with the endogenously determined break dates.
hatemicoint( y, x, maxlags = 8, lag_selection = c("tstat", "aic", "sic"), kernel = c("iid", "bartlett", "qs"), bwl = NULL, trimming = 0.15 )hatemicoint( y, x, maxlags = 8, lag_selection = c("tstat", "aic", "sic"), kernel = c("iid", "bartlett", "qs"), bwl = NULL, trimming = 0.15 )
y |
Numeric vector. The dependent variable (must be I(1)). |
x |
Numeric matrix or vector. The independent variable(s) (must be I(1)). Maximum of 4 regressors allowed (k <= 4). |
maxlags |
Integer. Maximum number of lags for ADF test. Default is 8. |
lag_selection |
Character. Lag selection criterion: |
kernel |
Character. Kernel for long-run variance estimation in PP tests:
|
bwl |
Integer. Bandwidth for kernel estimation. If NULL (default), computed
as |
trimming |
Numeric. Trimming parameter for break point search. Must be between 0 and 0.5 (exclusive). Default is 0.15. |
The Hatemi-J (2008) test extends the Gregory and Hansen (1996) cointegration test by allowing for two structural breaks instead of one. The test is based on the residuals from the cointegrating regression with regime shift dummies:
where and are dummy variables for the two regime
shifts.
Three test statistics are computed:
ADF*: Modified Augmented Dickey-Fuller test on residuals
Zt*: Phillips-Perron Z_t test on residuals
Za*: Phillips-Perron Z_alpha test on residuals
The null hypothesis is no cointegration. Rejection occurs when the test statistic is smaller (more negative) than the critical value.
An object of class "hatemicoint" containing:
Minimum ADF* test statistic
First break location (observation number) for ADF*
Second break location (observation number) for ADF*
Minimum Zt* test statistic
First break location for Zt*
Second break location for Zt*
Minimum Za* test statistic
First break location for Za*
Second break location for Za*
Critical values for ADF* and Zt* tests (1%, 5%, 10%)
Critical values for Za* test (1%, 5%, 10%)
Number of observations
Number of regressors
Maximum lags used
Lag selection method used
Kernel used
Bandwidth used
Trimming parameter
Hatemi-J, A. (2008). Tests for cointegration with two unknown regime shifts with an application to financial market integration. Empirical Economics, 35, 497-505. doi:10.1007/s00181-007-0175-9
Gregory, A.W., & Hansen, B.E. (1996). Residual-based tests for cointegration in models with regime shifts. Journal of Econometrics, 70(1), 99-126. doi:10.1016/0304-4076(69)41685-7
# Generate example data with structural breaks set.seed(123) n <- 200 x <- cumsum(rnorm(n)) # Create cointegrated series with two breaks y <- numeric(n) y[1:70] <- 1 + 0.8 * x[1:70] + rnorm(70, sd = 0.5) y[71:140] <- 3 + 1.2 * x[71:140] + rnorm(70, sd = 0.5) y[141:200] <- 2 + 0.6 * x[141:200] + rnorm(60, sd = 0.5) # Run the test result <- hatemicoint(y, x) print(result) summary(result)# Generate example data with structural breaks set.seed(123) n <- 200 x <- cumsum(rnorm(n)) # Create cointegrated series with two breaks y <- numeric(n) y[1:70] <- 1 + 0.8 * x[1:70] + rnorm(70, sd = 0.5) y[71:140] <- 3 + 1.2 * x[71:140] + rnorm(70, sd = 0.5) y[141:200] <- 2 + 0.6 * x[141:200] + rnorm(60, sd = 0.5) # Run the test result <- hatemicoint(y, x) print(result) summary(result)
Print Method for hatemicoint Objects
## S3 method for class 'hatemicoint' print(x, ...)## S3 method for class 'hatemicoint' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored). |
Invisibly returns the input object.
Summary Method for hatemicoint Objects
## S3 method for class 'hatemicoint' summary(object, ...)## S3 method for class 'hatemicoint' summary(object, ...)
object |
An object of class |
... |
Additional arguments (ignored). |
Invisibly returns a summary list with inference at various significance levels.