boundedur: Unit Root Tests for Bounded Time Series

View source: R/boundedur.R

boundedurR Documentation

Unit Root Tests for Bounded Time Series

Description

Performs unit root tests for time series constrained within known bounds, following the methodology of Cavaliere and Xu (2014). Provides modified ADF and M-type test statistics with p-values computed via Monte Carlo simulation of bounded Brownian motion.

Usage

boundedur(
  y,
  lbound,
  ubound = Inf,
  test = c("all", "adf", "adf_alpha", "adf_t", "mz_alpha", "mz_t", "msb"),
  lags = NULL,
  maxlag = NULL,
  detrend = c("constant", "none"),
  nsim = 499,
  nstep = NULL,
  seed = NULL
)

Arguments

y

Numeric vector. The time series to test.

lbound

Numeric. Lower bound for the series.

ubound

Numeric or Inf. Upper bound for the series. Use Inf for one-sided (lower bound only) testing.

test

Character. Which test(s) to perform. One of:

  • "all": All available tests (default)

  • "adf": Both ADF-alpha and ADF-t

  • "adf_alpha": ADF normalized bias test only

  • "adf_t": ADF t-statistic test only

  • "mz_alpha": MZ-alpha test only

  • "mz_t": MZ-t test only

  • "msb": MSB test only

lags

Integer or NULL. Number of lagged differences to include. If NULL (default), selected automatically using MAIC.

maxlag

Integer or NULL. Maximum lag for automatic selection. If NULL, uses floor(12 * (T/100)^0.25).

detrend

Character. Detrending method:

  • "constant": Demean the series (default)

  • "none": No detrending

nsim

Integer. Number of Monte Carlo replications for p-value computation. Default is 499.

nstep

Integer or NULL. Number of discretization steps for Brownian motion simulation. If NULL, uses sample size T.

seed

Integer or NULL. Random seed for reproducibility.

Details

Standard unit root tests assume the series is unbounded, leading to non-standard limiting distributions when bounds are present. This function implements the bounded unit root tests of Cavaliere and Xu (2014), which account for the effect of bounds on the limiting distribution.

The null hypothesis is that the series has a unit root while respecting the bounds. The alternative is stationarity.

Value

An object of class "boundedur" containing:

statistics

Named vector of test statistics

p_values

Named vector of p-values

results

Data frame with statistics, p-values, and decisions

n

Sample size

lags

Number of lags used

lbound

Lower bound

ubound

Upper bound

c_lower

Standardized lower bound parameter

c_upper

Standardized upper bound parameter

sigma2_lr

Long-run variance estimate

detrend

Detrending method used

nsim

Number of Monte Carlo replications

call

The matched call

Test Statistics

ADF-alpha

Augmented Dickey-Fuller normalized bias: T(\hat{\rho} - 1)

ADF-t

Augmented Dickey-Fuller t-statistic for \rho

MZ-alpha

Modified Phillips-Perron normalized bias

MZ-t

Modified Phillips-Perron t-statistic

MSB

Modified Sargan-Bhargava statistic

P-value Computation

P-values are computed by Monte Carlo simulation of bounded Brownian motion. The number of replications (nsim) controls accuracy; larger values give more precise p-values but increase computation time.

References

Cavaliere, G., & Xu, F. (2014). Testing for unit roots in bounded time series. Journal of Econometrics, 178(2), 259-272. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jeconom.2013.08.012")}

Ng, S., & Perron, P. (2001). Lag length selection and the construction of unit root tests with good size and power. Econometrica, 69(6), 1519-1554. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/1468-0262.00256")}

Examples

# Generate bounded random walk (interest rate between 0 and 10)
set.seed(123)
n <- 200
y <- numeric(n)
y[1] <- 5
for (i in 2:n) {
  y[i] <- y[i-1] + rnorm(1, 0, 0.5)
  y[i] <- max(0, min(10, y[i]))  # Reflect at bounds
}

# Test for unit root with known bounds
result <- boundedur(y, lbound = 0, ubound = 10, nsim = 199)
print(result)
summary(result)

# One-sided bound (e.g., price level, lower bound = 0)
result_lower <- boundedur(y, lbound = 0, ubound = Inf, nsim = 199)


boundedur documentation built on March 16, 2026, 5:08 p.m.