Resources:

Be aware of conjugate priors.

The most important ones: Normal, Poisson, Binomial (Bernoulli), Uniform

1 Univariate

1.1 Exponential - dexp(lambda)

  • Survival analysis, point processes, distance decay, …

1.2 Gamma - dgamma(r, lambda)

  • Alternative prior for precision (tau) in normal distribution.
  • Flexible distribution for modelling continuous positive variables.

1.3 Negative binomial - dnegbin(p, r)

  • Flexible alternative to Poisson when overdispersion is a problem.

1.4 Beta - dbeta(a,b)

  • Prior for parameter \(P\) in binomial.
  • Modelling density on closed interval.

1.5 Double exponential - ddexp(mu, tau)

  • Useful for Lasso penalization.

1.6 Weibull - dweib(v, lambda)

  • Survival analysis.

1.7 Categorical - dcat(pi)

  • Beware, dcat is not in the basic R functions!
  • You can use sample instead.

2 Multivariate

2.1 Multivariate normal (MVN) - dmnorm(mu, Omega)

  • Theoretical underpinning of Pearson correlation, PCA, Generalized Least Squares (GLS) regression, Kriging.
  • When you stumble accross the term covariance matrix, you should expect MVN.
  • Useful for generating correlated variables.
  • In R it is not in the basic packages, you need package mvtnorm:
  library(mvtnorm)
  vector.of.means <- c(0,0)
  cov.matrix <- matrix(c(1,0.8,0.8,1), 2,2) 
  cov.matrix
##      [,1] [,2]
## [1,]  1.0  0.8
## [2,]  0.8  1.0
  y <- rmvnorm(n=30, mean=vector.of.means, sigma=cov.matrix)
  y
##              [,1]       [,2]
##  [1,]  0.07406122  0.7711401
##  [2,]  0.21383312  1.2389753
##  [3,] -0.65975158 -0.8455882
##  [4,]  0.06294699 -0.1329048
##  [5,]  0.91588805  1.9713674
##  [6,] -0.27463535 -0.1730642
##  [7,] -1.02207667 -0.8977509
##  [8,] -1.71211921 -1.2613884
##  [9,] -0.11714706  0.1982714
## [10,]  0.87088801  0.9608702
## [11,]  0.89448223  0.8969777
## [12,]  0.49884529  0.4691392
## [13,] -1.38938643 -0.9791111
## [14,]  2.02378368  0.6322382
## [15,]  1.21142195  1.3581468
## [16,] -1.12736932 -0.7497353
## [17,] -0.06920579  1.0109795
## [18,]  1.13086891  0.9011587
## [19,]  1.42231005  0.9875621
## [20,]  0.26635626  0.2358371
## [21,]  0.02905458 -0.1255665
## [22,]  1.91541479  1.5091596
## [23,]  0.30478173  0.5555567
## [24,] -0.98344367 -1.1353045
## [25,] -0.96724569 -1.3300613
## [26,]  0.52097947  0.6890798
## [27,]  0.88271200 -0.4577340
## [28,] -1.52959359 -1.4126550
## [29,]  0.30544225 -0.0543552
## [30,] -0.42286507  0.1514605
  plot(y)

2.2 Wishart - dwish(R, k)

Precision priors for Multivariate normal.

2.3 Multinomial - dmulti(pi, n)

3 Truncated and censored distributions

Handled by I(,) in JAGS. See the JAGS manual.