The MCMC Procedure

Standard Distributions

The section Univariate Distributions (Table 7 through Table 36) lists all univariate distributions that PROC MCMC recognizes. The section Multivariate Distributions (Table 37 through Table 41) lists all multivariate distributions that PROC MCMC recognizes. With the exception of the multinomial distribution, all these distributions can be used in the MODEL, PRIOR, and HYPERPRIOR statements. The multinomial distribution is supported only in the MODEL statement. The RANDOM statement supports a limited number of distributions; see Table 4 for the complete list.

See the section Using Density Functions in the Programming Statements for information about how to use distributions in the programming statements. To specify an arbitrary distribution, you can use the GENERAL and DGENERAL functions. See the section Specifying a New Distribution for more details. See the section Truncation and Censoring for tips about how to work with truncated distributions and censoring data.

Univariate Distributions

Table 7: Beta Distribution

PROC specification beta(a, b)
Density StartFraction normal upper Gamma left-parenthesis a plus b right-parenthesis Over normal upper Gamma left-parenthesis a right-parenthesis normal upper Gamma left-parenthesis b right-parenthesis EndFraction theta Superscript a minus 1 Baseline left-parenthesis 1 minus theta right-parenthesis Superscript b minus 1
Parameter restriction a greater-than 0, b greater-than 0
Range StartLayout Enlarged left-brace 1st Row 1st Column left-bracket 0 comma 1 right-bracket 2nd Column when a equals 1 comma b equals 1 2nd Row 1st Column left-bracket 0 comma 1 right-parenthesis 2nd Column when a equals 1 comma b not-equals 1 3rd Row 1st Column left-parenthesis 0 comma 1 right-bracket 2nd Column when a not-equals 1 comma b equals 1 4th Row 1st Column left-parenthesis 0 comma 1 right-parenthesis 2nd Column otherwise EndLayout
Mean StartFraction a Over a plus b EndFraction
Variance StartFraction a b Over left-parenthesis a plus b right-parenthesis squared left-parenthesis a plus b plus 1 right-parenthesis EndFraction
Mode StartLayout Enlarged left-brace 1st Row 1st Column StartFraction a minus 1 Over a plus b minus 2 EndFraction 2nd Column a greater-than 1 comma b greater-than 1 2nd Row 1st Column 0 and 1 2nd Column a less-than 1 comma b less-than 1 3rd Row 1st Column 0 2nd Column StartLayout Enlarged left-brace 1st Row  a less-than 1 comma b greater-than-or-equal-to 1 2nd Row  a equals 1 comma b greater-than 1 EndLayout 4th Row 1st Column 1 2nd Column StartLayout Enlarged left-brace 1st Row  a greater-than-or-equal-to 1 comma b less-than 1 2nd Row  a greater-than 1 comma b equals 1 EndLayout 5th Row 1st Column does not exist uniquely 2nd Column a equals b equals 1 EndLayout
Random number If min left-parenthesis a comma b right-parenthesis greater-than 1, see (Cheng 1978); if max left-parenthesis a comma b right-parenthesis less-than 1, see (Atkinson and Whittaker 1976) and (Atkinson 1979); if min left-parenthesis a comma b right-parenthesis less-than 1 and max left-parenthesis a comma b right-parenthesis greater-than 1, see (Cheng 1978); if a = 1 or b = 1, use the inversion method; if a equals b equals 1, use a uniform random number generator.


Table 8: Binary Distribution

PROC specification binary(p)
Density p Superscript theta Baseline left-parenthesis 1 minus p right-parenthesis Superscript 1 minus theta
Parameter restriction 0 less-than-or-equal-to p less-than-or-equal-to 1
Range StartLayout Enlarged left-brace 1st Row 1st Column StartSet 0 EndSet 2nd Column when p equals 0 2nd Row 1st Column StartSet 1 EndSet 2nd Column when p equals 1 3rd Row 1st Column StartSet 0 comma 1 EndSet 2nd Column otherwise EndLayout
Mean left-parenthesis p right-parenthesis
Variance p left-parenthesis 1 minus p right-parenthesis
Mode StartLayout Enlarged left-brace 1st Row 1st Column StartSet 1 EndSet 2nd Column when p equals 1 2nd Row 1st Column StartSet 0 EndSet 2nd Column otherwise EndLayout
Random number Generate u tilde uniform left-parenthesis 0 comma 1 right-parenthesis. If u less-than-or-equal-to p, theta equals 1; else, theta equals 0 period


Table 9: Binomial Distribution

PROC specification binomial(n, p)
Density StartBinomialOrMatrix n Choose theta EndBinomialOrMatrix p Superscript theta Baseline left-parenthesis 1 minus p right-parenthesis Superscript n minus theta
Parameter restriction n equals 0 comma 1 comma 2 comma ellipsis comma 0 less-than-or-equal-to p less-than-or-equal-to 1
Range theta element-of StartSet 0 comma ellipsis comma n EndSet
Mean n p
Variance n p left-parenthesis 1 minus p right-parenthesis
Mode left floor left-parenthesis n plus 1 right-parenthesis p right floor


Table 10: Cauchy Distribution

PROC specification cauchy(a, b)
Density StartFraction 1 Over pi EndFraction left-parenthesis StartFraction b Over b squared plus left-parenthesis theta minus a right-parenthesis squared EndFraction right-parenthesis
Parameter restriction b greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis
Mean Does not exist.
Variance Does not exist.
Mode a
Random number Generate u 1 comma u 2 tilde uniform left-parenthesis 0 comma 1 right-parenthesis; let v equals 2 u 2 minus 1. Repeat the procedure until u 1 squared plus v squared less-than 1. y equals v slash u 1 is a draw from the standard Cauchy, and theta equals a plus b y (Ripley 1987).


