Introduction to Bayesian Analysis Procedures

Summary Statistics

Let bold-italic theta be a p-dimensional parameter vector of interest: bold-italic theta equals StartSet theta 1 comma ellipsis comma theta Subscript p Baseline EndSet. For each i element-of StartSet 1 comma ellipsis comma p EndSet, there are n observations: theta Subscript i Baseline equals StartSet theta Subscript i Superscript t Baseline comma t equals 1 comma ellipsis comma n EndSet.

Mean

The posterior mean is calculated by using the following formula:

upper E left-parenthesis theta Subscript i Baseline vertical-bar bold y right-parenthesis almost-equals theta overbar Subscript i Baseline equals StartFraction 1 Over n EndFraction sigma-summation Underscript t equals 1 Overscript n Endscripts theta Subscript i Superscript t Baseline comma for i equals 1 comma ellipsis comma n

Standard Deviation

Sample standard deviation (expressed in variance term) is calculated by using the following formula:

normal upper V normal a normal r left-parenthesis theta Subscript i Baseline vertical-bar bold y right-parenthesis almost-equals s Subscript i Superscript 2 Baseline equals StartFraction 1 Over n minus 1 EndFraction sigma-summation Underscript t equals 1 Overscript n Endscripts left-parenthesis theta Subscript i Superscript t Baseline minus theta overbar Subscript i Baseline right-parenthesis squared

Standard Error of the Mean Estimate

Suppose you have n iid samples, the mean estimate is theta overbar Subscript i, and the sample standard deviation is s Subscript i. The standard error of the estimate is ModifyingAbove sigma With caret Subscript i Baseline slash StartRoot n EndRoot. However, positive autocorrelation (see the section Autocorrelations for a definition) in the MCMC samples makes this an underestimate. To take account of the autocorrelation, the Bayesian procedures correct the standard error by using effective sample size (see the section Effective Sample Size).

Given an effective sample size of m, the standard error for theta overbar Subscript i is ModifyingAbove sigma With caret Subscript i Baseline slash StartRoot m EndRoot. The procedures use the following formula (expressed in variance term):

ModifyingAbove normal upper V normal a normal r With caret left-parenthesis theta overbar Subscript i Baseline right-parenthesis equals StartFraction 1 plus 2 sigma-summation Underscript k equals 1 Overscript normal infinity Endscripts rho Subscript k Baseline left-parenthesis theta Subscript i Baseline right-parenthesis Over n EndFraction dot StartFraction sigma-summation Underscript t equals 1 Overscript n Endscripts left-parenthesis theta Subscript i Superscript t Baseline minus theta overbar Subscript i Baseline right-parenthesis squared Over left-parenthesis n minus 1 right-parenthesis EndFraction

The standard error of the mean is also known as the Monte Carlo standard error (MCSE). The MCSE provides a measurement of the accuracy of the posterior estimates, and small values do not necessarily indicate that you have recovered the true posterior mean.

Percentiles

Sample percentiles are calculated using Definition 5 (see Chapter 3, The UNIVARIATE Procedure (Base SAS Procedures Guide: Statistical Procedures)).

Correlation

Correlation between theta Subscript i and theta Subscript j is calculated as

r Subscript i j Baseline equals StartFraction sigma-summation Underscript t equals 1 Overscript n Endscripts left-parenthesis theta Subscript i Superscript t Baseline minus theta overbar Subscript i Baseline right-parenthesis left-parenthesis theta Subscript j Superscript t Baseline minus theta overbar Subscript j Baseline right-parenthesis Over StartRoot sigma-summation Underscript t Endscripts left-parenthesis theta Subscript i Superscript t Baseline minus theta overbar Subscript i Baseline right-parenthesis squared sigma-summation Underscript t Endscripts left-parenthesis theta Subscript j Superscript t Baseline minus theta overbar Subscript j Baseline right-parenthesis squared EndRoot EndFraction

Covariance

Covariance theta Subscript i and theta Subscript j is calculated as

s Subscript i j Baseline equals sigma-summation Underscript t equals 1 Overscript n Endscripts left-parenthesis theta Subscript i Superscript t Baseline minus theta overbar Subscript i Baseline right-parenthesis left-parenthesis theta Subscript j Superscript t Baseline minus theta overbar Subscript j Baseline right-parenthesis slash left-parenthesis n minus 1 right-parenthesis

Equal-Tail Credible Interval

Let pi left-parenthesis theta Subscript i Baseline vertical-bar bold y right-parenthesis denote the marginal posterior cumulative distribution function of theta Subscript i. A 100 left-parenthesis 1 minus alpha right-parenthesis percent-sign Bayesian equal-tail credible interval for theta Subscript i is left-parenthesis theta Subscript i Superscript alpha slash 2 Baseline comma theta Subscript i Superscript 1 minus alpha slash 2 Baseline right-parenthesis, where pi left-parenthesis theta Subscript i Superscript alpha slash 2 Baseline vertical-bar bold y right-parenthesis equals StartFraction alpha Over 2 EndFraction, and pi left-parenthesis theta Subscript i Superscript 1 minus alpha slash 2 Baseline vertical-bar bold y right-parenthesis equals 1 minus StartFraction alpha Over 2 EndFraction. The interval is obtained using the empirical StartFraction alpha Over 2 EndFractionth and left-parenthesis 1 minus StartFraction alpha Over 2 EndFraction right-parenthesisth percentiles of StartSet theta Subscript i Superscript t Baseline EndSet.

