2025

Latte.jl

Probabilistic programming for latent Gaussian models

tmb

E[ρ] –

inla

E[ρ] –

hmc-laplace

E[ρ] –

log τ → · atanh ρ ↑

About

Write a latent Gaussian model once with the @latte macro, then choose how to handle it: INLA, TMB or HMC-Laplace. All three share the same inner Laplace approximation for the latent field and differ only in how they treat the hyperparameters, so results come back through one shared protocol.

Installation

Latte is registered in the General registry:

] add Latte

Example

A hierarchical Poisson GLMM, written once and run through all three engines:

using Latte, Distributions, LinearAlgebra

@latte function hier_poisson(y, x, group, n_groups)
    τ_u ~ Gamma(2.0, 1.0)
    β   ~ MvNormal(zeros(2), 100.0 * I(2))
    u   ~ IIDModel(n_groups, constraint = :sumtozero)(τ = τ_u)
    for i in eachindex(y)
        y[i] ~ Poisson(exp(β[1] + β[2] * x[i] + u[group[i]]))
    end
end

lgm = hier_poisson(y, x, group, n_groups)

r_inla = inla(lgm, y)
r_tmb  = tmb(lgm, y)
r_hmc  = hmc_laplace(lgm, y)

TOPICS

julia · bayesian inference · probabilistic programming · open source

SEE ALSO