Table 11: chi squared Distribution

PROC specification chisq(nu)
Density StartFraction 1 Over normal upper Gamma left-parenthesis nu slash 2 right-parenthesis 2 Superscript nu slash 2 Baseline EndFraction theta Superscript left-parenthesis nu slash 2 right-parenthesis minus 1 Baseline e Superscript negative theta slash 2
Parameter restriction nu greater-than 0
Range theta element-of left-bracket 0 comma normal infinity right-parenthesis if nu equals 2; left-parenthesis 0 comma normal infinity right-parenthesis otherwise.
Mean nu
Variance 2 nu
Mode nu minus 2 if nu greater-than-or-equal-to 2; does not exist otherwise.
Random number chi squared is a special case of the gamma distribution: theta tilde gamma left-parenthesis nu slash 2 comma scale equals 2 right-parenthesis is a draw from the chi squared distribution.


Table 12: Exponential chi squared Distribution

PROC specification expchisq(nu)
Density StartFraction 1 Over normal upper Gamma left-parenthesis nu slash 2 right-parenthesis 2 Superscript nu slash 2 Baseline EndFraction exp left-parenthesis theta right-parenthesis Superscript nu slash 2 Baseline exp left-parenthesis minus exp left-parenthesis theta right-parenthesis slash 2 right-parenthesis
Parameter restriction nu greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis
Mode log left-parenthesis nu right-parenthesis
Random number Generate x 1 tilde chi squared left-parenthesis nu right-parenthesis, and theta equals log left-parenthesis x 1 right-parenthesis is a draw from the exponential chi squared distribution.
Relationship to the chi squared distribution theta tilde chi squared left-parenthesis nu right-parenthesis left right double arrow log left-parenthesis theta right-parenthesis tilde exp chi squared left-parenthesis nu right-parenthesis


Table 13: Exponential Exponential Distribution

PROC specification expexpon(scale = b ) expexpon(iscale = beta )
Density StartFraction 1 Over b EndFraction exp left-parenthesis theta right-parenthesis exp left-parenthesis minus exp left-parenthesis theta right-parenthesis slash b right-parenthesis beta exp left-parenthesis theta right-parenthesis exp left-parenthesis minus exp left-parenthesis theta right-parenthesis dot beta right-parenthesis
Parameter restriction b greater-than 0 beta greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis Same
Mode log left-parenthesis b right-parenthesis log left-parenthesis 1 slash beta right-parenthesis
Random number Generate x 1 tilde expon left-parenthesis scale equals b right-parenthesis, and theta equals log left-parenthesis x 1 right-parenthesis is a draw from the exponential exponential distribution. Note that an exponential exponential distribution is not the same as the double exponential distribution.
Relationship to the exponential distribution theta tilde expon left-parenthesis b right-parenthesis left right double arrow log left-parenthesis theta right-parenthesis tilde expExpon left-parenthesis b right-parenthesis


Table 14: Exponential Gamma Distribution

PROC specification expgamma(a, scale = b ) expgamma(a, iscale = beta )
Density StartFraction 1 Over b Superscript a Baseline normal upper Gamma left-parenthesis a right-parenthesis EndFraction e Superscript a theta Baseline exp left-parenthesis minus e Superscript theta Baseline slash b right-parenthesis StartFraction beta Superscript a Baseline Over normal upper Gamma left-parenthesis a right-parenthesis EndFraction e Superscript a theta Baseline exp left-parenthesis minus e Superscript theta Baseline dot beta right-parenthesis
Parameter restriction a greater-than 0 comma b greater-than 0 a greater-than 0 comma beta greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis Same
Mode log left-parenthesis a b right-parenthesis log left-parenthesis a slash beta right-parenthesis
Random number Generate x 1 tilde gamma left-parenthesis a comma scale equals b right-parenthesis, and theta equals log left-parenthesis x 1 right-parenthesis is a draw from the exponential gamma distribution.
Relationship to the normal upper Gamma distribution theta tilde gamma left-parenthesis a comma b right-parenthesis left right double arrow log left-parenthesis theta right-parenthesis tilde expGamma left-parenthesis a comma b right-parenthesis


Table 15: Exponential Inverse chi squared Distribution

PROC specification expichisq(nu)
Density StartStartFraction 1 OverOver normal upper Gamma left-parenthesis StartFraction nu Over 2 EndFraction right-parenthesis 2 Superscript nu slash 2 Baseline EndEndFraction exp left-parenthesis minus nu theta slash 2 right-parenthesis exp left-parenthesis negative 1 slash left-parenthesis 2 exp left-parenthesis theta right-parenthesis right-parenthesis right-parenthesis
Parameter restriction nu greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis
Mode minus log left-parenthesis nu right-parenthesis
Random number Generate x 1 tilde i chi squared left-parenthesis nu right-parenthesis, and theta equals log left-parenthesis x 1 right-parenthesis is a draw from the exponential inverse chi squared distribution.
Relationship to the i chi squared distribution theta tilde i chi squared left-parenthesis nu right-parenthesis left right double arrow log left-parenthesis theta right-parenthesis tilde exp i chi squared left-parenthesis nu right-parenthesis


Table 16: Exponential Inverse Gamma Distribution

