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.
Link
¶
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.
TYPE:
|
inverse_expr |
QVR let-expression template applied to a linear predictor
TYPE:
|
AuxParam
¶
Bases: Model
An auxiliary family parameter (scale, dispersion, etc.).
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Variable name to emit in the
TYPE:
|
prior |
Prior distribution expression (e.g.
TYPE:
|
link |
Link applied to a per-row linear predictor if the parameter
is itself distributionally regressed (
TYPE:
|
Family
¶
Bases: Model
Response family: observation kernel plus its link and any auxiliary parameters.
The compiler emits, for each family-keyed regression:
- The auxiliary-parameter latent draws (intercept-only by
default; one per parameter named in
aux_params). - A
let eta = <linear predictor>binding the location's linear predictor. - A
let mu = <link.inverse_expr>binding the natural parameter. - A single
observe y : Resp <- <observe_family>(mu, ...)step parameterised bymuand the auxiliary parameters.