Distributions

Every row links to a page containing the matched HOBBS, Stan, and JAGS model definitions from the package test suite, plus the complete R test file.

Distribution HOBBS sampling statement Source
Normal x(i) ~ dnorm(mean, sd); test source
Standard normal x(i) ~ normal01(); test source
Normal with SD 1 x(i) ~ normal_sd1(mean); test source
Uniform x(i) ~ dunif(min, max); test source
Exponential x(i) ~ dexp(rate); test source
Gamma x(i) ~ dgamma(shape, rate); test source
Inverse gamma x(i) ~ dinvgamma(shape, rate); test source
Beta x(i) ~ dbeta(a, b); test source
Cauchy x(i) ~ dcauchy(location, scale); test source
Student t x(i) ~ dt(df, location, scale); test source
Chi-square x(i) ~ dchisq(df); test source
Lognormal x(i) ~ dlnorm(meanlog, sdlog); test source
Logistic x(i) ~ dlogis(location, scale); test source
Laplace x(i) ~ dlaplace(location, scale); test source
Weibull x(i) ~ dweibull(shape, scale); test source
Pareto x(i) ~ dpareto(xmin, alpha); test source
Half-normal x(i) ~ dhalfnorm(sd); test source
Half-Cauchy x(i) ~ dhalfcauchy(scale); test source
Bernoulli y(i) ~ dbern(prob); test source
Bernoulli logit y(i) ~ bernoulli_logit(eta); test source
Bernoulli probit y(i) ~ bernoulli_probit(eta); test source
Bernoulli cloglog y(i) ~ bernoulli_cloglog(eta); test source
Binomial y(i) ~ dbinom(size, prob); test source
Binomial logit y(i) ~ binomial_logit(size, eta); test source
Poisson y(i) ~ dpois(lambda); test source
Poisson log y(i) ~ poisson_log(eta); test source
Negative binomial y(i) ~ dnbinom(size, prob); test source
Negative binomial log-mean y(i) ~ dnbinom_log(eta, size); test source
Bivariate normal v(1:2) ~ dbvn(mean2, Sigma2); test source
Multivariate normal x(1:k) ~ dmvn(mean, Sigma); test source
Wishart W(1:k2) ~ dwish(scale, df, k); test source
Inverse Wishart W(1:k2) ~ dinvwish(scale, df, k); test source
LKJ correlation, 2D R(1:4) ~ dlkjcorr2(eta); test source

Run all distribution tests

From the HOBBS package root:

devtools::test(filter = "dist-")

The reference-comparison tests are skipped when rstan or rjags is unavailable. The HOBBS integration tests also require Cargo, Rust, and a C compiler.