quivers.formulas.family

Response families and link functions: Family, Link, AuxParam, plus the families and links registries.

family

Response families and link functions for the formula frontend.

Each Family knows how to emit a QVR observe step plus the inverse-link expression that wraps a linear predictor. The registry maps brms-style family names to a typed family record; the compiler dispatches on the family name to slot the right inverse-link / observe lines into the emitted .qvr source.

Adding a new family is one entry in families; the implementation is uniform across all of GLM / GLMM / GAMLSS-style distributional regression because each family declares its location parameter (mandatory) and any auxiliary parameters (sigma, phi, disp, zi, alpha) with their priors and links separately.

Bases: Model

Inverse-link function bridging a linear predictor on :math:\mathbb{R} to the family's natural parameter space.

ATTRIBUTE DESCRIPTION
name

Canonical name (e.g. "identity", "logit", "log", "probit", "cloglog").

TYPE: str

inverse_expr

QVR let-expression template applied to a linear predictor eta to produce the family parameter. Substitution token {eta} is replaced by the linear predictor's variable name. "{eta}" itself is the identity link.

TYPE: str

AuxParam

Bases: Model

An auxiliary family parameter (scale, dispersion, etc.).

ATTRIBUTE DESCRIPTION
name

Variable name to emit in the .qvr source.

TYPE: str

prior

Prior distribution expression (e.g. "HalfCauchy(2.0)").

TYPE: str

link

Link applied to a per-row linear predictor if the parameter is itself distributionally regressed (y ~ x, sigma ~ x, etc.); otherwise unused.

TYPE: Link

Family

Bases: Model

Response family: observation kernel plus its link and any auxiliary parameters.

The compiler emits, for each family-keyed regression:

  1. The auxiliary-parameter latent draws (intercept-only by default; one per parameter named in aux_params).
  2. A let eta = <linear predictor> binding the location's linear predictor.
  3. A let mu = <link.inverse_expr> binding the natural parameter.
  4. A single observe y : Resp <- <observe_family>(mu, ...) step parameterised by mu and the auxiliary parameters.