Bayesian estimation of an equation¶
In the app: Help → Help contents, Bayesian estimation of an equation.
Bayesian estimation combines what the data say with what is known beforehand: a prior for each coefficient (and the error's standard deviation), stated here by its mean and standard deviation. The result is the posterior: a distribution for each coefficient, summarised by its mean, median, standard deviation and highest posterior density (HPD) interval, the shortest interval holding, say, 90% of it. A tight prior pulls an estimate towards its mean; a coefficient with no prior is left to the data (a flat prior), so with no priors at all the posterior mean is close to least squares.
The posterior is explored by drawing from it. With normal (or no) priors on the coefficients of a linear equation, each step can be drawn exactly (Gibbs sampling); otherwise, and for logit, probit and Poisson equations, random-walk Metropolis-Hastings proposes moves and accepts some. The No-U-Turn sampler (NUTS, sampler "nuts") instead follows the posterior's slope, moving far at each step, so fewer draws carry as much information; its burn-in tunes its step size and scales, and a divergent transition warns that the draws near it may be biased. Its mass matrix (Metric) is diagonal by default; dense also undoes correlations between coefficients, and mode keeps the curvature at the posterior mode. Several chains started apart should agree: R-hat near 1 and large effective sample sizes suggest they do. Draws at the start of each chain (the burn-in) are discarded.
The posterior mean of the draws is itself an estimate of the posterior mean, with a Monte Carlo standard error (MCSE): the posterior standard deviation over the square root of the effective sample size. Correlated draws are worth fewer independent ones, so their MCSE is larger. Draw more until it is small beside the standard deviation and the precision you report. A quantile (a band's edge) has an MCSE too, larger than the mean's: mcse() on a Bayesian equation, VAR or DSGE posterior gives both, from the effective sample size or from batch means (the means of consecutive blocks of draws).
An equation with ARMA errors (AR and MA orders in the dialog) is sampled too, on the exact likelihood. Its AR and MA coefficients are drawn through their partial autocorrelations, each between -1 and 1, so every draw is stationary and invertible, and their priors (ar[1], ma[1]...) are on those: for one lag, the coefficient itself. The posterior predictive distribution, each future path from a posterior draw with its own shocks, gives density forecasts and fan charts that include parameter uncertainty; predictive checks compare the data's mean, spread and autocorrelations with those of samples replicated from the model.
See also¶
References¶
- Hoffman, M. D. and Gelman, A. (2014). The No-U-Turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research 15, 1593-1623. (search)
- Betancourt, M. (2017). A conceptual introduction to Hamiltonian Monte Carlo. arXiv:1701.02434. (search)
- Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A. and Rubin, D. B. (2013). Bayesian Data Analysis, 3rd ed. CRC Press. doi:10.1201/b16018
- Koop, G. (2003). Bayesian Econometrics. Wiley. (search)
- Monahan, J. F. (1984). A note on enforcing stationarity in autoregressive-moving average models. Biometrika 71(2), 403-404. doi:10.1093/biomet/71.2.403
- Haario, H., Saksman, E. and Tamminen, J. (2001). An adaptive Metropolis algorithm. Bernoulli 7(2), 223-242. doi:10.2307/3318737