Skip to content

TuringLang/JuliaBUGS.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

529 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JuliaBUGS.jl

Stable Dev

JuliaBUGS.jl is a modern, high-performance implementation of the BUGS probabilistic programming language in Julia. It brings the familiar BUGS modelling syntax into the Julia ecosystem, enabling Bayesian inference with speed, flexibility, and seamless integration with the scientific computing ecosystem in Julia.


Why JuliaBUGS?

  • BUGS syntax — write models using standard BUGS notation.

  • High performance — leverage Julia’s speed and just-in-time (JIT) compilation.

  • Interoperability with Julia ecosystem — works smoothly with MCMC algorithms from Turing.jl and the broader Julia PPL ecosystem.


Quick Start

A simple example model:

using JuliaBUGS, Random, AbstractMCMC

normal_model = JuliaBUGS.@bugs"""
model {
  for (i in 1:N) {
    y[i] ~ dnorm(mu, tau)
  }
  mu ~ dnorm(0, 0.001)
  tau ~ dgamma(0.1, 0.1)
}
"""

# The model definition is callable: pass data to construct a model.
posterior = normal_model((; N = 10, y = randn(10)))
rng, sampler = Random.MersenneTwister(123), JuliaBUGS.IndependentMH()

chain = AbstractMCMC.sample(rng, posterior, sampler, 1000)

For a complete walkthrough, see the example.


Related Tools

  • DoodleBUGS — a browser-based interface for drawing BUGS models.
  • RJuliaBUGS — an R interface to JuliaBUGS.

For alternative BUGS-family tools, see JAGS and Nimble.

About

A domain specific language (DSL) for probabilistic graphical models

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

73 stars

Watchers

5 watching

Forks

Contributors