| Type: | Package |
| Title: | Maki Cointegration Test with Structural Breaks |
| Version: | 1.0.0 |
| Date: | 2025-10-26 |
| Description: | Implements the Maki (2012) <doi:10.1016/j.econmod.2012.05.006> cointegration test that allows for an unknown number of structural breaks. The test detects cointegration relationships in the presence of up to five structural breaks in the intercept and/or slope coefficients. Four different model specifications are supported: level shifts, level shifts with trend, regime shifts, and trend with regime shifts. The method is described in Maki (2012) "Tests for cointegration allowing for an unknown number of breaks" <doi:10.1016/j.econmod.2012.05.006>. |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| Depends: | R (≥ 3.5.0) |
| Suggests: | testthat (≥ 3.0.0), knitr, rmarkdown |
| VignetteBuilder: | knitr |
| RoxygenNote: | 7.3.3 |
| URL: | https://github.com/merwanroudane/makicoint |
| BugReports: | https://github.com/merwanroudane/makicoint/issues |
| NeedsCompilation: | no |
| Packaged: | 2025-10-31 02:38:31 UTC; HP |
| Author: | Merwan Roudane [aut, cre] (Independent Researcher) |
| Maintainer: | Merwan Roudane <merwanroudane920@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2025-11-04 10:50:02 UTC |
Maki Cointegration Test with Structural Breaks
Description
Performs the Maki (2012) cointegration test that allows for an unknown number of structural breaks. The test detects cointegration relationships in the presence of up to five structural breaks.
Usage
coint_maki(y, m = 1, model = 0, trimm = 0.15, lagoption = 1)
Arguments
y |
Matrix or data frame with dependent variable in first column and independent variable(s) in remaining columns. |
m |
Maximum number of breaks to test (0-3). Values 4-5 require extended implementation. |
model |
Model specification (0-3):
|
trimm |
Trimming parameter (default 0.15). Determines the minimum distance between breaks as a fraction of sample size. |
lagoption |
Lag selection (0=no lags, 1=optimal lags using t-sig criterion). |
Value
A list with class "maki_test" containing:
statistic |
The test statistic (minimum tau) |
breakpoints |
Vector of detected break point locations |
critical_values |
Critical values at 1%, 5%, and 10% levels |
reject_1 |
Logical; reject null at 1% level? |
reject_5 |
Logical; reject null at 5% level? |
reject_10 |
Logical; reject null at 10% level? |
conclusion |
Text conclusion of the test |
m |
Number of breaks tested |
model |
Model specification used |
n |
Sample size |
References
Maki, D. (2012). Tests for cointegration allowing for an unknown number of breaks. Economic Modelling, 29(5), 2011-2015.
Examples
# Generate cointegrated series with one break
set.seed(123)
n <- 100
e1 <- rnorm(n)
e2 <- rnorm(n)
x <- cumsum(e1)
y <- 0.5 * x + cumsum(e2)
y[51:100] <- y[51:100] + 2 # Add structural break
# Run Maki test
data <- cbind(y, x)
result <- coint_maki(data, m=1, model=0)
print(result)
Get Critical Values for Maki Cointegration Test
Description
Returns critical values for the Maki cointegration test based on Maki (2012) Table 1.
Usage
cv_coint_maki(n, m, model)
Arguments
n |
Sample size (currently not used as values are asymptotic). |
m |
Number of breaks (0-5). |
model |
Model specification (0-3):
|
Value
Numeric vector of critical values at 1%, 5%, and 10% significance levels.
Examples
# Get critical values for m=1, model=0
cv_coint_maki(100, m=1, model=0)
Compute DF Tau Statistic
Description
Computes the Dickey-Fuller tau statistic for unit root testing.
Usage
dftau(dy, x)
Arguments
dy |
Numeric vector of first differences of residuals. |
x |
Matrix of lagged residuals and differenced lags. |
Value
A list containing:
tau |
The tau statistic (t-statistic for the first coefficient) |
s2 |
Sum of squared residuals |
Detect One Structural Break
Description
Internal function to detect one structural break in the cointegration relationship.
Usage
mbreak1(datap, n, model, tb, lagoption)
Arguments
datap |
Data matrix with dependent variable in first column. |
n |
Sample size. |
model |
Model specification (0-3). |
tb |
Trimming parameter (number of observations). |
lagoption |
Lag selection option (0 or 1). |
Value
List with tau statistic and break point location.
Detect Two Structural Breaks
Description
Detect Two Structural Breaks
Usage
mbreak2(datap, n, model, tb, lagoption)
Detect Second Break Before First Break
Description
Detect Second Break Before First Break
Usage
mbreak21(datap, n, model, tb, bp1, lagoption)
Detect Second Break After First Break
Description
Detect Second Break After First Break
Usage
mbreak22(datap, n, model, tb, bp1, lagoption)
Determine Optimal Lag Using t-sig Criterion
Description
Determines the optimal lag length using the t-significance criterion with a maximum lag of 12.
Usage
opttlag(e)
Arguments
e |
Numeric vector of residuals. |
Value
Integer indicating the optimal lag length.
Main Procedure for Maki Cointegration Test
Description
Internal procedure function that orchestrates the break detection process.
Usage
pf(y, m, model, trimm = 0.15, lagoption = 1)
Arguments
y |
Matrix or data frame with dependent variable in first column. |
m |
Maximum number of breaks (0-5). |
model |
Model specification (0-3). |
trimm |
Trimming parameter (default 0.15). |
lagoption |
Lag selection option (0=no lags, 1=optimal lags). |
Value
List with test statistic and breakpoints.
Print Method for Maki Test Results
Description
Prints a formatted summary of the Maki cointegration test results, including test statistic, break points, critical values, and conclusions.
Usage
## S3 method for class 'maki_test'
print(x, ...)
Arguments
x |
An object of class "maki_test" returned by |
... |
Additional arguments (currently unused) |
Value
Returns the input object x invisibly. This function is
called primarily for its side effect of printing formatted test results
to the console.