Julia INLA Ecosystem

A Julia-native reimplementation of the latent Gaussian model / INLA stack originally provided by R-INLA. The goal is not a line-by-line port but a composable, dispatch-based, SciML-aligned alternative covering the mainstream R-INLA workflows with native performance and genuine extensibility.

Status

v0.1.0-rc1. Phase A through D of the replan have landed: the four src/-bearing packages (GMRFs.jl, LatentGaussianModels.jl, INLASPDE.jl, INLASPDERasters.jl) cover the canonical R-INLA datasets — Scotland and Pennsylvania BYM2, Meuse zinc SPDE, the synthetic Negative Binomial / Gamma / Generic / Seasonal / Leroux / disconnected-Besag suite — within the testing strategy's tolerances. LGMTuring.jl provides the NUTS bridge for INLA-vs-MCMC triangulation.

What's here

Installing

The packages are registered on a personal Julia registry at haavardhvarnes/JuliaRegistry. From a fresh Julia REPL:

using Pkg
Pkg.Registry.add(RegistrySpec(url = "https://github.com/haavardhvarnes/JuliaRegistry"))
Pkg.add("INLA")              # umbrella: GMRFs + LatentGaussianModels + INLASPDE

To install only one core package, substitute "INLA" for "GMRFs", "LatentGaussianModels", "INLASPDE", or "INLASPDERasters".

Optional sub-packages (LGMTuring.jl, LGMFormula.jl, GMRFsPardiso.jl) are not registered yet — install them by Pkg.develop-ing this repo's subdir directly, e.g.

Pkg.develop(url = "https://github.com/haavardhvarnes/INLA.jl",
            subdir = "packages/LGMTuring.jl")

How to read this site

  • Getting started — the smallest possible Poisson + spatial random effect fit, top to bottom.
  • Coming from R-INLA → Migration guide — side-by-side reference: every R-INLA family, f(model = ...), prior, integration strategy, and post-fit accessor mapped to its Julia constructor or accessor function. Open this next to your R script while translating.
  • Coming from R-INLA → Formula DSL (@lgm) — if your R-INLA workflow leans on the formula DSL, the @lgm macro in LGMFormula.jl provides a near-source-to-source migration path. Worked examples for Scotland BYM2 and beyond.
  • Vignettes — five end-to-end walkthroughs:
  • Packages — per-package overviews, exported API, and required contracts for extending them.
  • References — the canonical method papers and validation datasets we test against.

Differences from R-INLA

A side-by-side surface map for every R-INLA construct currently covered (likelihoods, components, priors, accessors, prediction, sampling) lives in Coming from R-INLA → Migration guide. The full list of default-parameter parity calls lives in plans/defaults-parity.md. Highlights:

  • Single dispatch table. Every latent component, likelihood, prior, and integration scheme is a struct + a handful of methods. Adding a new component is "subtype AbstractLatentComponent and implement five methods" — no formula-DSL gatekeeping.
  • LogDensityProblems seam. The posterior is a LogDensityProblems-conformant object; downstream samplers (Turing, AdvancedHMC, custom) plug in without touching this package.
  • R-INLA-equivalent BYM2 scaling and PC priors by default. Where we differ, the docstring says so.
  • No f(...) / inla.formula macro magic. A formula sugar layer (@lgm) exists in LGMFormula.jl for users coming from R; the underlying constructor API is the source of truth.