Previous Page | Next Page

The MCMC Procedure

MODEL Statement

MODEL dependent-variable-list distribution ;

The MODEL statement is used to specify 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 is allowed to 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 52.2 (see the section Standard Distributions for density specification). These distributions can also be used 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 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. In the normal distribution, for example, you must indicate whether the second argument is a variance, a standard deviation, or a precision.

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

Table 52.2 Valid 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 .

Previous Page | Next Page | Top of Page