Sensitivity analysis in HMMs with application to likelihood maximization

Pierre-Arnaud Coquelin, Romain Deguest, Rémi MunosNeurIPS 2009

Hidden Markov Models (HMMs) are the workhorses of time-series analysis, powering everything from speech recognition to financial forecasting. However, as these models grow in complexity—transitioning from simple discrete states to continuous, non-linear spaces—finding the optimal parameters to fit the data becomes a significant mathematical challenge.

In their paper, "Sensitivity analysis in HMMs with application to likelihood maximization," Coquelin, Deguest, and Munos introduce a highly efficient method for tuning these models using Infinitesimal Perturbation Analysis (IPA). By integrating IPA within a particle filter framework, they achieve a gradient estimator that boasts linear computational complexity and significantly lower variance than traditional methods.

The Challenge of Likelihood Maximization

To train an HMM, researchers typically aim to maximize the likelihood—the probability that the model produced the observed data. This is usually accomplished via gradient ascent, which requires calculating the gradient (or "slope") of the log-likelihood with respect to the model's parameters.

For simple, linear models, exact solutions like the Kalman filter or the Expectation-Maximization (EM) algorithm work perfectly. However, in high-dimensional, non-linear, continuous spaces (such as modeling stock market volatility), these standard tools break down. While researchers often turn to "Score Function" (or Likelihood Ratio) methods as an alternative, these approaches suffer from massive variance. The resulting gradient estimates are often so noisy that the optimization process becomes unstable and impractically slow.

Methodology: Bridging SMC and IPA

The authors solve this high-variance problem by bridging Sequential Monte Carlo (SMC)—commonly known as particle filters—with Infinitesimal Perturbation Analysis (IPA).

  1. The Augmented State: Instead of merely tracking the "hidden state" ($X_t$) of the system with particles, the proposed algorithm tracks an augmented state: $(X_t, Z_t, R_t)$.
  2. $Z_t$ represents the sensitivity (gradient) of the state.
  3. $R_t$ accumulates the terms necessary to compute the log-likelihood gradient.
  4. IPA over Score Function: Unlike the Score Function method, which only evaluates the output density, IPA "looks inside" the transition function. It differentiates directly through the random mapping that generates the next state, leveraging the specific structure of the model's transition equations.
  5. Linear Complexity: A major breakthrough of this approach is its computational efficiency. The algorithm operates with $O(N)$ complexity, where $N$ is the number of particles. Previous attempts to achieve low-variance gradients often required $O(N^2)$ operations, rendering them useless for real-time applications.

Furthermore, the algorithm operates in a single forward pass. It does not require storing the entire history of the particles to move backward in time (smoothing), which saves a massive amount of memory.

Experimental Setup and Key Results

The paper evaluates the algorithm using synthetic datasets generated from two classic models: an Autoregressive Model ($AR_1$) (a linear-Gaussian model used as a baseline sanity check) and a Stochastic Volatility Model (a non-linear, non-Gaussian model popular in finance where standard methods typically fail).

Performance and Consistency

The authors mathematically prove that their IPA estimator is asymptotically unbiased and consistent. As the number of particles increases, the estimate is guaranteed to converge to the true gradient. In empirical tests on the $AR_1$ model (using 500 observations and 100 particles), the IPA method proved highly competitive with the Kalman filter and EM algorithm, despite those algorithms being mathematically optimal for that specific linear case.

Massive Variance Reduction

The most significant advantage of the IPA method is its stability. Because it utilizes more information about how the state changes, the resulting gradient estimate is much smoother and less prone to wild fluctuations than the Score method.

Variance comparison between Score and IPA methods

In the Stochastic Volatility tests, the IPA estimator demonstrated significantly lower variance than the Score method. As illustrated above, the Score method's variance spikes dramatically when the system noise ($\sigma$) is small, whereas the IPA method remains stable and low-variance across the spectrum. This robustness allows the gradient ascent method to successfully converge to true parameters across multiple trials, regardless of the starting point.

Limitations and Future Work

While the IPA estimator is highly efficient, the authors note a few limitations and avenues for future research:

  • The "Forgetting" Property: The variance of the estimator still grows as the number of observations ($n$) increases. While the filtering distribution "forgets" its initial conditions exponentially fast—which mitigates the issue—it does not eliminate the growth entirely.
  • Smoothing Techniques: The authors suggest that integrating "fixed-lag smoothing" (looking back a few steps in time) could further reduce variance without sacrificing too much computational speed.
  • Higher-Order Derivatives: The current paper focuses on the first derivative (the gradient). Extending the IPA approach to calculate the Hessian (the second derivative) could pave the way for even faster optimization using Newton-style methods.

Summary updated

BibTeX
@inproceedings{coquelin2009sensitivity,
  author = {Pierre-Arnaud Coquelin and Romain Deguest and Rémi Munos},
  title = {{Sensitivity analysis in HMMs with application to likelihood maximization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2009},
  url = {https://openreview.net/forum?id=Bk-xKd-_Zr},
}
Figure