cointsmall

R-CMD-check CRAN status

Overview

The cointsmall package implements cointegration tests with structural breaks designed specifically for small sample sizes. It follows the methodology of Trinh (2022), which provides small-sample adjusted critical values for testing the null hypothesis of no cointegration.

Installation

# Install from CRAN (when available)
install.packages("cointsmall")

# Or install the development version from GitHub

Features

Usage

Basic Cointegration Test

library(cointsmall)

# Generate cointegrated series
set.seed(42)
n <- 50
e <- cumsum(rnorm(n))  # Common stochastic trend
y <- 2 + 3 * e + rnorm(n, sd = 0.5)
x <- e + rnorm(n, sd = 0.3)

# Test with no structural break
result <- cointsmall(y, x, breaks = 0)
print(result)

Testing with Structural Breaks

# Generate series with structural break
y_break <- c(2 + 2 * e[1:25], 5 + 4 * e[26:50]) + rnorm(n, sd = 0.3)

# Test with one break (break in constant and slope)
result <- cointsmall(y_break, x, breaks = 1, model = "cs")
print(result)
summary(result)

Combined Testing Procedure

# Test all model specifications
combined <- cointsmall_combined(y_break, x, breaks = 1)
print(combined)

Critical Values

# Get critical values for specific parameters
cv <- cointsmall_cv(T = 50, m = 1, breaks = 1, model = "cs")
print(cv)

Models

Model Description Cointegrating Regression
o No break y = α + β’x + ε
c Break in constant y = α₁ + α₂D + β’x + ε
cs Break in constant and slope y = α₁ + α₂D + β₁’x + β₂’(x·D) + ε

Where D is a dummy variable equal to 1 after the break date.

References

Author

License

GPL (>= 3)