Highest Posterior Density (HPD) Interval

For a definition of an HPD interval, see the section Interval Estimation. The procedures use the Chen-Shao algorithm (Chen and Shao 1999; Chen, Shao, and Ibrahim 2000) to estimate an empirical HPD interval of theta Subscript i:

  1. Sort StartSet theta Subscript i Superscript t Baseline EndSet to obtain the ordered values:

    theta Subscript i left-parenthesis 1 right-parenthesis Baseline less-than-or-equal-to theta Subscript i left-parenthesis 2 right-parenthesis Baseline less-than-or-equal-to midline-horizontal-ellipsis less-than-or-equal-to theta Subscript i left-parenthesis n right-parenthesis
  2. Compute the 100 left-parenthesis 1 minus alpha right-parenthesis percent-sign credible intervals:

    upper R Subscript j Baseline left-parenthesis n right-parenthesis equals left-parenthesis theta Subscript i left-parenthesis j right-parenthesis Baseline comma theta Subscript i left-parenthesis j plus left-bracket left-parenthesis 1 minus alpha right-parenthesis n right-bracket right-parenthesis Baseline right-parenthesis

    for j equals 1 comma 2 comma ellipsis comma n minus left-bracket left-parenthesis 1 minus alpha right-parenthesis n right-bracket.

  3. The 100 left-parenthesis 1 minus alpha right-parenthesis percent-sign HPD interval, denoted by upper R Subscript j Sub Superscript asterisk Baseline left-parenthesis n right-parenthesis, is the one with the smallest interval width among all credible intervals.

Deviance Information Criterion (DIC)

The deviance information criterion (DIC) (Spiegelhalter et al. 2002) is a model assessment tool, and it is a Bayesian alternative to Akaike’s information criterion (AIC) and the Bayesian information criterion (BIC, also known as the Schwarz criterion). The DIC uses the posterior densities, which means that it takes the prior information into account. The criterion can be applied to nonnested models and models that have non-iid data. Calculation of the DIC in MCMC is trivial—it does not require maximization over the parameter space, like the AIC and BIC. A smaller DIC indicates a better fit to the data set.

Letting bold-italic theta be the parameters of the model, the deviance information formula is

normal upper D normal upper I normal upper C equals ModifyingAbove upper D left-parenthesis bold-italic theta right-parenthesis With bar plus p Subscript upper D Baseline equals upper D left-parenthesis bold-italic theta overbar right-parenthesis plus 2 p Subscript upper D

where

upper D left-parenthesis bold-italic theta right-parenthesis equals 2 left-parenthesis log left-parenthesis f left-parenthesis bold y right-parenthesis right-parenthesis minus log left-parenthesis p left-parenthesis bold y vertical-bar bold-italic theta right-parenthesis right-parenthesis right-parenthesis : deviance

where

p left-parenthesis bold y vertical-bar bold-italic theta right-parenthesis: likelihood function with the normalizing constants.

f left-parenthesis bold y right-parenthesis: a standardizing term that is a function of the data alone. This term is constant with respect to the parameter and is irrelevant when you compare different models that have the same likelihood function. Since the term cancels out in DIC comparisons, its calculation is often omitted.

Note: You can think of the deviance as the difference in twice the log likelihood between the saturated, f left-parenthesis bold y right-parenthesis, and fitted, p left-parenthesis bold y vertical-bar bold-italic theta right-parenthesis, models.

bold-italic theta overbar: posterior mean, approximated by StartFraction 1 Over n EndFraction sigma-summation Underscript t equals 1 Overscript n Endscripts bold-italic theta Superscript t

ModifyingAbove upper D left-parenthesis bold-italic theta right-parenthesis With bar: posterior mean of the deviance, approximated by StartFraction 1 Over n EndFraction sigma-summation Underscript t equals 1 Overscript n Endscripts upper D left-parenthesis bold-italic theta Superscript t Baseline right-parenthesis. The expected deviation measures how well the model fits the data.

upper D left-parenthesis bold-italic theta overbar right-parenthesis: deviance evaluated at bold-italic theta overbar, equal to minus 2 log left-parenthesis p left-parenthesis bold y vertical-bar bold-italic theta overbar right-parenthesis right-parenthesis. It is the deviance evaluated at your "best" posterior estimate.

p Subscript upper D: effective number of parameters. It is the difference between the measure of fit and the deviance at the estimates: ModifyingAbove upper D left-parenthesis bold-italic theta right-parenthesis With bar minus upper D left-parenthesis bold-italic theta overbar right-parenthesis. This term describes the complexity of the model, and it serves as a penalization term that corrects deviance’s propensity toward models with more parameters.

Last updated: December 09, 2022