How to Tell Whether a Coefficient Varies over Time

Guide 3 of 3 in the series Time-Varying Parameters

Based on Chan and Eisenstat (2015)
[ Journal Version | Working Paper | Code | Full guide on GitHub ]

Chan and Jeliazkov (2009)
[ Journal Version | Working Paper | Code ]

We use marginal likelihoods to assess whether the coefficients of a time-varying parameter (TVP) regression vary over time. We compare four regressions with an intercept and one regressor: neither coefficient varies, only the intercept varies, only the slope varies, or both vary. Each model is estimated using a Metropolis-Hastings sampler that draws the variances from their posterior, using ssm.intlike to evaluate the integrated likelihood. Given the posterior draws of the variances, we then use importance sampling to compute the marginal likelihood.

On data whose intercept and slope both vary, the model in which both vary has the largest marginal likelihood. On data whose slope is constant, the model in which only the intercept varies has the largest. The evidence for a constant slope grows with the prior mean of the slope's variance.

The steps

  1. Integrate the Coefficients Out
  2. Draw the Variances
  3. Estimate the Marginal Likelihoods by Importance Sampling
  4. Compare the Models
  5. Vary the Prior of the Slope's Variance

The log Bayes factor of a varying slope against the prior mean of its variance

Figure 1: The log Bayes factor of the model in which both coefficients vary against the model in which only the intercept varies. The horizontal axis gives the prior mean of ω22 on a log scale. Solid, the data whose slope varies; dashed, the data whose slope is constant. A positive value favors a varying slope.

Try it

In MATLAB, from the root of a copy of statespace-toolkit, run the script that prints every number and draws every figure of the guide:

run guides/tvp_compare/guide.m

In this series

Previous: How to Estimate a TVP Regression by Gibbs Sampling