*! version 1.00.00 24jan2026

Title

tnardl -- Threshold Non-linear ARDL Estimator with Automatic Grid Search

Syntax

tnardl depvar [indepvars] [if] [in] , target(varname) [options]

Model Specification
target(varname) specify the threshold variable (required)

maxlags(#) set maximum number of lags for automatic selection; default is 2

trim(#) set trimming percentage for grid search (10-40); default is 15

criterion(string) model selection criterion: aic (default) or bic

Reporting
nograph suppress stability (CUSUM) and dynamic multiplier graphs

trim(#) widen search bounds if computation fails due to collinearity

tnardl requires the ardl package to be installed (ssc install ardl).

Description

tnardl estimates a Three-Regime Threshold Non-linear Autoregressive Distributed Lag (TNARDL) model.
Unlike standard NARDL models that assume a fixed threshold (usually zero), tnardl endogenously determines
two optimal threshold values (s1, s2) using a grid search algorithm that minimizes the Residual Sum of Squares (RSS).

The command partitions the target() variable into three partial sum processes:

1. Positive Regime: Changes when the target variable is above the upper threshold (s2).

2. Medium Regime: Changes when the target variable is between (s1) and (s2).

3. Negative Regime: Changes when the target variable is below the lower threshold (s1).

The command automatically performs:

- Lag selection for the dependent and independent variables.

- Bounds testing for cointegration (Pesaran et al., 2001).

- Calculation of Long-Run Multipliers (Elasticities) with significance levels.

- Comprehensive Wald tests for Long-run, Short-run, and Joint asymmetry.

- Diagnostic tests (Serial Correlation, Heteroskedasticity, Normality, Functional Form).

- Plotting of CUSUM, CUSUMQ, and Dynamic Multiplier trajectories.

Options

target(varname) is required. It specifies the variable used to determine the non-linear thresholds.
The algorithm searches for structural breaks/thresholds within the distribution of the first difference of this variable.

maxlags(#) specifies the maximum number of lags to be considered for the ARDL model.
The optimal lag structure is chosen based on the specified information criterion. The default is 4 (suitable for annual/quarterly data).

trim(#) specifies the trimming percentage for the grid search. It restricts the search for thresholds to the range
[trim-th percentile, (100-trim)-th percentile]. The default is 15 (searching between the 15th and 85th percentiles).
Note: If you encounter "Computation failed" or singular matrix errors, try increasing this value (e.g., trim(25)) to ensure enough observations fall into the medium regime.

criterion(string) specifies the information criterion used to select the optimal lag length.
It may be aic (Akaike Information Criterion) or bic (Bayesian Information Criterion). The default is aic.

nograph suppresses the generation of the CUSUM, CUSUMQ, and Dynamic Multiplier graphs.

Examples

Example 1: Basic usage with default settings

. sysuse auto, clear

. gen t = _n

. tsset t

. tnardl price weight length, target(mpg)

Example 2: Specifying lags and criterion

. tnardl GDP Trade Openness, target(INF) maxlags(4) criterion(bic)

Example 3: Handling collinearity issues by widening the trimming parameter

. tnardl GDP Invest, target(RER) trim(25)

Saved results

tnardl saves the following in e():

Scalars

e(s1) Lower optimal threshold value

e(s2) Upper optimal threshold value

e(rss_min) Minimum Residual Sum of Squares achieved

Matrices

e(asymmetry_tests) Matrix containing F-stats and P-values for Wald tests

e(diag_results) Matrix containing diagnostic test statistics

Functions

e(sample) Marks estimation sample

Stored results

tnardl stores the following in e():

Scalars

e(s1) Lower optimal threshold value

e(s2) Upper optimal threshold value

e(rss_min) Minimum Residual Sum of Squares achieved

Macros

e(cmd) tnardl

e(cmdline) command as typed

e(depvar) name of dependent variable

Matrices

e(b) Coefficient vector

e(V) Variance-covariance matrix of the estimators

e(sym_test) Matrix containing Wald test results for asymmetry

e(diagnostics) Matrix containing diagnostic test statistics and p-values

The command creates system variables (target_POS, target_MED, target_NEG) representing the partial sum processes based on the detected thresholds.

Author

Prof. Imadeddin A. Almosabbeh

Arab East Colleges, Saudi Arabia, Riyadh

Email: msbbh68@hotmail.com, iaalmosabbeh@arabeast.edu.sa

Please cite this command as:

Almosabbeh, I. A. (2026). TNARDL: Stata module to estimate Threshold Non-linear ARDL models.

References

Shin, Y., Yu, B., & Greenwood-Nimmo, M. (2014). Modelling Asymmetric Cointegration and Dynamic Multipliers in a Nonlinear ARDL Framework.
Festschrift in Honor of Peter Schmidt, 281-314.

Hansen, B. E. (1999). Threshold effects in non-dynamic panels: Estimation, testing, and inference.
Journal of Econometrics, 93(2), 345-368.

Pesaran, M. H., Shin, Y., & Smith, R. J. (2001). Bounds testing approaches to the analysis of level relationships.
Journal of Applied Econometrics, 16(3), 289-326.