PROC specification expigamma(a, scale = b ) expigamma(a, iscale = beta )
Density StartFraction b Superscript a Baseline Over normal upper Gamma left-parenthesis a right-parenthesis EndFraction exp left-parenthesis minus alpha theta right-parenthesis exp left-parenthesis negative b slash exp left-parenthesis theta right-parenthesis right-parenthesis StartFraction 1 Over beta Superscript alpha Baseline normal upper Gamma left-parenthesis a right-parenthesis EndFraction exp left-parenthesis minus alpha theta right-parenthesis exp left-parenthesis minus StartFraction 1 Over beta exp left-parenthesis theta right-parenthesis EndFraction right-parenthesis
Parameter restriction a greater-than 0 comma b greater-than 0 a greater-than 0 comma beta greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis Same
Mode minus log left-parenthesis a slash b right-parenthesis minus log left-parenthesis a beta right-parenthesis
Random number Generate x 1 tilde igamma left-parenthesis a comma scale equals b right-parenthesis, and theta equals log left-parenthesis x 1 right-parenthesis is a draw from the exponential inverse gamma distribution.
Relationship to the i normal upper Gamma distribution theta tilde igamma left-parenthesis a comma b right-parenthesis left right double arrow log left-parenthesis theta right-parenthesis tilde eigamma left-parenthesis a comma b right-parenthesis


Table 17: Exponential Scaled Inverse chi squared Distribution

PROC specification expsichisq(nu, s)
Density StartStartFraction left-parenthesis StartFraction nu Over 2 EndFraction right-parenthesis Superscript nu slash 2 Baseline OverOver normal upper Gamma left-parenthesis StartFraction nu Over 2 EndFraction right-parenthesis EndEndFraction s Superscript nu Baseline exp left-parenthesis minus nu theta slash 2 right-parenthesis exp left-parenthesis minus nu s squared slash left-parenthesis 2 exp left-parenthesis theta right-parenthesis right-parenthesis right-parenthesis
Parameter restriction nu greater-than 0 comma s greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis
Mode log left-parenthesis s squared right-parenthesis
Random number Generate x 1 tilde s i chi squared left-parenthesis nu comma s right-parenthesis, and theta equals log left-parenthesis x 1 right-parenthesis is a draw from the exponential scaled inverse chi squared distribution.
Relationship to the s i chi squared distribution theta tilde s i chi squared left-parenthesis nu comma s right-parenthesis left right double arrow log left-parenthesis theta right-parenthesis tilde exp s i chi squared left-parenthesis nu comma s right-parenthesis


Table 18: Exponential Distribution

PROC specification expon(scale = b ) expon(iscale = beta )
Density StartFraction 1 Over b EndFraction e Superscript negative theta slash b beta e Superscript minus beta theta
Parameter restriction b greater-than 0 beta greater-than 0
Range theta element-of left-bracket 0 comma normal infinity right-parenthesis Same
Mean b 1 slash beta
Variance b squared 1 slash beta squared
Mode 0 0
Random number The exponential distribution is a special case of the gamma distribution: theta tilde gamma left-parenthesis 1 comma scale equals b right-parenthesis is a draw from the exponential distribution.


Table 19: Gamma Distribution

PROC specification gamma(a, scale = b ) gamma(a, iscale = beta )
Density StartFraction 1 Over b Superscript a Baseline normal upper Gamma left-parenthesis a right-parenthesis EndFraction theta Superscript a minus 1 Baseline e Superscript negative theta slash b StartFraction beta Superscript a Baseline Over normal upper Gamma left-parenthesis a right-parenthesis EndFraction theta Superscript a minus 1 Baseline e Superscript minus beta theta
Parameter restriction a greater-than 0 comma b greater-than 0 a greater-than 0 comma beta greater-than 0
Range theta element-of left-bracket 0 comma normal infinity right-parenthesis if a equals 1 semicolon left-parenthesis 0 comma normal infinity right-parenthesis otherwise. Same
Mean ab a slash beta
Variance a b squared a slash beta squared
Mode left-parenthesis a minus 1 right-parenthesis b if a greater-than-or-equal-to 1 left-parenthesis a minus 1 right-parenthesis slash beta if a greater-than-or-equal-to 1
Random number See (McGrath and Irving 1973).


Table 20: Geometric Distribution

PROC specification geo(p)
Density * p left-parenthesis 1 minus p right-parenthesis Superscript theta
Parameter restriction 0 less-than p less-than-or-equal-to 1
Range theta element-of StartLayout Enlarged left-brace 1st Row 1st Column StartSet 0 comma 1 comma 2 comma ellipsis EndSet 2nd Column 0 less-than p less-than 1 2nd Row 1st Column StartSet 0 EndSet 2nd Column p equals 1 EndLayout
Mean StartFraction 1 minus p Over p EndFraction
Variance StartFraction 1 minus p Over p squared EndFraction
Mode 0
Random number Based on samples obtained from a Bernoulli distribution with probability p until the first success.
*The random variable theta is the total number of failures in an experiment before the first success. This density function is not to be confused with another popular formulation, p left-parenthesis 1 minus p right-parenthesis Superscript theta minus 1, which counts the total number of trials until the first success.


Table 21: Inverse chi squared Distribution

PROC specification ichisq(nu)
Density StartFraction 1 Over normal upper Gamma left-parenthesis nu slash 2 right-parenthesis 2 Superscript nu slash 2 Baseline EndFraction theta Superscript minus left-parenthesis nu slash 2 plus 1 right-parenthesis Baseline e Superscript negative 1 slash left-parenthesis 2 theta right-parenthesis
Parameter restriction nu greater-than 0
Range theta element-of left-parenthesis 0 comma normal infinity right-parenthesis
Mean StartFraction 1 Over nu minus 2 EndFraction if nu greater-than 2
Variance StartFraction 2 Over left-parenthesis nu minus 2 right-parenthesis squared left-parenthesis nu minus 4 right-parenthesis EndFraction if nu greater-than 4
Mode StartFraction 1 Over nu plus 2 EndFraction
Random number Inverse chi squared is a special case of the inverse gamma distribution: theta tilde igamma left-parenthesis nu slash 2 comma iscale equals 2 right-parenthesis is a draw from the inverse chi squared distribution.


