BAYES
<options> ;
The BAYES statement controls the Metropolis sampling scheme that is used to obtain samples from the posterior distribution of the underlying model and data.
controls which diagnostics are produced. All the following diagnostics are produced with DIAGNOSTICS=ALL. If you do not want any of these diagnostics, specify DIAGNOSTICS=NONE. If you want some but not all of the diagnostics, or if you want to change certain settings of these diagnostics, specify a subset of the following keywords. The default is DIAGNOSTICS=NONE.
computes the autocorrelations at lags that are specified in the numericlist. Elements in the numericlist are truncated to integers, and repeated values are removed. If the LAGS= option is not specified, autocorrelations of lags 1, 5, 10, and are computed.
computes Carlin’s estimate of the effective sample size, the correlation time, and the efficiency of the chain for each parameter.
computes the Geweke spectral density diagnostics, which are essentially a twosample test between the first portion and the last portion of the chain. The default is and , but you can choose other fractions by using the following gewekeoptions:
specifies the fraction for the first window.
specifies the fraction for the second window.
computes the Heidelberger and Welch diagnostic for each variable, which consists of a stationarity test of the null hypothesis that the sample values form a stationary process. If the stationarity test is not rejected, a halfwidth test is then carried out. Optionally, you can specify one or more of the following heideloptions:
specifies the level for the stationarity test.
specifies the level for the halfwidth test.
specifies a positive number such that if the halfwidth is less than times the sample mean of the retained iterates, the halfwidth test is passed.
computes the Monte Carlo standard error for each parameter. The Monte Carlo standard error, which measures the simulation accuracy, is the standard error of the posterior mean estimate and is calculated as the posterior standard deviation divided by the square root of the effective sample size.
computes the Raftery and Lewis diagnostics, which evaluate the accuracy of the estimated quantile ( for a given ) of a chain. can achieve any degree of accuracy when the chain is allowed to run for a long time. The computation is stopped when the estimated probability reaches within of the value with probability ; that is, . The following rafteryoptions enable you to specify , and a precision level for the test:
specifies the order (a value between 0 and 1) of the quantile of interest. The default is 0.025.
specifies a small positive number as the margin of error for measuring the accuracy of estimation of the quantile. The default is 0.005.
specifies the probability of attaining the accuracy of the estimation of the quantile. The default is 0.95.
specifies the tolerance level (a small positive number) for the stationary test. The default is 0.001.
specifies the minimum number of tuning phases. The default is 2.
specifies the maximum number of tuning phases. The default is 24.
specifies the number of burnin iterations before the chains are saved. The default is 1,000.
specifies the number of iterations after the burnin. The default is 1,000.
specifies the number of threads to be used. The number of threads cannot exceed the number of computer cores available. Each core samples the number of iterations that is specified by the NMC option. The default is 1.
specifies the number of samples for each tuning phase. The default is 500.
names the SAS data set to contain the posterior samples. Alternatively, you can create the output data set by specifying an ODS OUTPUT statement as follows:
ODS
OUTPUT POSTERIORSAMPLE = <SASdataset> ;
names the SAS data set to contain the prior samples used to generate the prior predictive analysis when you request the prior predictive plots. Alternatively, you can create the output data set by specifying an ODS OUTPUT statement as follows:
ODS
OUTPUT PRIORSAMPLE = <SASdataset> ;
specifies the method used in constructing the initial covariance matrix for the MetropolisHastings algorithm. The QUANEW and NMSIMP methods find numerically approximated covariance matrices at the optimum of the posterior density function with respect to all continuous parameters. The tuning phase starts at the optimized values; in some problems, this can greatly increase convergence performance. If the approximated covariance matrix is not positive definite, then an identity matrix is used instead. You can specify the following values:
performs a conjugategradient optimization.
performs a version of doubledogleg optimization.
performs a NewtonRaphson optimization that combines a linesearch algorithm with ridging.
performs a NelderMead simplex optimization.
performs a NewtonRaphson optimization with ridging.
performs a quasiNewton optimization.
performs a trustregion optimization.
specifies how to sample from the posterior distribution. SAMPLING=MULTIMETROPOLIS implements a Metropolis sampling scheme on a single block that contains all the parameters of the model. SAMPLING=UNIMETROPOLIS implements a Metropolis sampling scheme on multiple blocks, one for each parameter of the model. The default is SAMPLING=MULTIMETROPOLIS.
specifies an integer seed in the range 1 to for the random number generator in the simulation. Specifying a seed enables you to reproduce identical Markov chains for the same specification. If you do not specify the SEED= option, or if you specify a nonpositive seed, a random seed is derived from the time of day.
controls the number of posterior statistics produced. Specifying STATISTICS=ALL is equivalent to specifying STATISTICS= (SUMMARY INTERVAL COV CORR). If you do not want any posterior statistics, specify STATISTICS=NONE. The default is STATISTICS=(SUMMARY INTERVAL). You can specify the following globaloptions:
controls the probabilities of the credible intervals. The ALPHA= values must be between 0 and 1. Each ALPHA= value produces a pair of 100(1–ALPHA)% equaltail and HPD intervals for each parameter. The default is ALPHA=0.05, which yields the 95% credible intervals for each parameter.
requests the percentile points of the posterior samples. The PERCENT= values must be between 0 and 100. The default is PERCENT=25, 50, 75, which yields the 25th, 50th, and 75th percentile points, respectively, for each parameter.
You can specify the following keywords:
produces the posterior correlation matrix.
produces the posterior covariance matrix.
produces equaltail credible intervals and HPD intervals. The default is to produce the 95% equaltail credible intervals and 95% HPD intervals, but you can use the ALPHA= globaloption to request intervals of any probabilities.
suppresses printing of all summary statistics.
produces the means, standard deviations, and percentile points for the posterior samples. To obtain the default percentiles (25th, 50th, and 75th), you must also specify the INTERVAL globaloption. You can use the global PERCENT= globaloption to request specific percentile points.
controls the thinning of the Markov chain. Only one in every samples is used when THIN=, and if NBI= and NMC=, the number of samples that are kept is

where [] represents the integer part of the number . The default is THIN=1.