Skip to contents

Parses an ASReml-style fixed / random / residual specification into a fb_terms object, flexyBayes's backend-agnostic intermediate representation (IR) of a model. 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: flexybayes() and fb() build the IR internally from the same arguments. Argument names and defaults mirror flexybayes() one-for-one, so this is a drop-in for that function's parsing step.

Usage

fb_from_asreml(
  fixed,
  random = NULL,
  residual = NULL,
  data,
  family = "gaussian",
  link = NULL,
  weights = NULL,
  known_matrices = list(),
  prior = NULL,
  prior_fixed_sd = 100,
  prior_vc_sd = 1,
  rcov
)

Arguments

fixed

Two-sided formula: response ~ fixed_effects.

random

One-sided formula ~ random_terms (ASReml syntax), or NULL.

residual

One-sided formula ~ residual_structure, or NULL. NULL defaults to iid residuals (list(list(type = "units"))), matching flexybayes().

data

A data.frame containing every variable referenced.

family

Character family name (gaussian, binomial, binary, poisson, negative_binomial, negbinom, gamma, beta, and, for brms only, hurdle_gamma and lognormal), or a family object, which goes through the same family gate and supplies its own link.

Character link override, or NULL for the family default.

weights

Optional numeric vector of length nrow(data). When non-NULL, mapped to a single addition term with type = "weights".

known_matrices

Named list of known matrices (e.g. list(Gmat = G)). Names are recorded in data_summary$known_matrices.

prior

An fb_prior() object, or NULL. NULL falls back to the scalar priors prior_fixed_sd / prior_vc_sd.

prior_fixed_sd

Numeric SD for fixed-effect normal priors when prior is NULL.

prior_vc_sd

Numeric hyperparameter for the variance-component priors when prior is NULL.

rcov

Defunct in flexyBayes 0.9.0. The ASReml 3 name for the residual-structure argument, renamed to residual in ASReml 4. supplying it now raises an error. Use residual instead.

Value

An fb_terms object with source = "asreml".

Deprecated

fb_from_asreml() is deprecated as of 0.13.0. Use fb_plan() to inspect the backend-neutral model plan without fitting it.

See also

flexybayes() and fb() for the universal fitting entry. fb_from_brms() for the other ingest dialect.

Other flexyBayes ingest adapters: fb_from_brms()

Examples

set.seed(1L)
df <- data.frame(
  yield = rnorm(20),
  geno  = factor(rep(letters[1:4], 5)),
  env   = factor(rep(c("a", "b"), 10))
)
plan <- fb_plan(yield ~ env, random = ~ geno, data = df)
class(plan)
#> [1] "fb_plan" "list"