Table 22: Inverse Gamma Distribution

PROC specification igamma(a, scale = b ) igamma(a, iscale = beta )
Density StartFraction b Superscript a Baseline Over normal upper Gamma left-parenthesis a right-parenthesis EndFraction theta Superscript minus left-parenthesis a plus 1 right-parenthesis Baseline e Superscript negative b slash theta StartFraction 1 Over beta Superscript a Baseline normal upper Gamma left-parenthesis a right-parenthesis EndFraction theta Superscript minus left-parenthesis a plus 1 right-parenthesis Baseline e Superscript negative 1 slash beta theta
Parameter restriction a greater-than 0 comma b greater-than 0 a greater-than 0 comma beta greater-than 0
Range theta element-of left-parenthesis 0 comma normal infinity right-parenthesis Same
Mean StartFraction b Over a minus 1 EndFraction if a greater-than 1 StartFraction 1 Over beta left-parenthesis a minus 1 right-parenthesis EndFraction if a greater-than 1
Variance StartFraction b squared Over left-parenthesis a minus 1 right-parenthesis squared left-parenthesis a minus 2 right-parenthesis EndFraction StartFraction 1 Over beta squared left-parenthesis a minus 1 right-parenthesis squared left-parenthesis a minus 2 right-parenthesis EndFraction
Mode StartFraction b Over a plus 1 EndFraction StartFraction 1 Over beta left-parenthesis a plus 1 right-parenthesis EndFraction
Random number Generate x 1 tilde gamma left-parenthesis a comma scale equals b right-parenthesis, and theta equals 1 slash x 1 is a draw from the igamma left-parenthesis a comma iscale equals b right-parenthesis distribution.
Relationship to the gamma distribution theta tilde gamma left-parenthesis a comma iscale equals b right-parenthesis left right double arrow 1 slash theta tilde igamma left-parenthesis a comma scale equals b right-parenthesis


Table 23: Laplace (Double Exponential) Distribution

PROC specification laplace(a, scale = b) laplace(a, iscale = beta)
Density StartFraction 1 Over 2 b EndFraction e Superscript minus StartAbsoluteValue theta minus a EndAbsoluteValue slash b StartFraction beta Over 2 EndFraction e Superscript minus beta StartAbsoluteValue theta minus a EndAbsoluteValue
Parameter restriction b greater-than 0 beta greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis Same
Mean a a
Variance 2 b squared 2 slash beta squared
Mode a a
Random number Inverse CDF. upper F left-parenthesis theta right-parenthesis equals StartLayout Enlarged left-brace 1st Row 1st Column one-half exp left-parenthesis minus StartFraction a minus theta Over b EndFraction right-parenthesis 2nd Column theta less-than a 2nd Row 1st Column 1 minus one-half exp left-parenthesis minus StartFraction theta minus a Over b EndFraction right-parenthesis 2nd Column theta greater-than-or-equal-to a EndLayout period Generate u 1 comma u 2 tilde uniform left-parenthesis 0 comma 1 right-parenthesis. If u 1 less-than 0.5 comma theta equals a plus b log left-parenthesis u 2 right-parenthesis semicolon else theta equals a minus b log left-parenthesis u 2 right-parenthesis. theta is a draw from the Laplace distribution.


Table 24: Logistic Distribution

PROC specification logistic(a, b)
Density StartStartFraction exp left-parenthesis minus StartFraction theta minus a Over b EndFraction right-parenthesis OverOver b left-parenthesis 1 plus exp left-parenthesis minus StartFraction theta minus a Over b EndFraction right-parenthesis right-parenthesis squared EndEndFraction
Parameter restriction b greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis
Mean a
Variance StartFraction pi squared b squared Over 3 EndFraction
Mode a
Random number Inverse CDF method with upper F left-parenthesis theta right-parenthesis equals left-parenthesis 1 plus exp left-parenthesis minus StartFraction theta minus a Over b EndFraction right-parenthesis right-parenthesis Superscript negative 1. Generate u tilde uniform left-parenthesis 0 comma 1 right-parenthesis, and theta equals a minus b log left-parenthesis 1 slash u minus 1 right-parenthesis is a draw from the logistic distribution.


Table 25: Lognormal Distribution

PROC specification lognormal(mu, sd = s) lognormal(mu, var = v) lognormal(mu, prec = tau)
Density StartFraction 1 Over theta s StartRoot 2 pi EndRoot EndFraction exp left-parenthesis minus StartFraction left-parenthesis log theta minus mu right-parenthesis squared Over 2 s squared EndFraction right-parenthesis StartFraction 1 Over theta StartRoot 2 pi v EndRoot EndFraction exp left-parenthesis minus StartFraction left-parenthesis log theta minus mu right-parenthesis squared Over 2 v EndFraction right-parenthesis StartFraction 1 Over theta EndFraction StartRoot StartFraction tau Over 2 pi EndFraction EndRoot exp left-parenthesis minus StartFraction tau left-parenthesis log theta minus mu right-parenthesis squared Over 2 EndFraction right-parenthesis
Parameter restriction s greater-than 0 v greater-than 0 tau greater-than 0
Range theta element-of left-parenthesis 0 comma normal infinity right-parenthesis Same Same
Mean exp left-parenthesis mu plus s squared slash 2 right-parenthesis exp left-parenthesis mu plus v slash 2 right-parenthesis exp left-parenthesis mu plus 1 slash left-parenthesis 2 tau right-parenthesis right-parenthesis
Variance StartLayout 1st Row  exp left-parenthesis 2 left-parenthesis mu plus s squared right-parenthesis right-parenthesis 2nd Row  minus exp left-parenthesis 2 mu plus s squared right-parenthesis EndLayout StartLayout 1st Row  exp left-parenthesis 2 left-parenthesis mu plus v right-parenthesis right-parenthesis 2nd Row  minus exp left-parenthesis 2 mu plus v right-parenthesis EndLayout StartLayout 1st Row  exp left-parenthesis 2 left-parenthesis mu plus 1 slash tau right-parenthesis right-parenthesis 2nd Row  minus exp left-parenthesis 2 mu plus 1 slash tau right-parenthesis EndLayout
Mode exp left-parenthesis mu minus s squared right-parenthesis exp left-parenthesis mu minus v right-parenthesis exp left-parenthesis mu minus 1 slash tau right-parenthesis
Random number Generate x 1 tilde normal left-parenthesis 0 comma 1 right-parenthesis, and theta equals exp left-parenthesis mu plus s x 1 right-parenthesis is a draw from the lognormal distribution.


