Skip to contents

Internal fit wrapper for the parsnip inlabru engine

Usage

bru_inlaops_fit(formula, data, dic = TRUE, waic = TRUE, options = NULL, ...)

Arguments

formula

Model formula in inlabru component syntax, with an explicit Intercept(1).

data

Training data frame.

dic, waic

Compute DIC / WAIC. Ignored when options already sets them.

options

Optional inlabru::bru_options(). config = TRUE is always merged into its control.compute.

...

Passed to inlabru::bru().

Value

A fitted bru object (see inlabru::bru()) with stored posterior configurations, so it can be sampled with inlabru::generate().

Examples

set.seed(1)
dat <- data.frame(x = rnorm(30))
dat$y <- 1 + 0.5 * dat$x + rnorm(30, sd = 0.5)
fit <- bru_inlaops_fit(y ~ Intercept(1) + x, data = dat, family = "gaussian")
fit$summary.fixed
#>                mean         sd 0.025quant  0.5quant 0.975quant      mode
#> Intercept 1.0646549 0.07368301  0.9191965 1.0646550  1.2101121 1.0646550
#> x         0.5209403 0.08076418  0.3615033 0.5209404  0.6803768 0.5209404
#>                    kld
#> Intercept 3.955565e-08
#> x         3.955573e-08