NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Recursive Score and Hessian Computation in Regime-Switching Models

Chao‐Jun Li, Shi QiuarXiv 2022 · DOI

TL;DR

This paper introduces a streamlined, recursive algorithm to simultaneously calculate the score vector and Hessian matrix for regime-switching models. By bypassing complex mathematical identities and smoothed probabilities, the authors provide a more stable and "plug-and-play" method for researchers to perform statistical inference. Surprisingly, their simulations show that the simpler "Outer Product of the Score" (OPG) estimator often provides more accurate confidence intervals than the exact Hessian in finite samples.

What Problem Does This Paper Address?

Regime-switching models—where a process (like GDP growth or stock volatility) jumps between different hidden states or "regimes"—are staples in econometrics. However, estimating the reliability of these models (calculating standard errors) is notoriously difficult.

To get these errors, you need the Score (the gradient of the likelihood) and the Hessian (the curvature of the likelihood). While algorithms exist to find the score, calculating the Hessian analytically is so cumbersome that most researchers rely on slow, potentially unstable numerical approximations. Existing analytical methods often require "Fisher’s" or "Louis’" identities—complex transformations that are difficult to generalize beyond simple models. The authors aim to provide a unified, recursive framework that is easy to implement and numerically stable.

Methods

The authors develop a recursive framework that integrates directly into the standard "prediction and update" steps used to evaluate likelihood functions in hidden Markov models.

Key features of the method include:

  • Direct Derivatives: Instead of using complex identities to relate "complete-data" likelihood to "observed-data" likelihood, the algorithm works directly with the first and second derivatives of the period likelihood function.
  • Recursive Structure: The score and Hessian are updated at each time step $t$ based on values from $t-1$. This means you don't need to store the entire history of "smoothed probabilities" for the latent states.
  • Numerical Re-scaling: To prevent the "floating-point" math from breaking (overflowing to infinity or underflowing to zero) during long time series, the authors include a re-scaling step at every iteration.
  • Generality: The framework is designed for a general regime-switching specification that covers most autoregressive models used in empirical literature.

Datasets

The paper does not use real-world empirical datasets. Instead, it employs Monte Carlo simulations to test the algorithm's performance.

  • Models: They tested various Autoregressive (AR) models with regime-switching in the mean ($\mu$), variance ($\sigma$), and autoregressive coefficient ($\phi$).
  • Setup: They generated 1,000 datasets for each model variant with sample sizes ranging from $n=100$ to $n=800$.

Key Insights and Ideas

  • Simplicity is Key: The biggest "aha" moment is that you don't need the complex machinery of Fisher’s or Louis’ identities to get an exact Hessian. By treating the Hessian as a sum of recursive components, the math becomes much more manageable for software implementation.
  • The "Hessian vs. OPG" Debate: In theory, the Hessian-based estimator and the Outer Product of the Score (OPG) estimator are both consistent. However, the authors found that the OPG estimator is more "robust" in finite samples.
  • Numerical Stability: The paper highlights that likelihood evaluation in these models is prone to exponential decay or growth. Their re-scaling technique is essential for making the algorithm work in practice on modern computers.

Key Results

  • Inference Accuracy: In simulations, the OPG-based estimator (Equation 15) consistently outperformed the Hessian-based estimator (Equation 14). For example, in a model with switching variance ($M_\sigma$) at $n=100$, the OPG estimator achieved coverage frequencies closer to the nominal 95% level than the Hessian.
  • Sample Size Sensitivity: At small sample sizes ($n=100$), both methods struggled, often underestimating the true variability (leading to confidence intervals that were too narrow). However, as $n$ reached 800, both methods converged toward the correct 95% coverage, with OPG maintaining a slight edge.
  • Computational Efficiency: By providing a recursive path, the authors significantly reduce the "pre-computation effort" required by researchers before they can actually run their models.

Limitations and Future Work

  • Model Scope: While general, the current algorithm does not yet encompass more complex specifications like regime-switching GARCH models or state-space models where the likelihood cannot be evaluated exactly and requires approximation (like Particle Filters).
  • The OPG Preference: While the results favor OPG for inference, the authors note that the exact Hessian is still valuable for optimization (e.g., Newton-Raphson steps) and certain diagnostic tests.
  • Future Directions: The authors suggest extending this recursive derivative framework to approximate likelihood scenarios, which would open the door to even more complex latent variable models in finance and macroeconomics.

Summary updated

BibTeX
@misc{li2022recursive,
  author = {Chao‐Jun Li and Shi Qiu},
  title = {{Recursive Score and Hessian Computation in Regime-Switching Models}},
  year = {2022},
  eprint = {2205.01565},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.01565},
}
Figure