Table 26: Negative Binomial Distribution

PROC specification negbin(n, p)
Density StartBinomialOrMatrix theta plus n minus 1 Choose n minus 1 EndBinomialOrMatrix p Superscript n Baseline left-parenthesis 1 minus p right-parenthesis Superscript theta
Parameter restriction n equals 1 comma 2 comma ellipsis comma and 0 less-than p less-than-or-equal-to 1
Range theta element-of StartLayout Enlarged left-brace 1st Row 1st Column StartSet 0 comma 1 comma 2 comma ellipsis EndSet 2nd Column 0 less-than p less-than 1 2nd Row 1st Column StartSet 0 EndSet 2nd Column p equals 1 EndLayout
Mean roundleft-parenthesis StartFraction n left-parenthesis 1 minus p right-parenthesis Over p EndFraction right-parenthesis
Variance StartFraction n left-parenthesis 1 minus p right-parenthesis Over p squared EndFraction
Mode StartLayout Enlarged left-brace 1st Row 1st Column 0 2nd Column n equals 1 2nd Row 1st Column round left-parenthesis StartFraction left-parenthesis n minus 1 right-parenthesis left-parenthesis 1 minus p right-parenthesis Over p EndFraction right-parenthesis 2nd Column n greater-than 1 EndLayout
Random number Generate x 1 tilde gamma left-parenthesis n comma 1 right-parenthesis, and theta tilde Poisson left-parenthesis x 1 dot left-parenthesis 1 minus p right-parenthesis slash p right-parenthesis (Fishman 1996).


Table 27: Normal Distribution

PROC specification normal(mu, sd = s) normal(mu, var = v) normal(mu, prec = tau)
Density StartFraction 1 Over s StartRoot 2 pi EndRoot EndFraction exp left-parenthesis minus StartFraction left-parenthesis theta minus mu right-parenthesis squared Over 2 s squared EndFraction right-parenthesis StartFraction 1 Over StartRoot 2 pi v EndRoot EndFraction exp left-parenthesis minus StartFraction left-parenthesis theta minus mu right-parenthesis squared Over 2 v EndFraction right-parenthesis StartRoot StartFraction tau Over 2 pi EndFraction EndRoot exp left-parenthesis minus StartFraction tau left-parenthesis theta minus mu right-parenthesis squared Over 2 EndFraction right-parenthesis
Parameter restriction s greater-than 0 v greater-than 0 tau greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis Same Same
Mean mu Same Same
Variance s squared v 1 slash tau
Mode mu Same Same


Table 28: NormalCAR Distribution

PROC specification normalcar(neighbors=, num=, sd= s) normalcar(neighbors=, num=, var= v) normalcar(neighbors=, num=, prec= tau)
Density theta Subscript i Baseline vertical-bar theta Subscript negative i Baseline tilde upper N left-parenthesis sigma-summation Underscript j element-of upper N left-parenthesis i right-parenthesis Endscripts theta Subscript j Baseline slash m Subscript i Baseline comma s squared right-parenthesis theta Subscript i Baseline vertical-bar theta Subscript negative i Baseline tilde upper N left-parenthesis sigma-summation Underscript j element-of upper N left-parenthesis i right-parenthesis Endscripts theta Subscript j Baseline slash m Subscript i Baseline comma v right-parenthesis theta Subscript i Baseline vertical-bar theta Subscript negative i Baseline tilde upper N left-parenthesis sigma-summation Underscript j element-of upper N left-parenthesis i right-parenthesis Endscripts theta Subscript j Baseline slash m Subscript i Baseline comma 1 slash tau right-parenthesis
Notation i is the area or site index, m Subscript i is the number of neighbors to i, and upper N left-parenthesis i right-parenthesis is the set of neighbors to i.
Parameter restriction s greater-than 0 v greater-than 0 tau greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis Same Same
Mean average of neighbors Same Same
Variance s squared v 1 slash tau
Mode average of neighbors Same Same


Table 29: Pareto Distribution

PROC specification pareto(a, b)
Density StartFraction a Over b EndFraction left-parenthesis StartFraction b Over theta EndFraction right-parenthesis Superscript a plus 1
Parameter restriction a greater-than 0 comma b greater-than 0
Range theta element-of left-bracket b comma normal infinity right-parenthesis
Mean StartFraction a b Over a minus 1 EndFraction if a greater-than 1
Variance StartFraction b squared a Over left-parenthesis a minus 1 right-parenthesis squared left-parenthesis a minus 2 right-parenthesis EndFraction if a greater-than 2
Mode b
Random number Inverse CDF method with upper F left-parenthesis theta right-parenthesis equals 1 minus left-parenthesis b slash theta right-parenthesis Superscript a . Generate u tilde uniform left-parenthesis 0 comma 1 right-parenthesis, and theta equals StartFraction b Over u Superscript 1 slash a Baseline EndFraction is a draw from the Pareto distribution.
Useful transformation x equals 1 slash theta is Beta(a, 1)I{x less-than 1 slash b}.


