The MCMC Procedure

 
MODEL Statement

MODEL dependent-variable-list distribution ;

The MODEL statement specifies the conditional distribution of the data given the parameters (the likelihood function). You must specify a single dependent variable or a list of dependent variables, a tilde , and then a distribution with its arguments. The dependent variables can be variables from the input data set or functions of the symbols in the program. The dependent variables must be specified unless the functions GENERAL or DGENERAL are used (see the section Specifying a New Distribution for more details). Multiple MODEL statements are allowed for defining models with multiple independent components. The log-likelihood value is the sum of the log-likelihood values from each MODEL statement.

PROC MCMC is a programming language that is similar to the DATA step, and the order of statement evaluation is important. For example, the MODEL statement must come after any SAS programming statements that define or modify arguments used in the construction of the log likelihood. In PROC MCMC, a symbol can be defined multiple times and used at different places. Using an expression out of order produces erroneous results that can also be hard to detect.

Standard distributions that the MODEL statement supports are listed in the Table 54.2 and Table 54.3 (see the section Standard Distributions for density specification). All distributions except the multinomial distribution can be used also in the PRIOR and HYPERPRIOR statements. PROC MCMC allows some distributions to be parameterized in multiple ways. For example, you can specify a normal distribution with a variance (VAR=), standard deviation (SD=), or precision (PRECISION=) parameter. For distributions that have different parameterizations, you must specify an option to clearly name the ambiguous parameter. For example, in the normal distribution, you must indicate whether the second argument represents variance, standard deviation, or precision.

All univariate distributions, with the exception of binary and uniform, can have the optional LOWER= and UPPER= arguments, which specify a truncated density. See the section Truncation and Censoring for more details. Truncation is not supported for multivariate distributions.

Table 54.2 Univariate Distributions

Distribution Name

Definition

beta(<a=>, <b=>)

Beta distribution with shape parameters and

binary(<prob|p=> )

Binary (Bernoulli) distribution with probability of success . You can use the alias bern for this distribution.

binomial (<n=> , <prob|p=> )

Binomial distribution with count and probability of success

cauchy (<location|loc|l=>, <scale|s=>)

Cauchy distribution with location and scale

chisq(<df=> )

distribution with degrees of freedom

dgeneral(ll)

General log-likelihood function that you construct using SAS programming statements for single or multiple discrete variables. Also see the function general. The name dlogden is an alias for this function.

expchisq(<df=> )

Log transformation of a distribution with degrees of freedom: . You can use the alias echisq for this distribution.

expexpon(scale|s= )
expexpon(iscale|is= )

Log transformation of an exponential distribution with scale or inverse-scale parameter : . You can use the alias eexpon for this distribution.

expGamma(<shape|sp=> a, scale|s= )
expGamma(<shape|sp=> a, iscale|is= )

Log transformation of a gamma distribution with shape and scale or inverse-scale : . You can use the alias egamma for this distribution.

expichisq(<df=> )

Log transformation of an inverse distribution with degrees of freedom: . You can use the alias eichisq for this distribution.

expiGamma(<shape|sp=> a, scale|s= )
expiGamma(<shape|sp=> a, iscale|is= )

Log transformation of an inverse-gamma distribution with shape and scale or inverse-scale : . You can use the alias eigamma for this distribution.

expsichisq(<df=> , <scale|s=> )

Log transformation of a scaled inverse distribution with degrees of freedom and scale parameter : . You can use the alias esichisq for this distribution.

expon(scale|s= )
expon(iscale|is= )

Exponential distribution with scale or inverse-scale parameter

gamma(<shape|sp=> a, scale|s= )
gamma(<shape|sp=> a, iscale|is= )

Gamma distribution with shape and scale or inverse-scale

geo(<prob|p=> )

Geometric distribution with probability

general(ll)

General log-likelihood function that you construct using SAS programming statements for a single or multiple continuous variables. The argument ll is an expression for the log of the distribution. If there are multiple variables specified before the tilde in a MODEL, PRIOR, or HYPERPRIOR statement, ll is interpreted as the log of the joint distribution for these variables. Note that in the MODEL statement, the response variable specified before the tilde is just a place holder and is of no consequence; the variable must have appeared in the construction of ll in the programming statements. general(constant) is equivalent to a uniform distribution on the real line. You can use the alias logden for this distribution.

ichisq(<df=>)

Inverse distribution with degrees of freedom

igamma(<shape|sp=> a, scale|s= )
igamma(<shape|sp=> a, iscale|is= )

Inverse-gamma distribution with shape and scale or inverse-scale

laplace(<location|loc|l=> , scale|s= )
laplace(<location|loc|l=> , iscale|is= )

Laplace distribution with location and scale or inverse-scale . This is also known as the double exponential distribution. You can use the alias dexpon for this distribution.

logistic(<location|loc|l=> , <scale|s=> )

Logistic distribution with location and scale

lognormal(<mean|m=> , sd= )
lognormal(<mean|m=> , var|v= )
lognormal(<mean|m=> , prec= )

Log-normal distribution with mean and standard deviation or variance or precision . You can use the aliases lognormal or lnorm for this distribution.

negbin(<n=> , <prob|p=> )

Negative binomial distribution with count and probability of success . You can use the alias nb for this distribution.

normal(<mean|m=> , sd= )
normal(<mean|m=> , var|v= )
normal(<mean|m=> , prec= )

Normal (Gaussian) distribution with mean and standard deviation or variance or precision . You can use the aliases gaussian, norm, or n for this distribution.

pareto(<shape|sp=> , <scale|s=> )

Pareto distribution with shape and scale

poisson(<mean|m=> )

Poisson distribution with mean

sichisq(<df=> , <scale|s=> )

Scaled inverse distribution with degrees of freedom and scale parameter

t(<mean|m=> , sd= , <df=> )
t(<mean|m=> , var|v= , <df=> )
t(<mean|m=> , prec= , <df=> )

distribution with mean , standard deviation or variance or precision , and degrees of freedom

uniform(<left|l=> , <right|r=> )

Uniform distribution with range and . You can use the alias unif for this distribution.

wald(<mean|m=> , <iscale|is=> )

Wald distribution with mean parameter and inverse scale parameter . This is also known as the Inverse Gaussian distribution. You can use the alias igaussian for this distribution.

weibull()

Weibull distribution with location (threshold) parameter , shape parameter , and scale parameter .

Table 54.3 Multivariate Distributions

Distribution Name

Definition

dirichlet(<alpha=>)

Dirichlet distribution with parameter vector , where must be a one-dimensional array of length greater than 1

iwish(<df=>, <scale=>)

Inverse Wishart distribution with degrees of freedom and symmetric positive definite scale array

mvn(<mu=>, <cov=>)

Multivariate normal distribution with mean vector and covariance matrix

multinom(<p=>)

Multinomial distribution with probability vector