| boundedur | R Documentation |
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.
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
)
y |
Numeric vector. The time series to test. |
lbound |
Numeric. Lower bound for the series. |
ubound |
Numeric or |
test |
Character. Which test(s) to perform. One of:
|
lags |
Integer or |
maxlag |
Integer or |
detrend |
Character. Detrending method:
|
nsim |
Integer. Number of Monte Carlo replications for p-value computation. Default is 499. |
nstep |
Integer or |
seed |
Integer or |
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.
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 |
Augmented Dickey-Fuller normalized bias: T(\hat{\rho} - 1)
Augmented Dickey-Fuller t-statistic for \rho
Modified Phillips-Perron normalized bias
Modified Phillips-Perron t-statistic
Modified Sargan-Bhargava statistic
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.
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")}
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.