Table 30: Poisson Distribution

PROC specification poisson(lamda)
Density StartFraction lamda Superscript theta Baseline Over theta factorial EndFraction exp left-parenthesis negative lamda right-parenthesis
Parameter restriction lamda greater-than-or-equal-to 0
Range theta element-of StartLayout Enlarged left-brace 1st Row 1st Column StartSet 0 comma 1 comma ellipsis EndSet 2nd Column if lamda greater-than 0 2nd Row 1st Column StartSet 0 EndSet 2nd Column if lamda equals 0 EndLayout
Mean lamda
Variance lamda, if lamda greater-than 0
Mode roundleft-parenthesis lamda right-parenthesis


Table 31: Scaled Inverse chi squared Distribution

PROC specification sichisq(nu comma s squared)
Density StartFraction left-parenthesis s squared nu slash 2 right-parenthesis Superscript nu slash 2 Baseline Over normal upper Gamma left-parenthesis nu slash 2 right-parenthesis EndFraction theta Superscript minus left-parenthesis nu slash 2 plus 1 right-parenthesis Baseline e Superscript minus nu s squared slash left-parenthesis 2 theta right-parenthesis
Parameter restriction nu greater-than 0 comma s greater-than 0
Range theta element-of left-parenthesis 0 comma normal infinity right-parenthesis
Mean StartFraction nu Over nu minus 2 EndFraction s squared if nu greater-than 2
Variance StartFraction 2 nu squared Over left-parenthesis nu minus 2 right-parenthesis squared left-parenthesis nu minus 4 right-parenthesis EndFraction s Superscript 4 if nu greater-than 4
Mode StartFraction nu Over nu plus 2 EndFraction s squared
Random number Scaled inverse chi squared is a special case of the inverse gamma distribution: theta tilde igamma left-parenthesis nu slash 2 comma scale equals left-parenthesis nu s squared right-parenthesis slash 2 right-parenthesis is a draw from the scaled inverse chi squared distribution.


Table 32: t Distribution

PROC specification t(mu, sd = s, nu) t(mu, var = v, nu) t(mu, prec = tau, nu)
Density StartStartFraction normal upper Gamma left-parenthesis StartFraction nu plus 1 Over 2 EndFraction right-parenthesis OverOver normal upper Gamma left-parenthesis StartFraction nu Over 2 EndFraction right-parenthesis s StartRoot nu pi EndRoot EndEndFraction left-parenthesis 1 plus StartFraction left-parenthesis theta minus mu right-parenthesis squared Over nu s squared EndFraction right-parenthesis Superscript minus StartFraction nu plus 1 Over 2 EndFraction StartStartFraction normal upper Gamma left-parenthesis StartFraction nu plus 1 Over 2 EndFraction right-parenthesis OverOver normal upper Gamma left-parenthesis StartFraction nu Over 2 EndFraction right-parenthesis StartRoot nu pi v EndRoot EndEndFraction left-parenthesis 1 plus StartFraction left-parenthesis theta minus mu right-parenthesis squared Over nu v EndFraction right-parenthesis Superscript minus StartFraction nu plus 1 Over 2 EndFraction StartStartFraction normal upper Gamma left-parenthesis StartFraction nu plus 1 Over 2 EndFraction right-parenthesis StartRoot tau EndRoot OverOver normal upper Gamma left-parenthesis StartFraction nu Over 2 EndFraction right-parenthesis StartRoot nu pi EndRoot EndEndFraction left-parenthesis 1 plus StartFraction tau left-parenthesis theta minus mu right-parenthesis squared Over nu EndFraction right-parenthesis Superscript minus StartFraction nu plus 1 Over 2 EndFraction
Parm restriction s greater-than 0, nu greater-than 0 v greater-than 0, nu greater-than 0 tau greater-than 0, nu greater-than 0
Range theta element-of left-parenthesis negative normal infinity comma normal infinity right-parenthesis Same Same
Mean mu if nu greater-than 1 Same Same
Variance StartFraction nu Over nu minus 2 EndFraction s squared if nu greater-than 2 StartFraction nu Over nu minus 2 EndFraction v if nu greater-than 2 StartFraction nu Over nu minus 2 EndFraction StartFraction 1 Over tau EndFraction if nu greater-than 2
Mode mu Same Same
Random number x 1 tilde normal left-parenthesis 0 comma 1 right-parenthesis comma x 2 tilde chi squared left-parenthesis d right-parenthesis comma and theta equals m plus sigma x 1 StartRoot d slash x 2 EndRoot is a draw from the t distribution.


Table 33: Table (Categorical) Distribution

PROC specification table(bold p), where bold p equals StartSet p Subscript i Baseline EndSet, for i equals 1 comma 2 comma ellipsis comma k
Density f left-parenthesis theta equals i right-parenthesis equals p Subscript i
Parameter restriction sigma-summation Underscript i Overscript k Endscripts p Subscript i Baseline equals 1 with all p Subscript i Baseline greater-than 0
Range theta element-of StartSet 1 comma 2 comma ellipsis comma k EndSet
Mode i such that p Subscript i Baseline equals max left-parenthesis p 1 comma ellipsis comma p Subscript k Baseline right-parenthesis
Random number Inverse CDF method with upper F left-parenthesis theta equals i right-parenthesis equals sigma-summation Underscript j equals 1 Overscript i Endscripts p Subscript j.


