Cookies on Macro by Mark.We use essential cookies for sign-in, locale, and security. With your permission, we also use optional cookies for preferences, for analytics, and for advertising measurement with the Meta (Facebook) Pixel. Read our cookie policy.
Regime-switching macro system where latent states govern recession and expansion dynamics through transition probabilities.
Follow the same equations and assumptions one section at a time or in a continuous reading.
Hover or focus a symbol defined in this model to find its exact matches. Select it to keep the highlight; Escape clears the selection.
The Hamilton filter is a forward recursion that computes the filtered regime probability for each time period and each regime . It generalizes the Baum-Welch forward algorithm from the hidden Markov model literature to the time-series regression setting.
At each date , the filter performs two operations: prediction (propagate yesterday's filtered probabilities through the transition matrix) and updating (combine the predicted probabilities with the likelihood of today's observation in each regime).
The filter also produces the model's log-likelihood as a byproduct. The marginal density of given past data is , and the full log-likelihood is . The EM algorithm maximizes this likelihood.
Gaussian density of conditional on regime , where .
Prediction step: the probability of being in regime at time , before seeing , is the transition-weighted sum of yesterday's filtered probabilities.
Update step: Bayes' rule. The denominator is the marginal likelihood of given past data.
Log-likelihood of the observed data. The marginal density at each t integrates out the latent regime.
The state is updated at observed dates. A line between dates is a display convention unless the model specifies behavior inside the interval.
Read adjacent points as adjacent sample calculations. Smoothness is a property of the estimator, not of the chart line.
Do not infer within-period behavior from a sampled estimator.
The state updates at sample dates. The visible line is only as smooth as the estimated state sequence.
Observed series can move differently from latent states because measurement noise and loadings matter.