Build the response-scale predict formula for the parsnip bru_reg engine
Source:R/bru_model.R
bru_pred_formula.RdThe fixed-effect linear predictor wrapped in the default inverse link for
the fit's family. IID random intercepts (and any other random effects)
are intentionally excluded: the formula is built from summary.fixed
row names, which are the fixed-effect terms only. This produces the
marginal mean prediction — see the bru_reg() docs for details.
Exported only so that parsnip's quoted args$formula in set_pred can
reference it without :::. Not intended for end users.
Details
Errors if the fit specified a non-default link (via
control.family = list(link = ...)) or if the family has no known default
inverse link in the package's mapping. In either case, use
inlabru::predict() directly.
Examples
set.seed(1)
dat <- data.frame(x = rnorm(30))
dat$y <- rpois(30, exp(0.5 + 0.3 * dat$x))
fit <- bru_inlaops_fit(y ~ Intercept(1) + x, data = dat, family = "poisson")
bru_pred_formula(fit)
#> ~exp(Intercept + x)
#> <environment: 0x57a93fc1f360>