Table 34: Uniform Distribution

PROC specification uniform(a, b)
Density StartLayout Enlarged left-brace 1st Row 1st Column StartFraction 1 Over a minus b EndFraction 2nd Column if a greater-than b 2nd Row 1st Column StartFraction 1 Over b minus a EndFraction 2nd Column if b greater-than a 3rd Row 1st Column 1 2nd Column if a equals b EndLayout
Parameter restriction none
Range theta element-of left-bracket a comma b right-bracket
Mean StartFraction a plus b Over 2 EndFraction
Variance StartFraction StartAbsoluteValue b minus a EndAbsoluteValue squared Over 12 EndFraction
Mode Does not exist
Random number Mersenne Twister (Matsumoto and Kurita 1992, 1994; Matsumoto and Nishimura 1998)


Table 35: Wald Distribution

PROC specification wald(mu, lamda)
Density StartRoot StartFraction lamda Over 2 pi theta cubed EndFraction EndRoot exp left-parenthesis StartFraction minus lamda left-parenthesis theta minus mu right-parenthesis squared Over 2 mu squared theta EndFraction right-parenthesis
Parameter restriction mu greater-than 0 comma lamda greater-than 0
Range theta element-of left-parenthesis 0 comma normal infinity right-parenthesis
Mean mu
Variance mu cubed slash lamda
Mode mu left-bracket left-parenthesis 1 plus StartFraction 9 mu squared Over 4 lamda squared EndFraction right-parenthesis Superscript 1 slash 2 Baseline minus StartFraction 3 mu Over 2 lamda EndFraction right-bracket
Random number Generate nu 0 tilde chi Subscript left-parenthesis 1 right-parenthesis Superscript 2. Let x 1 equals mu plus StartFraction mu squared nu 0 Over 2 lamda EndFraction minus StartFraction mu Over 2 lamda EndFraction StartRoot 4 mu lamda nu 0 plus mu squared nu 0 squared EndRoot and x 2 equals mu squared slash x 1. Perform a Bernoulli trial, w tilde Bernoulli left-parenthesis StartFraction mu Over mu plus x 1 EndFraction right-parenthesis. If w equals 1, choose theta equals x 1; otherwise, choose theta equals x 2 (Michael, Schucany, and Haas 1976).


Table 36: Weibull Distribution

PROC specification weibull(mu, c, sigma)
Density exp left-parenthesis minus left-parenthesis StartFraction theta minus mu Over sigma EndFraction right-parenthesis Superscript c Baseline right-parenthesis StartFraction c Over sigma EndFraction left-parenthesis StartFraction theta minus mu Over sigma EndFraction right-parenthesis Superscript c minus 1
Parameter restriction c greater-than 0 comma sigma greater-than 0
Range theta element-of left-bracket mu comma normal infinity right-parenthesis if c equals 1 semicolon left-parenthesis mu comma normal infinity right-parenthesis otherwise
Mean mu plus sigma normal upper Gamma left-parenthesis 1 plus 1 slash c right-parenthesis
Variance sigma squared left-bracket normal upper Gamma left-parenthesis 1 plus 2 slash c right-parenthesis minus normal upper Gamma squared left-parenthesis 1 plus 1 slash c right-parenthesis right-bracket
Mode mu plus sigma left-parenthesis 1 minus 1 slash c right-parenthesis Superscript 1 slash c if c greater-than 1
Random number Inverse CDF method with upper F left-parenthesis theta right-parenthesis equals 1 minus exp left-parenthesis minus left-parenthesis minus StartFraction theta minus mu Over sigma EndFraction right-parenthesis Superscript c Baseline right-parenthesis. Generate u tilde uniform left-parenthesis 0 comma 1 right-parenthesis, and theta equals mu plus sigma dot left-parenthesis minus ln u right-parenthesis Superscript 1 slash c is a draw from the Weibull distribution.


Multivariate Distributions

Table 37: Dirichlet Distribution

PROC specification bold-italic theta tilde dirich(bold-italic alpha), where bold-italic theta equals StartSet theta Subscript i Baseline EndSet comma bold-italic alpha equals StartSet alpha Subscript i Baseline EndSet, for i equals 1 comma 2 comma ellipsis comma k
Density StartFraction normal upper Gamma left-parenthesis alpha 0 right-parenthesis Over product Underscript i equals 1 Overscript k Endscripts normal upper Gamma left-parenthesis alpha Subscript i Baseline right-parenthesis EndFraction product Underscript i equals 1 Overscript k Endscripts theta Subscript i Superscript alpha Super Subscript i Superscript minus 1, where alpha 0 equals sigma-summation Underscript i equals 1 Overscript k Endscripts alpha Subscript i
Parameter restriction alpha Subscript i Baseline greater-than 0
Range theta Subscript i Baseline greater-than 0, sigma-summation Underscript i equals 1 Overscript k Endscripts theta Subscript i Baseline equals 1
Mean alpha Subscript j Baseline slash alpha 0
Mode left-parenthesis alpha Subscript j Baseline minus 1 right-parenthesis slash left-parenthesis alpha 0 minus k right-parenthesis


Table 38: Inverse Wishart Distribution

