Appendix - Distributions
date post
14-Oct-2014Category
Documents
view
46download
1
Embed Size (px)
Transcript of Appendix - Distributions
DISTRIBUTIONS
512
18.2
Continuous univariate distributions
Table 18.1 Beta density: Beta(, ) Model p() =1 B(,)
Examples 1 (1 )1()() (+)Density
3.0
= 4, = 1 = 0.2, = 6
2.0
with B(, ) =
2.5
= 3, = 3 = 0.7, = 0.7
1.5
Condition: > 0, > 0 Range: [0,1] Parameters: , : shape Moments mean: mode: variance: (+) 1 (+2) (+)2 (++1)
0.0
0.5
1.0
= 1, = 1
0.0
0.2
0.4
0.6
0.8
1.0
Program commands R: dbeta(theta,alpha,beta)
WB/JAGS: theta ~ dbeta(alpha,beta) SAS: theta ~ beta(alpha,beta)
DISTRIBUTIONS Table 18.2 Cauchy distribution: Cauchy(, ) Model p() = (1 2 +()2
513
Examples )0.5 0.4 N( = 5, = 1)
Condition: > 0 Range: (, ) Parameters: : location, : scale
Density
0.2
0.3
= 5, = 1
= 7, = 1
= 4, = 2 0.1 0.0 0
2
4
6
8
10
Moments mean: mode: variance: -
Program commands R: WB/JAGS: SAS: dcauchy(theta,mu,sigma) theta ~ cauchy(mu,sigma)
Note: Cauchy distribution is a special case of location-scale t-distribution: Cauchy(, ) = t(1, , ).
DISTRIBUTIONS Table 18.3 Chi-squared density: 2 () Model p() =1 (/2)1 e/2 (/2)2/21.0 =1 0.8
514
Examples
Condition: > 0 Range: = 2 : [0, ) otherwise : (0, ) Parameters: : degrees of freedom
Density
0.2
0.4
0.6
= 0.01
=5 = 10
0.0 0
2
4
6
8
Moments mean: mode: nu 2 ( 2), otherwise
Program commands R: WB/JAGS: SAS: dchisq(theta,nu) theta ~ dchisqr(nu) theta ~ chisq(nu)
variance: 2
Note: Chi-squared is a special case of a gamma distribution: 2 () = Gamma( = /2, = 1/2) (rate). JAGS oers a non-central 2 -distribution: theta dnchisqr(nu,delta), > 0 non-centrality parameter. JAGS oers an F-distribution (ratio of 2 independent 2 s): theta df(nu1, nu2), with nu1, nu2 = dfs of numerator and denominator, resp.
DISTRIBUTIONS Table 18.4 Exponential density: Exp() Model rate: p() = eDensity
515
Examples3.0 =4 rate =
Condition: > 0 Range: [0, ) Parameters: : rate
1.0
1.5
2.0
2.5
=2 0.5
0.0
= 0.1 0
=1
2
4
6
8
Moments rate: mean: mode: variance: 1
Program commands R: dexp(theta,lambda)
01 2
WB/JAGS: theta ~ dexp(lambda) SAS: (scale) theta ~ expon(iscale=lambda) theta ~ expon(scale=ilambda)
Note: Exponential is special case of gamma distribution: Exp()= Gamma( = 1, ).
DISTRIBUTIONS Table 18.5 Gamma density: Gamma(, ) Model rate: p() = ()
516
Examples (1) e
3.0
= 0.1, = 0.1
1/scale =
Condition: > 0, > 0 Range: = 1 : (0, ) otherwise : [0, ) Parameters: : shape, : rate
2.0
2.5
= 20, = 20
Density
1.0
1.5
0.5
= 1, = 1 = 4, = 1
0.0 0
2
4
6
8
Moments rate: mean: mode: variance: 1 2
Program commands R: (scale) ( 1) WB/JAGS: SAS: (scale) dgamma(theta,alpha,rate=beta) dgamma(theta,alpha,scale=ibeta) theta ~ dgamma(alpha,beta) theta ~ gamma(alpha,iscale=beta) theta ~ gamma(alpha,scale=ibeta)
Note: WB and JAGS oer a generalized gamma distribution GenGamma: GenGamma(, , ) 1/ Gamma(, ), with = 1/ . WB/JAGS command: theta dgen.gamma(alpha,beta,lambda).
DISTRIBUTIONS Table 18.6 Inverse chi-squared density: Inv 2 () Model p() =1 (/2+1) e1/(2) (/2)2/24 =5
517
Examples
Condition: > 0 Range: (0, ) Parameters: : degrees of freedom
Density
1
2
3
=3 =1 0 0 5 10 15
Moments mean: mode: variance:1 2 1 +2
Program commands ( > 2) R: WB/JAGS: ( > 4) SAS: dchisq(1/theta,nu)/theta^2 theta 0, > 0 Range: (0, ) Parameters: : shape, : rate
Density
2
3
= 20, = 20
1
Gamma( = 4, = 1) 0 = 1, = 1 0 2 4 6 8
Moments rate: mean: mode: (1)
Program commands
R: (scale)
dgamma(1/theta,alpha,rate=beta)/theta^2 dgamma(1/theta,alpha,scale=beta)/theta^2
(+1)
WB/JAGS: theta 0 Range: (, ) Parameters: : location, : scale Examples
519
0.6
0.5
= 5, = 1
= 7, = 1
Density
0.3
0.4
= 4, = 2 0.2 0.0 0 0.1
2
4
6
8
10
Moments scale: mean: mode:
Program commands R: dlaplace(theta,mu,sigma)
WB/JAGS: (rate) theta ~ ddexp(isigma) SAS: (rate) theta ~ laplace(mu,scale=sigma) theta ~ laplace(mu,iscale=isigma)
variance: 2 2
Note: Laplace distribution is also called double exponential distribution. R function dlaplace is available from R package VGAM.
DISTRIBUTIONS Table 18.9 Logistic distribution: Logistic(, ) Model p() = ( )[ ( )]2 exp exp Examples
520
0.5
Condition: > 0 Range: (, ) Parameters: : location, : scale
Density
0.3
0.4
N( = 5, = 1)
= 5, = 1 0.2 = 7, = 1
0.0
0.1
= 4, = 2
0
2
4
6
8
10
Moments mean: mode: variance: 32 2
Program commands R: dlogis(theta,mu,sigma)
WB/JAGS: theta ~ dlogis(mu,isigma) (rate) SAS: theta ~ logistic(mu,sigma)
DISTRIBUTIONS Table 18.10 Lognormal distribution: LN(, 2 ) Model p() =1 2
521
Examples ( ) 2 exp (log()) 2 2
0.7
= 0, = 1
0.1
Condition: > 0 Range: (0, ) Parameters: : location, : scale
0.4
0.5
0.6
Density
= 2, = 1
0.3
0.2
= 4, = 2
0.0
= 0, = 2 0 2 4 6 8 10
Moments mean: mode: exp( + 2 ) exp( )2
Program commands R: dlnorm(theta,mu,sigma)
WB/JAGS: theta ~ dlnorm(mu,isigma2) SAS: theta ~ lognormal(mu,sd=sigma) theta ~ lognormal(mu,var=sigma2) theta ~ lognormal(mu,prec=isigma2)
variance: exp(2( + 2 )) exp(2 + 2 )
DISTRIBUTIONS Table 18.11 Normal distribution: N(, 2 ) Model p() =1 2
522
Examples ( ) 2 exp () 2 2
0.5
0.4
= 5, = 1 = 7, = 1
Condition: > 0 Range: (, ) Parameters: : location, : scale
Density
0.2
0.3
= 4, = 2
0.0 0
0.1
2
4
6
8
10
Moments mean: mode: 2
Program commands R: dnorm(theta,mu,sigma)
WB/JAGS: theta ~ dnorm(mu,isigma2) SAS: theta ~ normal(mu,sd=sigma) theta ~ normal(mu,var=sigma2) theta ~ normal(mu,prec=isigma2)
variance:
DISTRIBUTIONS Table 18.12 Location-scale Students t-distribution: t(, , ) Model p() =( +1 ) 2 ( ) 2
523
Examples ( 1+ ) +1 20.5 0.4 N( = 5, = 1)
()2 2
0.0
Condition: > 0, > 0 Range: (, ) Parameters: : location, : scale : degrees of freedom
Density
0.3
0.1
0.2
= 10, = 4, = 2
= 20, = 5, = 1
= 2, = 5, = 1
0
2
4
6
8
10
Moments mean: mode: variance: (if > 1) 2 2
Program commands R: dt(nu,(theta-mu)/sigma)/sigma
WB/JAGS: theta ~ dt(mu,isigma2,nu) (if > 2) SAS: theta ~ t(mu,sd=sigma,nu) theta ~ t(mu,var=sigma2,nu) theta ~ t(mu,prec=isigma2,nu)
DISTRIBUTIONS Table 18.13 Pareto distribution: Pareto(, ) Model p() =
524
Examples ( )+1 4 = 4, = 1
Condition: > 0, > 0 Range: (, ) Parameters: : shape, : location
Density
2
3
1
= 4, = 4
= 1, = 1 0 1
2
3
4
5
6
7
8
Moments mean: mode: variance: 1
Program commands (if > 1) R: dpareto(theta,beta,alpha)
2 (1)2 (2)
WB/JAGS: theta ~ dpareto(alpha,beta) (if > 2) SAS: theta ~ pareto(alpha,beta)
Note: R function dpareto is available from R package VGAM.
DISTRIBUTIONS Table 18.14 Scaled inverse chi-squared density: Inv 2 (, s2 ) Model p() =(/2)/2 (/2+1) s2 /(2) e (/2) s 0.8 = 5, s2 = 1 0.6
525
Examples
Condition: > 0, s > 0 Range: (0, ) Parameters: : degrees of freedom, s2 : scale
Density
0.4
= 3, s2 = 1 0.2
= 3, s2 = 5 0.0 0
5
10
15
Moments mean: mode: variance: 2 2 s 2 +2 s 2 2 4 (2)2 (4) s
Program commands ( > 2) R: WB/JAGS: ( > 4) SAS: dchisq(nu*s^2/theta,nu)nu* s^2/theta^2 theta 0, > 0 Range: = 1 : [0, ) otherwise : (0, ) Parameters: : shape, : scale
Density
0.6
0.8
0.2
0.4
= 2, = 2
= 2, = 4
0
2
4
6
8
10
Moments mean: mode: (1 + 1/) (1 1/)1/ (if > 1)
Program commands R: dweibull(theta,alpha,beta)
WB/JAGS: theta ~ dweib(alpha,ibeta) SAS: theta ~ weibull(0,alpha,beta)
variance: [ ] 2 (1 + 2/) 2 (1 + 2/)
Note: SAS: more general Weibull distribution with additional > 0 = lower limit of range: weibull(mu,alpha,beta), with / in Weibull distribution replaced by ( )/.
DISTRIBUTIONS Table 18.16 Uniform distribution: U(, ) Model p() =1
527
Examples1.2
0.0
0.2
Condition: > Range: [, ] Parameters: : lower limit, : upper limit
Density
0.4
0.6
0.8
1.0
= 1, = 2
=