Package {makicoint}


Type: Package
Title: Maki Cointegration Test with Multiple Structural Breaks
Version: 2.0.0
Date: 2026-06-30
Description: Implements the Maki (2012) <doi:10.1016/j.econmod.2012.04.022> residual-based test for cointegration allowing for an unknown number of structural breaks. Breaks are located by a sequential procedure and the cointegrating residual is tested for a unit root with an augmented Dickey-Fuller (ADF) regression; the test statistic is the minimum ADF t-statistic over all candidate breaks. Four model specifications are supported (level shift, level shift with trend, regime shift, and regime shift with trend) and one to four regressors. The default engine reproduces the original 'GAUSS' / 'tspdlib' implementation, with an optional break rule following Maki (2012, Steps 2 and 4). The test runs for any feasible number of breaks; beyond the five tabulated by Maki, critical values can be simulated by his Monte-Carlo design. A two-panel diagnostic plot is provided via 'ggplot2'.
License: GPL-3
Encoding: UTF-8
Depends: R (≥ 3.5.0)
Imports: stats
Suggests: ggplot2, 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: 2026-06-30 01:57:22 UTC; HP
Author: Merwan Roudane [aut, cre, cph] (Independent Researcher)
Maintainer: Merwan Roudane <merwanroudane920@gmail.com>
Repository: CRAN
Date/Publication: 2026-06-30 07:10:02 UTC

Maki (2012) Cointegration Test with Multiple Structural Breaks

Description

Performs the Maki (2012) residual-based test for cointegration allowing for an unknown number of structural breaks, up to a user-set maximum. Breaks are found by the sequential Bai-Perron procedure and the cointegrating residual is tested for a unit root with an augmented Dickey-Fuller (ADF) regression; the test statistic is the minimum ADF t-statistic over all candidate breaks.

Usage

coint_maki(
  data,
  m = 2,
  model = 2,
  trimm = 0.1,
  lagmethod = c("tsig", "fixed", "zero", "aic", "bic"),
  maxlags = 12,
  engine = c("gauss", "paper"),
  simcv = 0,
  simt = 1000,
  simseed = 12345
)

## S3 method for class 'maki_test'
print(x, ...)

Arguments

data

A matrix or data frame with the dependent variable in the first column and one to four regressors in the remaining columns.

m

Maximum number of structural breaks (integer >= 1), subject to feasibility for the sample size and trimm.

model

Model specification (0:3); see cv_coint_maki.

trimm

Trimming fraction in (0, 0.5); the minimum regime length as a fraction of the sample. Default 0.10.

lagmethod

ADF lag rule: "tsig" (default, general-to-specific t-significance), "fixed" (use maxlags), "zero", "aic" or "bic".

maxlags

Maximum ADF lag order. Default 12.

engine

"gauss" (default) or "paper"; see Details.

simcv

Number of Monte-Carlo replications for simulated critical values. 0 (default) uses the Table 1 values for m <= 5. Required for inference when m > 5.

simt

Series length used by the simulation. Default 1000.

simseed

Random seed for the simulation. Default 12345.

x

A "maki_test" object.

...

Unused.

Details

By default the break dates follow the original 'GAUSS'/'tspdlib' rule (the segment with the smallest minimum ADF t-statistic, break at the ADF-regression sum-of-squared-residuals minimiser). With engine = "paper" each break is the global minimiser of the cointegrating-regression sum of squared residuals, the rule stated in Maki (2012, Steps 2 and 4). The two engines give the same test statistic but may place the breaks differently for two or more breaks.

Maki (2012, Table 1) tabulates critical values for one to five breaks. For more than five breaks (his footnote 5 notes the test can use more), set simcv to simulate the critical values by his Monte-Carlo design.

Value

An object of class "maki_test": a list with the test statistic, breakpoints (observation indices), break_fractions, critical_values, cv_source ("table", "simulated" or "none"), reject_1, reject_5, reject_10, conclusion, m, model, n, k, lags, engine and related fields.

print.maki_test returns x invisibly.

References

Maki, D. (2012). Tests for cointegration allowing for an unknown number of breaks. Economic Modelling, 29, 2011-2015. doi:10.1016/j.econmod.2012.04.022

Bai, J. and Perron, P. (1998). Estimating and testing linear models with multiple structural changes. Econometrica, 66, 47-78. doi:10.2307/2998540

Examples

# A cointegrated pair with a level break at observation 30
set.seed(1)
n <- 60
x <- cumsum(rnorm(n))
y <- 2 + 3 * x + 4 * (seq_len(n) > 30) + rnorm(n)
res <- coint_maki(cbind(y, x), m = 1, model = 2)
res


# Two breaks, regime-shift model
coint_maki(cbind(y, x), m = 2, model = 2)


Critical Values for the Maki (2012) Cointegration Test

Description

Returns the asymptotic critical values from Maki (2012), Table 1, for a given number of regressors, number of breaks, and model.

Usage

cv_coint_maki(k, m, model)

Arguments

k

Number of regressors (independent variables), an integer in 1:4. The Maki (2012) table covers up to four regressors.

m

Number of breaks, an integer in 1:5.

model

Model specification, an integer in 0:3:

  • 0: level shift

  • 1: level shift with trend

  • 2: regime shift

  • 3: regime shift with trend

Value

A numeric vector of length three with the 1%, 5% and 10% critical values, or c(NA, NA, NA) outside the tabulated range.

References

Maki, D. (2012). Tests for cointegration allowing for an unknown number of breaks. Economic Modelling, 29, 2011-2015. doi:10.1016/j.econmod.2012.04.022

Examples

# Regime-shift model, two regressors, three breaks
cv_coint_maki(k = 2, m = 3, model = 2)

Plot a Maki Cointegration Test Result

Description

Draws a two-panel dashboard with 'ggplot2': the dependent variable with its break-adjusted long-run fit and shaded regimes (top), and the cointegrating residual about zero (bottom), with dashed lines at the estimated breaks.

Usage

## S3 method for class 'maki_test'
plot(x, ...)

Arguments

x

A "maki_test" object from coint_maki.

...

Unused.

Value

A ggplot object (invisibly), or NULL if 'ggplot2' is not installed.

Examples

set.seed(1)
n <- 60
x <- cumsum(rnorm(n))
y <- 2 + 3 * x + 4 * (seq_len(n) > 30) + rnorm(n)
res <- coint_maki(cbind(y, x), m = 1, model = 2)
if (requireNamespace("ggplot2", quietly = TRUE)) plot(res)