PROC specification bold-italic theta tilde iwishart(nu, bold upper S), both bold-italic theta and bold upper S are k times k matrices
Density left-parenthesis 2 Superscript StartFraction nu k Over 2 EndFraction Baseline pi Superscript StartFraction k left-parenthesis k minus 1 right-parenthesis Over 4 EndFraction Baseline product Underscript i equals 1 Overscript k Endscripts normal upper Gamma left-parenthesis StartFraction nu plus 1 minus i Over 2 EndFraction right-parenthesis right-parenthesis Superscript negative 1 Baseline StartAbsoluteValue bold upper S EndAbsoluteValue Superscript StartFraction nu Over 2 EndFraction Baseline StartAbsoluteValue bold-italic theta EndAbsoluteValue Superscript minus StartFraction nu plus k plus 1 Over 2 EndFraction Baseline exp left-parenthesis minus one-half normal t normal r left-parenthesis bold upper S bold-italic theta Superscript negative 1 Baseline right-parenthesis right-parenthesis
Parameter restriction bold upper S must be symmetric and positive definite; nu greater-than k minus 1
Range bold-italic theta is symmetric and positive definite
Mean bold upper S slash left-parenthesis nu minus k minus 1 right-parenthesis
Mode bold upper S slash left-parenthesis nu plus k plus 1 right-parenthesis


Table 39: Multivariate Normal Distribution

PROC specification bold-italic theta tilde mvn(bold-italic mu, bold upper Sigma), where bold-italic theta equals StartSet theta Subscript k Baseline EndSet comma bold-italic mu equals StartSet mu Subscript k Baseline EndSet, for i equals 1 comma 2 comma ellipsis comma k, and bold upper Sigma is a k times k variance matrix
Density exp left-parenthesis minus one-half left-parenthesis bold-italic theta minus bold-italic mu right-parenthesis prime bold upper Sigma Superscript negative 1 Baseline left-parenthesis bold-italic theta minus bold-italic mu right-parenthesis right-parenthesis slash StartRoot left-parenthesis 2 pi right-parenthesis Superscript k Baseline StartAbsoluteValue bold upper Sigma EndAbsoluteValue EndRoot
Parameter restriction bold upper Sigma must be symmetric and positive definite
Range negative normal infinity less-than theta Subscript i Baseline less-than normal infinity
Mean bold-italic mu
Mode bold-italic mu


Table 40: Autoregressive Multivariate Normal Distribution

PROC specification bold-italic theta tildeMVNAR(bold-italic mu, sd=sigma,rho) bold-italic theta tildeMVNAR(bold-italic mu, var=sigma squared,rho) bold-italic theta tildeMVNAR(bold-italic mu, prec=1 slash sigma squared, rho)
Density exp left-parenthesis minus one-half left-parenthesis bold-italic theta minus bold-italic mu right-parenthesis prime left-parenthesis sigma squared bold upper Sigma right-parenthesis Superscript negative 1 Baseline left-parenthesis bold-italic theta minus bold-italic mu right-parenthesis right-parenthesis slash StartRoot left-parenthesis 2 pi right-parenthesis Superscript k Baseline StartAbsoluteValue left-parenthesis sigma squared bold upper Sigma right-parenthesis EndAbsoluteValue EndRoot where
bold upper Sigma equals Start 6 By 6 Matrix 1st Row 1st Column 1 2nd Column rho 3rd Column rho squared 4th Column rho cubed 5th Column midline-horizontal-ellipsis 6th Column rho Superscript k Baseline 2nd Row 1st Column rho 2nd Column 1 3rd Column rho 4th Column rho squared 5th Column midline-horizontal-ellipsis 6th Column rho Superscript k minus 1 Baseline 3rd Row 1st Column rho squared 2nd Column rho 3rd Column 1 4th Column rho 5th Column midline-horizontal-ellipsis 6th Column rho Superscript k minus 2 Baseline 4th Row 1st Column rho cubed 2nd Column rho squared 3rd Column rho 4th Column 1 5th Column midline-horizontal-ellipsis 6th Column rho Superscript k minus 3 Baseline 5th Row 1st Column vertical-ellipsis 2nd Column vertical-ellipsis 3rd Column vertical-ellipsis 4th Column vertical-ellipsis 5th Column down-right-diagonal-ellipsis 6th Column vertical-ellipsis 6th Row 1st Column rho Superscript k Baseline 2nd Column rho Superscript k minus 1 Baseline 3rd Column rho Superscript k minus 2 Baseline 4th Column rho Superscript k minus 3 Baseline 5th Column midline-horizontal-ellipsis 6th Column 1 EndMatrix
Parameter restriction sigma greater-than 0 and negative 1 less-than rho less-than 1
Range negative normal infinity less-than theta Subscript i Baseline less-than normal infinity
Mean bold-italic mu
Mode bold-italic mu
Special Case When rho equals 0, the distribution simplifies to mvn(bold-italic mu, sigma squared dot bold upper I Subscript k), where bold upper I Subscript k denotes the k times k identity matrix


Table 41: Multinomial Distribution

PROC specification bold-italic theta tilde multinom(bold p), where bold-italic theta equals StartSet theta Subscript i Baseline EndSet and bold p equals StartSet p Subscript i Baseline EndSet, for i equals 1 comma 2 comma ellipsis comma k
Density StartFraction n factorial Over theta 1 midline-horizontal-ellipsis theta Subscript k Baseline EndFraction p 1 Superscript theta 1 Baseline midline-horizontal-ellipsis p Subscript k Superscript theta Super Subscript k, where sigma-summation Underscript i Overscript k Endscripts theta Subscript i Baseline equals n
Parameter restriction sigma-summation Underscript i Overscript k Endscripts p Subscript i Baseline equals 1 with all p Subscript i Baseline greater-than 0
Range theta Subscript i Baseline element-of StartSet 0 comma ellipsis comma n EndSet, nonnegative integers
Mean n dot bold p


Last updated: March 08, 2022