Skip to main content

7.5. Threshold Autoregression and Markov Regime Switching

Verified Environments & Platforms:EcoDataEcoLabFincoVietLOD

Methodological Part 7.5. Threshold Autoregression and Markov Regime Switching in 7. Multivariate Time Series, Local Projections and Spillover Networks provides step-by-step How-To implementation guides for 3 econometric model lessons spanning from Section 7.5.1 to 7.5.3. Full theoretical derivations are available at VietLOD Part 7.5 alongside cloud execution on EcoLab.

Video Tutorial: How-To Guide for Part 7.5: Threshold Autoregression and Markov Regime Switching in Stata 18, R 4.x, and Python 3.11+

7.5.1. Methodological Overview and Structural Equations​

  • Methodological Focus: Provides consistent estimation and robust inference for Threshold Autoregression and Markov Regime Switching specifications within Multivariate Time Series, Local Projections and Spillover Networks.
  • Mandatory Post-Estimation Diagnostics: Kiểm định tính phi tuyến ngưỡng Hansen Sup-(LM) có Bootstrap, ước lượng lưới tìm ngưỡng γ\gamma và độ trễ ngưỡng dd tối ưu hóa tổng bình phương phần dư, và kiểm định nhiễu trắng phần dư.

Core structural specification for Part 7.5:

Yt=(ϕ1,0+ϕ1,1Yt−1)I(Yt−d≤γ)+(ϕ2,0+ϕ2,1Yt−1)I(Yt−d>γ)+εtY_t = (\phi_{1,0} + \phi_{1,1}Y_{t-1})\mathbb{I}(Y_{t-d} \le \gamma) + (\phi_{2,0} + \phi_{2,1}Y_{t-1})\mathbb{I}(Y_{t-d} \gt \gamma) + \varepsilon_t

Estimator objective and moment conditions:

Yt=c+∑ℓ=1pAℓYt−ℓ+B−1Σuεt,Ψh=∂Yt+h∂εt⊤=ΦhB−1ΣuY_t = c + \sum_{\ell=1}^p A_\ell Y_{t-\ell} + B^{-1}\Sigma_u \varepsilon_t, \quad \Psi_h = \frac{\partial Y_{t+h}}{\partial \varepsilon_t^\top} = \Phi_h B^{-1}\Sigma_u
Methodological Scope Boundary:When empirical data violate the identification conditions of Part 7.5, researchers should transition to the extended methodological parts in Chapter 7 or apply appropriate instrumental-variable and cluster-robust corrections.

7.5.2. Econometric Model Lessons in Part 7.5​

7.5.3. Comparative Execution Syntax Across Stata 18, R 4.x, and Python 3.11+​

Section & Model TitleEstimator KeyStata 18 MP SyntaxR 4.x SyntaxPython 3.11+ SyntaxSupport
7.5.1 · Self-Exciting Threshold Autoregression — SETARsetarthreshold y, threshvar(L.y) regionvars(L.y)tsDyn::setar(df$y, m = 1, thDelay = 1)smf.ols('y ~ l1_y * I(l1_y > gamma)', data=df).fit(cov_type='HC1')Available
7.5.2 · Hamilton Markov Regime-Switching Regressionmarkov_regressionmswitch dr y x1, states(2) varswitchMSwM::msmFit(lm(y ~ x1, data = df), k = 2, sw = c(TRUE, TRUE, TRUE))MarkovRegression(df['y'], k_regimes=2, exog=df[['x1']], switching_variance=True).fit()Available
7.5.3 · Multivariate Markov-Switching Vector Autoregressionms_varmswitch dr y x1 x2, states(2) varswitchMSwM::msmFit(lm(y ~ l1_y + x1, data = df), k = 2, sw = c(TRUE, TRUE, TRUE, TRUE))MarkovAutoregression(df['y'], k_regimes=2, order=1, exog=df[['x1']]).fit()Available

7.5.4. Standard Implementation Workflow for Part 7.5​

Step 1. Load Standardized Practice Datasets From VietLOD, EcoData, or Finco

Download the model-specific .csv practice dataset in Part 7.5 or extract custom empirical panels from EcoData and Finco.

Step 2. Select the Optimal Estimator for Your Error and Sample Structure

Compare the estimators from 7.5.1 to 7.5.3 in the syntax matrix above and execute the estimation in Stata 18 MP, R 4.x, or Python 3.11+.

Step 3. Run Mandatory Diagnostics and Export Publication Tables on EcoLab

Verify all required diagnostics including Kiểm định tính phi tuyến ngưỡng Hansen Sup-(LM) có Bootstrap, ước lượng lưới tìm ngưỡng γ\gamma và độ trễ ngưỡng dd tối ưu hóa tổng bình phương phần dư, và kiểm định nhiễu trắng phần dư and dispatch the specification to EcoLab for automated journal-grade reporting.