Fit Bayesian regression models using one of the Markov chain Monte Carlo (MCMC) methods. You can choose from a variety of supported models or even program your own. Extensive tools are available to check convergence, including multiple chains. Compute posterior mean estimates and credible intervals for model parameters and functions of model parameters. You can perform both interval- and model-based hypothesis testing. Compare models using Bayes factors. Compute model fit using posterior predictive p-values. Generate predictions. And much more.


ESTIMATION

  • Thousands of built-in models, by combining
    • over 60 likelihood models, including univariate and multivariate normal, logit, probit, ordered logit, ordered probit, Poisson …
    • Many prior distributions, including normal, lognormal, multivariate normal, gamma, beta, Wishart …
    • Continuous, binary, ordinal, count, and survival outcomes
    • Univariate, multivariate, and multiple-equation models
    • Linear and nonlinear models
    • Continuous univariate, multivariate, and discrete priors
  • bayes: prefix
    • Simply type bayes: in front of any of 58 estimation commands to fit Bayesian regression models
    • Change any of the default priors
    • Change any of the simulation or sampling settings
    • Time-series operators
    • Control Panel lets you specify and fit models from an easy-to-use interface
  • Multiple chains
  • Use GUI to fit models
  • Use command language to fit models
  • Time-series operators

 

CLASSES OF MODELS

  • Linear regression
  • Nonlinear regression
  • Multivariate regression
  • Multivariate nonlinear regression
  • Generalized linear models
  • Generalized nonlinear models with canonical links
  • Zero-inflated models
  • Sample-selection model
  • Survival models
  • Panel-data models
  • Multilevel models
  • Autoregressive models
  • Threshold autoregressive models
  • Multivariate time-series models
  • Multiple-equation models
  • Lasso

LIKELIHOOD MODELS

  • Normal
  • Student’s t
  • Lognormal
  • Exponential
  • Probit
  • Logit/Logistic
  • Binomial
  • Ordered probit
  • Ordered logistic
  • Poisson
  • Negative binomial
  • Survival models
  • Panel-data models
  • Multilevel
    • Normal
    • Probit, logit/logistic, complementary log-log
    • Ordered probit and logit
    • Poisson and negative binomial
    • Generalized linear models
    • Survival
  • Multivariate normal (MVN)
  • Multivariate VAR
  • Linear and nonlinear DSGE models
  • User-defined

PRIOR DISTRIBUTIONS

  • Normal
  • Generalized (location-scale) t
  • Lognormal
  • Uniform
  • Gamma
  • Inverse gamma
  • Exponential
  • Laplace
  • Cauchy
  • Beta
  • Chi-squared
  • Pareto
  • Multivariate normal
  • Dirichlet
  • Wishart
  • Inverse Wishart
  • Bernoulli
  • Geometric
  • Discrete
  • Poisson
  • User-defined density
  • User-defined log density
  • Specialized priors
    • MVN with exchangeable, independent, identity, and scaled covariances
    • Flat
    • Jeffreys
    • Multivariate Jeffreys
    • Zellner’s g

ADD YOUR OWN MODELS

  • Write your own programs to calculate likelihood function and choose built-in priors
  • Write your own programs to calculate posterior density directly
  • Use built-in adaptive MH sampling to simulate marginal posterior

MARKOV CHAIN MONTE CARLO (MCMC) METHODS

  • Adaptive Metropolis-Hastings (MH)
  • Hybrid MH (adaptive MH with Gibbs updates)
  • Full Gibbs sampling for some models

SIMULATION

  • Produce multiple chains
  • Three MCMC methods
  • Control burn-in iterations
  • Control MCMC iterations
  • Thinning
  • Review model summary before simulation
  • Save simulation results for future use

ADAPTIVE MH SAMPLING

  • Blocking of parameters
  • Adaptation within each block
  • Diminishing adaptation
  • Random-effects parameters
  • Control scale and covariance of the proposal distribution
  • Control adaptation
© Copyright 1996–2024 StataCorp LLC. All rights reserved.

 

  • Length of adaptation
  • Maximum and minimum numbers of adaptive iterations
  • Acceptance rate
  • Adaptation rate
  • Target acceptance rate
  • Acceptance rate tolerance

STARTING VALUES

  • Automatic
  • May specify for some or all parameters
  • May specify for some or all chains

POSTESTIMATION SELECTOR

  • View and run all postestimation features for your command
  • Automatically updated as estimation commands are run

bayes4a_stcolor.svg

TOOLS TO CHECK MCMC CONVERGENCE

  • Diagnostic plots in compact form
  • Trace plots
  • Autocorrelation plots
  • Histograms
  • Density plots
  • Cumulative sum plots
  • Bivariate scatterplots
  • Produce any of the above for parameters or functions of parameters
  • Multiple separate graphs or multiple plots on one graph
  • Pause between multiple graphs
  • Customize the look of each graph
  • Multiple chains
    • Use any of the above graphical tools
    • Gelman–Rubin convergence diagnostic

 

TOOLS TO CHECK MCMC EFFICIENCY

  • Effective sample sizes
  • Autocorrelation times
  • Efficiencies
  • Compute any of the above for parameters or functions of parameters

POSTERIOR SUMMARIES

  • Means
  • Medians
  • Standard deviations
  • Monte Carlo standard errors (MCSEs)
  • Credible intervals (CrIs)
    • Equal-tailed
    • Highest posterior density (HPD)
  • Compute any of the above for parameters or functions of parameters
  • Summaries for log likelihood and log posterior
  • Compute any of the above using multiple chains
  • Summaries for simulated outcomes and their functions

MCSE ESTIMATION METHODS

  • using effective sample size
  • using batch means

HYPOTHESIS TESTING

  • Interval-based by computing probability of an interval hypothesis
  • Linear and nonlinear
  • Single and joint
  • Continuous parameters
  • Discrete parameters
  • Model-based by computing model posterior probabilities
  • Perform tests for simulated outcomes and their functions

PREDICTIONS

  • Generate predictions: simulate outcome values and their functions
  • Save all or a subset of predictions in a separate dataset
  • Save posterior summaries of predictions as variables in current dataset
  • Save a subset of MCMC replicates as variables in current dataset
  • Obtain graphical and posterior summaries, perform hypothesis tests, and more
  • Use built-in tools to create functions of predictions or write your own Mata functions and Stata programs
  • Generate replicated data for posterior predictive checks

 

MODEL COMPARISON

  • Deviance information criterion (DIC)
  • Bayes factors
  • Model posterior probabilities
  • Nested and nonnested models

MODEL GOODNESS OF FIT

  • Posterior predictive p-values
  • MCMC replicates
  • Predictions

SPECIALIZED POSTESTIMATION

  • Impulse–response functions (IRFs) after VAR and DSGE
    • Simple IRFs
    • Orthogonalized IRFs
    • Structural IRFs
    • Cumulative IRFs
  • Postestimation after VAR
    • IRFs
    • Dynamic multipliers
    • Forecast-error variance decompositions (FEVD)
    • Static and dynamic forecasts
    • Stability analysis using eigenvalues

SAVE YOUR MCMC AND ESTIMATION RESULTS FOR FUTURE USE

 

FACTOR VARIABLES

  • Automatically create indicators based on categorical variables
  • Form interactions among discrete and continuous variables
  • Include polynomial terms
Watch Introduction to Factor Variables in Stata tutorials