*! quasicoint.sthlp — Help for quasicoint v1.0.2 2026-05-09

Title

quasicoint -- Quasi-Cointegration Analysis without Unit Roots
(Duffy & Simons 2023, CWPE 2332)

Syntax

quasicoint
varlist
[if] [in]
[,
options]

The data must be tsset before calling quasicoint.
All variables must be numeric; time-series operators (L., D.) are allowed.
Variables should generally be in levels (not first differences) since
the method is designed for data with near-unit roots.

Model specification
rho(#) lower bound on dominant root; default 0.95

nroots(#) number of near-unit roots q; default 1

lags(#) VAR lag order k; 0 = auto-select via AIC (default)

maxlags(#) maximum lag order for AIC selection; default 8

noconstant suppress intercept in VAR

trend include linear trend in VAR

Inference
gridsize(#) number of grid points for lambda profile; default 50

nboot(#) Monte Carlo reps for NP test; default 2000

level(#) confidence level; default 95

Visualization
plot produce all three plots (profile, IRF, root map)

plotprofile profile likelihood + conditional CI plot only

plotirf impulse response function plot only

plotroots characteristic root map in complex plane only

saving(name) filename prefix for saved plots/exports; default quasicoint

Export
export(fmt) export results: excel, latex, csv, or all

Description

quasicoint implements the quasi-cointegration framework of
Duffy & Simons (2023), which extends standard
cointegration analysis to settings where the dominant autoregressive roots
may be near but not exactly equal to unity.

The problem. Elliott (1998) showed that
standard efficient estimators of cointegrating relationships (FM-OLS, DOLS,
Johansen ML) suffer severe size distortions when roots are near but not
exactly at unity — even within an O(n) neighbourhood that is
empirically indistinguishable from exact unit roots.

The solution. Rather than defining cointegration in terms of integration
orders — which becomes vacuous without exact unit roots — Duffy & Simons
identify long-run equilibrium relationships via the relative decay rates
of impulse responses. The resulting quasi-cointegrating space (QCS)
coincides exactly with the standard cointegrating space when unit roots are
present, but remains meaningful when they are not.

Key features:

(1) Spectral decomposition of the VAR companion matrix to isolate the
q most persistent components

(2) Profile likelihood across the dominant root lambda in [rho, 1]

(3) Conditional likelihood ratio tests (chi-squared) for the
quasi-cointegrating coefficients, given lambda

(4) Side-by-side comparison with standard Johansen estimates

(5) Correct L_LU/L_ST root classification with automatic warnings

(6) Publication-quality tables (5 tables) and plots (3 types)

(7) LaTeX (booktabs), Excel, and CSV export

Methodology

VAR model:

y_t = mu + delta*t + Phi_1 y_{t-1} + ... + Phi_k y_{t-k} + epsilon_t

Root separation. The characteristic roots of the companion matrix are
partitioned into:

L_LU = {z in C : |z| <= 1 and |z-1| <= 1-rho} — q near-unit roots

L_ST = complement — remaining stationary roots

Roots falling in L_LU have modulus close to 1, i.e. they represent the most
persistent shocks. The classification is based on the geometric criterion
|z-1| <= 1-rho, not merely on sort order.

Quasi-cointegrating space (QCS):

QCS := S_r = (sp R_LU)^-perp}

where R_LU is the p x q loading matrix for the near-unit eigenvalues. The QCS
collects the r = p - q linear combinations of y_t whose impulse responses
decay fastest.

Key theoretical results (Duffy & Simons 2023):

Proposition 2.2: When all q roots are exactly unity, the QCS
coincides with the standard Johansen cointegrating space.

Theorem 3.1: The loglikelihood ratio processes of the
quasi-cointegrated VAR and a predictive regression converge to the
same limiting experiment.

Theorem 3.2: The restricted MLE of beta (with correct Lambda_LU
imposed) is asymptotically mixed normal, generalising
Johansen (1995, Thm 13.3).

Theorem 3.3: The LR test for beta (given Lambda_LU) is
chi-squared(1), regardless of whether the dominant root equals unity.

Choice of rho. The lower bound rho is interpretable as a minimum half-life:
h = -log(2)/log(rho) periods. Guidelines:

Setting rho Half-life

Annual data, US cycles 0.917 ~8 years
Quarterly data 0.95 ~13.5 quarters
Quarterly, conservative 0.979 ~33 quarters
Monthly data 0.99 ~69 months

Normalisation. beta is normalised as [I_r, -A], where A contains
the free parameters. The first r variables are normalised to unity.

Options

Model specification

rho(#) sets the lower bound on the dominant root. This defines the
near-unit-root region L_LU. Smaller values afford greater robustness to
departures from exact unit roots, at the cost of potentially wider confidence
intervals. Interpretable as a minimum half-life constraint:
h = -log(2)/log(rho). Default: 0.95 (h ~ 13.5 periods).

nroots(#) specifies the number of near-unit roots q. For most bivariate
applications, q = 1. For trivariate systems with two stochastic trends,
q = 2. The QCS dimension is r = p - q. Default: 1.

lags(#) sets the VAR lag order. If 0 (default), the lag order is selected
automatically by minimising the Akaike information criterion, searching from
1 to maxlags().

maxlags(#) sets the maximum lag order for AIC search. Default: 8.

noconstant suppresses the intercept in the VAR.

trend includes a linear time trend in the VAR.

Inference

gridsize(#) controls the number of grid points for the profile
likelihood over lambda in [rho, 1]. More points give smoother plots but take
longer to compute. Default: 50.

nboot(#) sets the number of Monte Carlo replications for the
Elliott-Mueller-Watson nearly optimal test. Default: 2000.

level(#) sets the confidence level for conditional and robust CIs.
Default: 95.

Visualization

plot generates all three publication-quality plots saved as PNG:
(1) profile likelihood + conditional CIs (combined panel),
(2) impulse response functions,
(3) characteristic root map in the complex plane.

plotprofile generates only the profile likelihood + conditional CI plot.

plotirf generates only the IRF comparison plot.

plotroots generates only the characteristic root map.

saving(name) sets the filename prefix for plots and exports. Default:
"quasicoint". Files will be named name_profile.png, name_irf.png,
name_roots.png, name_quasicoint.tex, etc.

Export

export(fmt) exports results. Options: latex (booktabs table with
significance stars), csv (comma-separated), excel (xlsx), or
all (all formats).

Stored Results

quasicoint stores the following in e().

Scalars

e(N) number of observations used

e(p) number of variables

e(q) number of near-unit roots

e(r) dimension of QCS (= p - q)

e(k) VAR lag order

e(rho) lower bound on dominant root

e(halflife) half-life at rho (periods)

e(lambda_hat) estimated dominant root (modulus)

e(LR_lambda) LR statistic for H0: lambda = 1

e(level) confidence level

e(gridsize) number of grid points used

Matrices

e(b) 1 x q vector of free QCS coefficients (the A parameters)

e(V) q x q variance-covariance matrix for e(b)

e(beta_qcs) p x r quasi-cointegrating vectors (full, normalised)

e(beta_johansen) p x r Johansen cointegrating vectors (for comparison)

e(eigenvalues) kp x 3 matrix: (real part, imag part, modulus)

e(R_LU) p x q loading matrix R_LU

e(Lambda_LU) q x q diagonal matrix of near-unit eigenvalues

e(profile_ll) gridsize x 2 matrix: (lambda, log-likelihood)

e(profile_grid) gridsize x 1 vector of lambda grid points

e(cond_ci) gridsize x 3 matrix: (lambda, beta_hat, SE)

e(IRF_qc) (p*H) x p impulse response matrix

e(IRF_johansen) (p*H) x p Johansen IRF (for comparison)

e(np_ci) 1 x 2 nearly optimal CI bounds (when available)

Strings

e(cmd) quasicoint

e(cmdline) full command as typed

e(varlist) variable names

e(timevar) time variable

e(title) Quasi-Cointegration (Duffy & Simons 2023)

e(paper) bibliographic reference

e(vcetype) Conditional LR (chi-squared)

Output Tables

quasicoint displays five publication-quality tables:

Table 1 — Characteristic Roots: All roots of the VAR companion
matrix, with modulus, half-life, and L_LU/L_ST classification using the
geometric criterion |z-1| <= 1-rho. A WARNING is issued if no roots
fall in the L_LU region.

Table 2 — QCS Vectors: The quasi-cointegrating vector(s)
alongside Johansen estimates and their difference. When unit roots hold
exactly, the difference should be zero.

Table 3 — Profile Likelihood: Summary statistics including
the estimated dominant root, LR statistic for H0: lambda=1, p-value,
and unit-root rejection/non-rejection conclusion.

Table 4 — Conditional CIs: Confidence intervals for beta
conditional on each value of lambda in the grid, along with half-life
interpretation.

Table 5 — Robust CIs: Elliott-Mueller-Watson nearly optimal
confidence interval and conditional CIs at lambda=1 and at the
profile-likelihood-maximising lambda.

Examples

Example 1: Basic usage — bivariate levels with near-unit root

. webuse lutkepohl2, clear

. tsset qtr

. quasicoint ln_inv ln_inc, rho(0.95)

This estimates a VAR(k) on ln_inv and ln_inc (log levels of
investment and income), selects k via AIC, computes the dominant root
(lambda_hat ~ 0.994), identifies it as L_LU, and reports the QCS vector
beta = (1, -0.857) alongside the Johansen estimate.

Example 2: Three variables in levels

. quasicoint ln_inv ln_inc ln_consump, rho(0.95) nroots(1)

With p=3 and q=1, the QCS has dimension r=2. The two quasi-cointegrating
vectors capture the two fastest-decaying linear combinations.

Example 3: Full analysis with plots and LaTeX export

. quasicoint ln_inv ln_inc, rho(0.95) plot export(latex) saving(myresults)

Generates: myresults_profile.png, myresults_irf.png,
myresults_roots.png, and myresults_quasicoint.tex.

Example 4: Specific lag order

. quasicoint ln_inv ln_inc, rho(0.95) lags(4)

Forces a VAR(4) specification instead of AIC auto-selection.

Example 5: Term structure application (yields)

. * Load your yield data

. tsset date

. quasicoint yield10y yield1y, rho(0.979) nroots(1) plot

Under the expectations hypothesis, the QCS coefficient equals
a_10(lambda) = (1/10)(1-lambda^10)/(1-lambda). At lambda=1 this gives
a_10 = 1 (standard cointegration). At lambda < 1, a_10 < 1.

Example 6: Profile likelihood plot only

. quasicoint ln_inv ln_inc, rho(0.95) plotprofile saving(profile_only)

Example 7: Root map only

. quasicoint ln_inv ln_inc ln_consump, rho(0.95) nroots(1) plotroots

Example 8: Post-estimation

. quasicoint ln_inv ln_inc, rho(0.95)

. di "Dominant root: " %8.5f e(lambda_hat)

. di "LR(lambda=1): " %8.3f e(LR_lambda)

. matrix list e(b)

. matrix list e(beta_qcs)

. matrix list e(beta_johansen)

. matrix list e(eigenvalues)

Example 9: Robustness across rho values

. foreach r in 0.90 0.95 0.98 0.99 {

. qui quasicoint ln_inv ln_inc, rho(`r')

. di "rho=`r': beta=" %8.4f e(b)[1,1] " lambda=" %8.5f e(lambda_hat)

. }

The QCS coefficient should remain stable across rho values (as demonstrated
with beta = -0.857 for all rho in the Lutkepohl dataset).

Example 10: Export all formats

. quasicoint ln_inv ln_inc, rho(0.95) export(all) saving(results)

Diagnostics and Warnings

WARNING: No root in L_LU. If no characteristic root falls in the
near-unit region L_LU = {|z-1| <= 1-rho}, the data may already be
stationary. Common causes:

(a) Variables are first differences or growth rates instead of
levels.

(b) The series are I(0) and cointegration analysis is
inappropriate.

(c) The rho bound is too tight — try a smaller value.

lambda_hat < rho. When the dominant root falls below the lower bound,
the profile likelihood is computed over [rho, 1] and the results should be
interpreted cautiously.

lambda_hat > 1. An explosive root indicates possible model
misspecification (too many lags) or structural instability. The L_LU
criterion |z| <= 1 naturally excludes explosive roots.

QCS = Johansen. When the difference between QCS and Johansen estimates
is exactly zero (or very small), it confirms that the unit root assumption is
appropriate for the data. This is the key validation of Proposition 2.2 in
Duffy & Simons (2023).

References

Duffy, J.A. & Simons, J.R. (2023).
Cointegration without Unit Roots.
Cambridge Working Papers in Economics 2332.
https://www.econ.cam.ac.uk/cwpe

Elliott, G. (1998).
On the robustness of cointegration methods when regressors almost have
unit roots.
Econometrica, 66, 149-158.

Elliott, G., Mueller, U.K. & Watson, M.W. (2015).
Nearly optimal tests when a nuisance parameter is present under the null.
Econometrica, 83, 771-811.

Johansen, S. (1995).
Likelihood-based Inference in Cointegrated Vector Autoregressive Models.
Oxford University Press.

Mueller, U.K. & Watson, M.W. (2013).
Low-frequency robust cointegration testing.
Journal of Econometrics, 174, 66-81.

Phillips, P.C.B. & Hansen, B.E. (1990).
Statistical inference in instrumental variables regression with I(1)
processes.
Review of Economic Studies, 57, 99-125.

Lutkepohl, H. (2005).
New Introduction to Multiple Time Series Analysis.
Springer.

Author

Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

Package: search quasicoint

This package implements the quasi-cointegration framework of

Duffy & Simons (2023, CWPE 2332), Cambridge University.

See also: vec, var, vecrank

Bug reports and suggestions: merwanroudane920@gmail.com