Parses a brms / lme4-style two-sided formula
(response ~ fixed + (1 | g)) into a fb_terms object –
flexyBayes's backend-agnostic intermediate representation (IR). The IR
is what every engine emits from, so building it explicitly lets a
power user inspect the parsed model, cache it, or hand it to a fitting
verb. Most users never call this directly: fb() and flexybayes()
detect a brms-style formula argument and build the IR internally.
Usage
fb_from_brms(
formula,
data,
family = "gaussian",
link = NULL,
prior = NULL,
weights = NULL,
prior_fixed_sd = 100,
prior_vc_sd = 1,
carry_n_rows = NULL,
...
)Arguments
- formula
A base-R formula (recommended) or a
brmsformulaobject.brmsformulasupport requires brms to be installed.- data
A data.frame containing every referenced variable. May be
NULLonly on the advanced metadata-only path (seecarry_n_rows).- family
Character family name or a base-R
family()object.- link
Character link override, or
NULLfor the family default.- prior
An
fb_prior()object, orNULL.- weights
Optional numeric weights vector of length
nrow(data), mapped to a single addition term withtype = "weights".- prior_fixed_sd
Numeric SD for fixed-effect normal priors when
priorisNULL.- prior_vc_sd
Numeric hyperparameter for the variance-component priors when
priorisNULL.- carry_n_rows
Advanced: a positive integer enabling the metadata-only IR path (
data = NULL). The formula's variables are realised as a one-row stand-in data frame and the row count is recorded ascarry_n_rows, for stress-testing the preflight layer without materialising the full data. LeaveNULLfor ordinary use.- ...
Reserved for future brms-ingest options (specials, autocor handling); currently unused.
Details
Linear fixed effects, random intercepts ((1 | g), (1 || g)) and
uncorrelated random intercept+slope ((x || g)) are supported;
correlated random slopes ((x | g)), smoothers, Gaussian processes
and autocorrelation terms refuse at ingest with a structured message.
Deprecated
fb_from_brms() is deprecated as of 0.13.0. Use fb_plan() to inspect
the backend-neutral model plan without fitting it.
See also
fb() and flexybayes() for the universal fitting entry;
fb_from_asreml() for the other active dialect.
Other flexyBayes ingest adapters:
fb_from_asreml()