demo/minimal.R

suppressPackageStartupMessages({
	library(INLAtools)
	library(INLA)
})

R <- Sparse(crossprod(diff(diag(10))))
R

cmodel <- cgeneric("generic0", R = R, param = c(1, 0.01))

cfam <- list(hyper = list(prec = list(initial = 10, fixed = TRUE)))

fit <- inla(formula = y ~ 0 + f(i, model = cmodel), 
	    data = data.frame(y = NA, i = 1:nrow(R)), 
	    control.family = cfam)

stopifnot(isTRUE(fit$ok))

Try the INLAtools package in your browser

Any scripts or data that you put into this service are public.

INLAtools documentation built on Feb. 12, 2026, 5:07 p.m.