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.26960786  0.35670468
##  [2,] -0.81878348 -0.26378987
##  [3,] -0.84328122 -0.51889857
##  [4,] -2.33700192 -1.53814531
##  [5,]  1.47615831  1.94994443
##  [6,]  0.60344098 -0.40552940
##  [7,]  0.73479667  0.70395256
##  [8,]  1.14760930  1.39653795
##  [9,]  0.10472995  0.05611722
## [10,]  0.73576400  1.99102264
## [11,] -0.54513382 -0.49285935
## [12,] -0.78744050 -0.92701386
## [13,] -0.54907072  0.16799675
## [14,] -0.86819650 -0.56785568
## [15,]  0.34619684 -0.25481298
## [16,] -2.08807532 -1.00755908
## [17,] -1.86158479 -2.08927872
## [18,] -0.81150597  0.89170244
## [19,]  0.89711004  1.95766890
## [20,]  2.93985173  2.70652735
## [21,] -0.49080406 -0.76092781
## [22,]  0.29366391  0.29553436
## [23,] -0.90852909 -0.21999530
## [24,]  0.17480815 -0.09953676
## [25,] -1.27148452  0.03885679
## [26,]  0.26605196  0.21471893
## [27,] -0.59940374 -1.08893052
## [28,]  0.79166618  1.31627437
## [29,]  0.02983275  0.56803130
## [30,]  0.30090981 -0.36625368
  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.