Model interface requirements and capability audit¶
This audit distinguishes three questions: (i) whether QVR can state a model; (ii) whether an execution path can fit it; and (iii) whether the Python interface provides the corresponding data preparation and analysis workflow. Expressibility alone does not establish parity with another modeling system.
The implementation supplies checked input schemas, explicit runtime parameters, finite extent inference, reusable inference methods, new-data prediction, and raw pointwise observation likelihoods. The tables below record remaining work against brms and the open enhancement issues as of November 16, 2026.
brms coverage¶
The released comparison baseline is
brms 2.23.0 on CRAN, published
September 9, 2025, with its
source metadata pinned at b124949c.
The audit also checks the official development snapshot
f4f906dc, dated November 12, 2026,
whose metadata identifies version 2.23.2.
That development version is distinct from the CRAN release. The website's
reference index,
formula specification,
family catalog, and
fitting interface
describe the development version.
These sources establish the comparison's scope; the QVR assessments below come
from the implementation and its tests. Full brms coverage is not established.
| Capability | QVR evidence and remaining requirements |
|---|---|
| Data dimensions and external inputs | Model.schema retains checked types and roles; Model.bind specializes finite extents and validates supplied values. Tested in tests/modeling/test_model.py. |
| Common regression families | quivers.formulas.families contains 50 entries, with 17 inverse links and mean/precision conversions for binomial, beta-binomial, gamma, Weibull, and other families. Asymmetric Laplace quantile regression supports a fixed or regressed quantile, with independent SciPy density/CDF/quantile and sampling tests. tests/test_formula_distributional.py checks independent likelihood and derivative oracles. ExGaussian uses the response mean and Gaussian/exponential components; inverse Gaussian uses response mean/shape with implicit sample gradients. These have independent density, CDF, derivative, and sampling oracles. Zero-inflated Beta regression reuses the native zero/one mixture with its one-atom probability fixed at zero; atom/interior densities, endpoint derivatives, sampling moments, and response means have independent oracles. Hurdle Gamma and LogNormal responses use a shared exact atom/positive-component implementation, with independent density, derivative, CDF, moment, and sampling oracles and SVI/HMC/NUTS formula checks. All 49 named laws in the pinned brms 2.23.0 family-function registry map to formula frontends; its remaining function is the custom-family constructor. The larger native registry remains a separate interface. Named-law coverage does not establish every link, modifier, interaction, prior, or custom-law workflow. |
| Zero-inflated and hurdle counts | Native and formula interfaces add zero-inflated negative-binomial, binomial, and beta-binomial responses plus hurdle negative-binomial responses. tests/test_formula_count_mixtures.py checks component-to-regression conversions, likelihood and gradient oracles, fitting, and predictions. Shared Family.trials_parameter metadata validates trial counts in 0..2**53 at fitting and new-data prediction; zero trials give a zero response. Native Binomial/BetaBinomial/NB/Poisson and the new mixtures use float64 count parameters, scores, and moments while preserving gradients to original learned heads. The hurdle sampler uses compound-Poisson/logarithmic-count sampling rather than rejection from a vanishing positive event. Native/QIEC reference execution supports all four; all 11 external renderers explicitly refuse them, checked in 44 family/backend cells. Poisson and negative-binomial hurdles use hu for the entire zero probability, while zero-inflated families retain zi for structural-zero mass. |
| Finite mixtures | mixture(...) builds the brms mixture of any real-support or any integer-support families, with nmix, order ("mu"/"none"/bool, brms's default), component formulas (mu2 ~ z, sigma1 ~ x), a Dirichlet theta simplex, proportions predicted for all but one component through a row-wise softmax, fixed proportions, and equated parameters (equal={"sigma2": "sigma1"}). Each component is the ordinary single-family emission renamed into its dpar_<name><k>_ namespace, so every predictor term, prior, link and cens/trunc check applies per component. Gaussian mixtures use the native MixtureNormal kernel and others the general Mixture. Ordering is an exact positive-gap reparameterization of the sampled intercepts (centered under default_priors="brms", as in brms). Truncation normalizes each component on its interval, as brms does. pp_mixture, posterior_linpred(parameter="mu") (all component locations), posterior_epred, posterior_predict and log_likelihood follow brms; SVI, HMC, NUTS, new rows, refits, k-fold, artifacts and joint models are tested in tests/formulas/test_mixture.py against hand-written torch densities (values, gradients, Hessians), SciPy component laws and brms 2.20.4 log_lik, pp_mixture and posterior_epred at brms's draws. Different by design: under ordering the later intercepts have no prior of their own, and the gaps carry HalfNormal(5) (class mixture_intercept_spacing). Group identifiers shared by component formulas form one correlated block across components, as in brms. A parameter equated to a sampled one is reported in draws() and variables() under its own name, as brms's transformed parameter is (tests/formulas/test_prior_table_options.py, pinned by tests/formulas/oracles/brms_prior_table_options.R). Mixtures of ordinal families (cumulative, sratio, cratio, acat, hurdle_cumulative; never with other families) compose the ordinary ordinal emission per component, with per-component thresholds, disc<k> formulas and cs() terms under order="none" (brms's default for ordinal mixtures) and one shared threshold vector under order="mu", ordered when any component is cumulative, as in brms. posterior_epred returns mixed category probabilities, and posterior_predict, pp_mixture, log_likelihood, LOO, k-fold, bayes_r2, conditional effects, refits and artifacts use the shared paths. tests/formulas/test_ordinal_mixture.py checks torch category laws written from the model definitions (values, gradients, Hessians) and brms log_lik, posterior_epred and pp_mixture at brms's draws for separate and shared thresholds (oracles/brms_ordinal_mixture.R). Different by design: each ordinal component keeps the quivers threshold coordinates (location intercept and centered thresholds) and their default priors. Ordinal mixtures accept thres(n, gr): every component has its own unpooled vector per group, and order="mu" shares one vector per group across the components by reading one component's group-by-threshold matrix and intercept. brms compiles this model but its log_lik and posterior_epred fail on it (pinned), so tests/formulas/test_threshold_group_models.py checks the density with first and second derivatives against the mixture of group-specific category laws written from brms's Stan statements, scores at brms's draws, SVI, HMC, NUTS, new rows, refits, k-fold and artifacts. Deliberately different from brms: the group thresholds of a mixture keep their native coordinate names, and a mixture with threshold groups whose components mix hurdle and other ordinal families is refused. Not available: shared thresholds with equidistant thresholds (refused by brms too) or hurdle components, and custom, Wiener and Cox components. |
| Category-specific predictors | Categorical, multinomial, Dirichlet, Dirichlet-multinomial and logistic-normal responses accept brms mu<c> ~ ... formulas for non-reference categories (muB, muC, with with_reference for refcat). The main formula predicts the other categories; each category has its own coefficients, group effects and dpar="muC" priors, and posterior_linpred(parameter="muC") reads one category. Identical formulas reproduce the shared emission exactly. tests/formulas/test_category_formulas.py checks torch softmax densities with derivatives, SciPy multinomial and Dirichlet laws, brms names and log_lik/posterior_epred at brms draws, inference, new rows, artifacts and joint models. Per-category predictors are ordinary scalar predictors, so mo(), gp() (approximate and exact), mm() and the gr() options by, dist and pw give each free category its own simplex, hyperparameters and group standard deviations, and a main formula holding one of them is copied to every free category, as in brms. tests/formulas/test_category_special_terms.py checks brms variable names, prior rows and log_lik/posterior_epred at brms's draws (oracles/brms_category_special_terms.R), NumPy predictors with SciPy multinomial, Dirichlet and Dirichlet-multinomial laws, SVI, HMC, NUTS, new rows, refits, k-fold and artifacts. logistic_normal accepts brms sigma<c> ~ ... formulas for the scale of each non-reference component's log ratio (sigmab ~ x): a predicted scale is a scalar predictor under the log link with dpar="sigmab" priors and brms names (b_sigmab_x), a scale without a formula is the scalar class sigmac, and fixed_parameters holds one constant. tests/formulas/test_logistic_normal_scales.py checks brms's Stan statements, prior rows and messages, log_lik and posterior_linpred (location and scale, training and new rows) and variable names at brms's draws (oracles/brms_logistic_normal_scales.R), the density with first and second derivatives against a torch multivariate Normal with the Jacobian and SciPy, SVI, HMC, NUTS, new rows, refits, k-fold, artifacts, typed priors, joint models and refusals. Deliberately different from brms: sigma ~ ..., which brms refuses, predicts every scale with one formula and one coefficient per component, and it cannot be combined with sigma<c>. Not available: me() in a distributional formula (located error); mo(), mm() and gr() options in the shared logistic-normal sigma formula, which keeps one coefficient per category. |
| Group effects | Single-bar blocks use native LKJ Cholesky correlations; double bars request independence. Shared IDs couple coefficients across location and auxiliary formulas. Scalar and component blocks support centered and noncentered coordinates, including all non-reference-category coefficients. tests/test_formula_correlations.py checks Gaussian covariance densities, derivatives, and SVI/HMC/NUTS execution. Mixed scalar/transition widths and shared auxiliary blocks retain their joint covariance in both coordinate systems, checked against native/reference densities and every parameter gradient. New-group prediction supports joint donor and fitted Gaussian/LKJ policies. GroupCovariance supplies labeled SPD covariance or explicitly ranked PSD support through the same Gaussian layout and MatrixNormal law, including grouped cutpoint profiles and Schur-conditional new-level prediction. brms grouping syntax is normalized onto the same layout (tests/formulas/test_grouping_syntax.py, oracle tests/formulas/oracles/brms_grouping.R): gr(g, cor, id, cov) (cov reads a labeled data2 matrix into GroupCovariance, retained by the fit), interactions g1:g2 with brms's _-pasted levels, and nesting g1/g2 as g1 plus g1:g2. Independent coefficients (||, cor = FALSE) of a factor with a known level covariance follow that covariance, each in its own block. A coefficient repeated across blocks of one factor is refused, as brms refuses it. Multi-membership mm(g1, ..., gK, weights, scale, cor, id) and mmc() codes the union of member levels through IndexedDesign and replaces each row gather by a weighted sum over members, O(n K) per coefficient, reusing the Gaussian group layout, LKJ blocks, priors (group label mm<members>), and new-level policies on one compact prediction axis (tests/formulas/test_membership.py, oracle tests/formulas/oracles/brms_membership.R, pinned J, W, Z, and generated Stan predictors). gr(by = ) gives each by level its own standard deviations and LKJ factor (brms scale_r_cor_by), gr(dist = 'student') adds brms's df ~ gamma(2, 0.1) (lower bound one), per-level udf ~ inv_chi_square(df), and dfm = sqrt(df * udf) multipliers, and gr(pw = ) weights each level's standard-normal innovation prior (pinned from the brms 2.23 source, absent from 2.20.4). tests/formulas/test_group_options.py pins brms 2.20.4 Jby, Nby, priors, and generated Stan effect statements (oracle tests/formulas/oracles/brms_group_options.R) and checks the Student-t density with every first and second derivative. Not supported, refused with a located error: these three options with centered coordinates or a known level covariance; by and pw on mm() factors (brms takes matrices); mixing options across blocks of one factor; and mm() with category-specific coefficients, which brms admits, or grouped thresholds. mm(..., cov = K) composes the membership gather with the known-covariance block of gr(cov = ), checked against a torch density written from brms's Lcov, J, W and Z with first and second derivatives and against brms posterior_linpred and log_lik at its draws on training and fresh rows (tests/formulas/oracles/brms_membership_covariance.R, tests/formulas/test_membership_covariance.py). Deliberately different: correlated coefficients of a factor with a known covariance have the exact Kronecker covariance, where brms's scale_r_cor_cov skips the entries of Lcov that are not above 1e-10 and so departs from it when the Cholesky factor has a negative entry. The three options and mm() in the per-category predictors of categorical and compositional responses are described in the category-specific predictors row. |
| Distributional and nonlinear formulas | Additive formula leaves and NonlinearExpression nodes share one checked PredictorGraph. Location, auxiliary, and nonlinear parameters use its dependency ordering, QVR expression typing, and retained input/design metadata. Component expressions retain named category coordinates, including reference exclusions. tests/test_formula_nonlinear.py checks independent joint densities, every fitted head gradient, native/reference agreement, SVI/HMC/NUTS, and compilation-free new-data replay. Joint multivariate responses compose these graphs per response (see Multivariate responses). Deliberately different: parameter formulas are arguments of bf or the distributional and nonlinear keywords, and brms's lf, nlf, acformula, and set_nl are not provided. |
| Multivariate responses | bf, mvbf, set_rescor, and bf(...) + bf(...) build a MultivariateFormula with brms response names; fit, get_prior, formula_to_qvr, and sample_prior accept it and return a MultivariateFit. One joint program namespaces every single-response emission, couples shared group identifiers in one LKJ block, and applies one prior catalogue with response selectors. set_rescor(True) joins scalar Gaussian or Student responses under a multivariate Normal or Student row event with brms's diag(sigma) Lrescor factor and one shared nu; the brms default (rescor exactly for one common Gaussian/Student family without mi()) applies when unset. Heterogeneous families are allowed without residual correlation, and every one of the 50 registered families fits, predicts, and scores as a response beside a Gaussian response with a shared group block (tests/formulas/test_multivariate_public.py). posterior_linpred, posterior_epred, posterior_predict, and log_likelihood take resp and new_data, reuse each response's ordinary row preparation, and draw a new level of a shared factor once per block. Pointwise units follow brms log_lik: the row event under rescor (exact marginal for a response subset) and per-row sums otherwise. variables and hypothesis use brms names (b_<resp>_<coef>, sd_<group>__<resp>_<coef>, cor_..., rescor__<a>__<b>), pinned against brms output in tests/formulas/oracles/brms_multivariate.R. update, refit_callback (k-fold and exact LOO), and save_fit/load_fit reuse the shared recipe, runner, and artifact storage. Independent SciPy multivariate Normal/Student and hand-written heterogeneous joint-density oracles check values and every first derivative. A cumulative response with category-specific effects predicts on fresh rows inside a joint model, and mi() responses fit and predict there (the "Missing data and measurement error" row gives their limits). MultivariateFit.bayes_r2 returns brms's bayes_R2 per response. mi() responses fit under residual correlation as in brms, the joint law scoring each row's completed vector. Not supported: neural predictors and joint refit partitions with subset() rows. |
| Splines, Gaussian processes, and special predictor terms | Some corresponding kernels exist. Ordinal cs(expr) effects retain a transition axis with centered or noncentered shared correlations. Cumulative/hurdle effects use training-domain bounds and proper conditional slack priors to ensure ordered effective cutpoints. Flexible, sum-to-zero, and equidistant grouped threshold profiles share an identified location/shape construction; binary profiles retain only their location degree of freedom. Prediction retains fitted cutpoints, exposes posterior_thresholds, and reuses support-conditioned new-group policies. brms thres(n, gr) gives each level of gr its own unpooled threshold vector of its own length (count from n, a number or a column constant within a group, or from the group's largest response), for the cumulative, sratio, cratio, and acat families: every group keeps the identified location and centered shape coordinates (the first group's location is zero under a formula intercept), shorter vectors are padded with finite thresholds, and the padded category log masses are reduced exactly to the group's own categories (log-sum-exp of the padded tail for cumulative and sequential laws, removal before normalization for adjacent-category laws), so absent categories have probability zero. variables() reports brms's b_Intercept[<group>,<k>], fresh rows are coded against the fitted groups, and counts, Stan statements, names, log_lik, and posterior_epred are pinned against brms at its draws (tests/formulas/oracles/brms_threshold_groups.R, tests/formulas/test_threshold_groups.py), with values and first and second derivatives checked against per-group category laws written from brms's Stan functions. Different by design: the threshold coordinates and their default priors are quivers's, as for a single threshold vector. hurdle_cumulative takes threshold groups with code zero as the hurdle outside every group's thresholds, and thres(n) counts the thresholds above the hurdle, as brms does. A multivariate model reports b_<resp>_Intercept[<group>,<k>], and b_<resp>_Intercept[<k>] for a cumulative response with one vector, from one replay of the row thresholds through the shared variable catalogue, in variables() and summary(). tests/formulas/test_threshold_group_models.py pins brms's counts, Stan statements, names, log_lik and posterior_epred at its draws for the hurdle and the multivariate model (oracles/brms_threshold_group_models.R). Refused with a located error: category-specific effects (brms's message), equidistant or sum-to-zero thresholds, thresholds_by beside thres(gr), and a fresh row of a group without fitted thresholds. tests/test_formula_centered_groups.py and tests/test_formula_group_threshold_policies.py check coordinate densities, gradients, and predictions. s() and t2() port brms's mgcv construction (smoothCon with absorbed constraint and diagonal penalty, then smooth2random): default thin-plate regression splines (including mgcv's Lanczos iteration) and tp, ts, cr, cs, cc, ps, bs, re bases, mgcv's Gaussian process smooth bs = 'gp' with every covariance choice of m (spherical, power exponential, Matérn 1.5, 2.5 and 3.5, range, power, stationary form; equal to brms's Stan data in tests/formulas/test_mgcv_gp_smooths.py), the factor-smooth interaction s(x, g, bs = 'fs') (thin-plate base or the cr, cc, ps, bs, gp base named by xt = list(bs = ...), equal to brms's Stan data up to the same free rotation in tests/formulas/test_mgcv_factor_smooth_bases.py; numeric and factor by applied as mgcv's own design applies it, where brms's Stan data ignore the by of an fs smooth; fx = TRUE and the ts/cs bases refused because brms and mgcv fail on them; one smoothing scale for the range space and one per null-space polynomial, new factor levels refused as in brms; its null-space columns are orthonormal polynomials where mgcv's are fixed only up to a rounding-dependent rotation, checked in tests/formulas/test_mgcv_factor_smooths.py by block structure, one common rotation and scale, fresh rows, and posterior_linpred at brms's draws), multivariate s(x, z), numeric and factor by, fx, and t2 tensor products with k, bs, m, d, full, ord; te()/ti() raise brms's error naming t2. The Markov random field s(region, bs = 'mrf', xt = list(penalty = P)) or xt = list(nb = A) reads its penalty or neighbourhood matrix from data2 (brms reads R's global environment), with low-rank k, by, fx, and regions without observations under drop_unused_levels=False; its span and implied covariance equal brms's Stan data in tests/formulas/test_mgcv_mrf_smooths.py, a k that cuts a repeated penalty eigenvalue is refused, and boundary polygons (polys) are not read. The spline on the sphere s(lat, lon, bs = 'sos') ports mgcv's kernel (makeR and the compiled dilogarithm series of the second-order spline, the four closed-form pseudospline orders of Wahba (1981), and the two embedded-sphere kernels of negative m), mgcv's rounding and clamping of m, the knots in the text order of uniquecombs, the Lanczos truncation to k, the null-space constraint, and the column scaling, with user knots for both covariates, by, and fx; kernel values, the raw constructor output, and brms's Stan data on training and fresh rows are pinned in tests/formulas/test_mgcv_sos_smooths.py (generator tests/formulas/oracles/mgcv_sos_smooths.R), with the kernels also checked against the dilogarithm, Wahba's Legendre series and integral, and the chord length. Different by design for sos: a latitude outside [-90, 90] or longitude outside [-180, 360] is refused (mgcv evaluates any numbers), knots for one covariate alone and more knots than rows are refused (mgcv ignores them), xt (max.knots, seed) and more than 2000 unique locations without knots are refused (mgcv subsamples with R's generator), and m = -1 knots on one circle are refused. The Duchon spline s(x, z, bs = 'ds', m = c(m, s)) ports mgcv's constructor (the kernel DuchonE with its sign, the polynomial null space, the knots in the text order of uniquecombs, the Lanczos truncation to k, and the Householder null space of the constraint), with user knots, by, fx, and use as a t2() margin; brms's Stan data on training and fresh rows are pinned in tests/formulas/test_mgcv_duchon_knots.py (generator tests/formulas/oracles/mgcv_duchon_knots.R), with the kernels checked against closed forms, the seminorm property, and the thin-plate span at s = 0. Different by design for ds: an m[2] violating Duchon's conditions is refused with a valid value named (mgcv replaces it and warns), xt (max.knots, seed) and more than 2000 unique rows without knots are refused. bs = 'ad' and bs = 'so' are refused by brms itself (smooth2random cannot convert them) and here. Unpenalized columns are class b coefficients and each penalized block a scaled standard-Normal block with a typed sds prior; fresh rows use the retained basis. tests/formulas/test_mgcv_smooths.py pins brms 2.20.4/mgcv 1.8-42 Xs/Zs and fresh-row matrices (generator tests/formulas/oracles/mgcv_smooths.R); tests/formulas/test_mgcv_smooth_workflow.py and tests/formulas/test_penalized_smooth.py check joint densities with every derivative, SVI/HMC/NUTS, prediction, update, k-fold, artifacts, and conditional_smooths. Deliberate differences: the sds default is the shared random_scale_prior (HalfNormal(1.0)) rather than brms's data-scaled half Student-t, keeping sd and sds on one response-independent default; id shares smoothing scales (brms ignores it); t2 fresh rows use the training constraint (brms's prediction constraint does not reproduce its own training rows); thin-plate terms above 2000 unique covariate rows without user knots are refused (mgcv subsamples with R's generator); where mgcv's null-space basis depends on LAPACK rounding QVR fixes it canonically. Monotonic mo() follows brms and Bürkner and Charpentier (2020): integer predictors coded from the training minimum and ordered factors by their observed levels, a simo Dirichlet simplex per factor (Dirichlet(1) default, scalar concentrations recycled), a class b coefficient, interactions with numeric and factor columns and other mo() factors (one term, coefficient, and simplex per covariate column, as brms's Csp), shared id simplexes, (mo(x) | g) slopes reusing the population simplex, distributional parameters, and refusal of out-of-range, fractional, or unseen fresh values. tests/formulas/test_monotonic.py pins brms 2.20.4 Xmo, Jmo, Csp, labels, and generated Stan predictors (generator tests/formulas/oracles/brms_monotonic.R) and checks the joint density with every first and second derivative, SVI/HMC/NUTS, prediction, new levels, update, k-fold, and artifacts. Under default_priors="brms" the mo() coefficient takes brms's flat prior (class b); deliberate mo() differences under the quivers policy: the bsp default is the autoscaled fixed_prior rather than brms's flat prior. Class b selectors use the authored label mo(x) rather than brms's mox. A group-level mo() slope without its population term is refused, where brms silently drops it. A single-category predictor is refused, where brms emits an invalid zero-length simplex. mo() in the per-category predictors of categorical and compositional responses is described in the category-specific predictors row. Approximate Gaussian processes gp(..., k = m) follow brms and Riutort-Mayol et al. (2023): every brms argument (by numeric and factor with cmc, k, c, cov = exp_quad, matern32, matern52, exponential/matern12, iso, gr, scale), the eigenfunction basis as one Gaussian design block whose coordinate scales are exp(log(spd)/2) of sampled sdgp and lscale, brms's default priors (half Student-t sdgp scaled by the response's link-scale MAD, inverse-gamma lscale solved from the training distances), brms's coef labels, retained scaling, centering, and boundary for fresh rows, and conditional_smooths for one GP term. tests/formulas/test_gp.py pins brms 2.20.4 Xgp, slambda, Jgp, Igp, Cgp, and default priors (generator tests/formulas/oracles/gp_brms.R), checks spectral densities against kernel Fourier transforms, the published accuracy relations of the approximation, the joint density with every first and second derivative, SVI/HMC/NUTS, fresh rows, update, k-fold, and artifacts. Exact Gaussian processes gp(...) without k (or k = NA) follow brms's non-centered cholesky(K(sdgp, lscale) + 1e-12 I) zgp over the distinct inputs (gr), with the same arguments, kernels (non-iso as a product of one-dimensional kernels), labels, and default priors as the approximation, through the checked QVR builtin cholesky. New inputs are drawn from brms's conditional Gaussian given the replayed training values with its 1e-8 nugget (.predictor_gp_new), as a fresh prediction site, and conditional_smooths draws the same law. There is no size limit, as in brms. tests/formulas/test_gp_exact.py pins brms 2.20.4 exact Xgp, Jgp, Nsubgp, Igp, Cgp, priors, and Stan construction, and checks the joint density with every first and second derivative for all four kernels against a hand-written oracle, the prior covariance of the latent function by Monte Carlo, the conditional law against its closed form, agreement with the approximation within the published accuracy, SVI/HMC/NUTS, new-input prediction against the per-draw conditional law, update, k-fold, and artifacts. tests/dsl/test_cholesky_builtin.py checks the builtin. Deliberate differences: predictions add every by sub-GP as brms's Stan model does (brms's R predictor_gp assigns them), and brms's prediction nug argument is not exposed. gp() in per-category predictors is described in the category-specific predictors row. Not supported: transpiling a program with an exact GP (every target refuses cholesky). Multi-membership mm() is described in the group effects row. mgcv's sp argument of s() and t2() is accepted and has no effect, as in brms, whose Stan program and data do not depend on it (tests/formulas/oracles/brms_smooth_sp.R, tests/formulas/test_smooth_sp.py). |
| Dependence structures | Formula terms ar, ma, arma (conditional, and cov = TRUE of order at most one), cosy, unstr, sar (lag and error), fcor, and car (escar, esicar, icar, bym2) follow brms's parameterization, classes (ar, ma, cosy, Lcortime, lagsar, errorsar, sdcar, car, rhocar, sderr), bounds, data2 matrices, and combination rules. Gaussian and Student residual structures bind one ResidualResponse law; other families receive brms's latent residuals; car adds a latent location effect to any family with one location predictor. Latent terms share one emission path (LatentTerm) with exact per-component sum-to-zero supports and sparse precision scoring. Prediction follows brms: conditional ARMA mu, new rows as their own series, fresh latent residuals for new covariance rows, CAR at fitted locations only, incl_autocor, and leave-one-out pointwise likelihoods for non-factorized structures. tests/formulas/test_autocor.py and tests/formulas/test_car.py check brms's Stan loops, standata and BYM2 scaling factors (pinned by tests/formulas/oracles/autocor_brms.R), SciPy densities, derivatives, SVI/HMC/NUTS, prediction, update, grouped folds, and artifacts. Under default_priors="brms" the conditional ARMA coefficients take brms's improper flat prior and covariance ARMA coefficients its flat prior on [-1, 1], and the quivers policy keeps the proper Normal(0, 1). Deliberate differences: SAR densities keep their constants; intrinsic CAR constraints and BYM2 scaling are per connected component. Combinations follow brms: a conditional ARMA term beside sar or fcor (the ARMA recursion gives the location of the SAR or fixed-covariance law), se(..., sigma = TRUE) beside a time-series covariance (squared errors on the diagonal of each series covariance), and cens(), trunc(), and weights beside the conditional ARMA formulation (row events under the conditional law). data2 on the prediction and likelihood methods is brms's newdata2 for sar and fcor rows, also inside joint models, where each response keeps its own residual law. tests/formulas/test_autocor_combinations.py checks SciPy densities over dense matrices, transcriptions of brms's Stan functions, first and second derivatives, brms log_lik, posterior_epred, and posterior_linpred at brms draws on training and new rows, and every brms refusal (pinned by tests/formulas/oracles/brms_autocor_combinations.R). Refused as brms refuses: two covariances of natural residuals, se() beside a conditional ARMA or fcor term or without sigma = TRUE, and weights, censoring, or truncation beside a covariance or fcor term. Refused because brms's generated Stan program does not compile: se(), weights, censoring, or truncation beside sar. Three further deliberate differences are stated in the guide. A sar or fcor matrix indexes the rows as given, where brms pairs it with its time-sorted rows beside an ARMA term. New rows require their own data2 matrix, where brms reuses the fitted matrix when row counts agree. A missing response among prediction rows is refused when ARMA terms are combined with sar or fcor. A covariance, SAR, or fixed-covariance term on a response of a joint model with estimated residual correlation is refused with brms's message. Not supported, with a located error: a conditional ARMA term on such a response, which brms admits. |
| Additional response information | Formula offset(expr) and exposure(expr) terms enter location and auxiliary predictors with coefficient one, preserve evaluated arrays, and agree with independent density, gradient, and posterior-prediction oracles in tests/test_formula_offsets.py. Binomial and beta-binomial trials support constants or per-row columns. Formula weights="column" retains typed row weights and scales only observation scores; independent prior/likelihood gradient, exposure-interaction, and fixed-coefficient prediction oracles are in tests/test_formula_weights.py. Checked observation metadata retains censoring, interval upper endpoints, and truncation bounds. Formula response roles also retain subset, known standard errors, decisions, weights, and trials. Native and checked-reference execution share event semantics; all 11 external source renderers refuse recorded-event observes explicitly. Native finite marginalization retains these scores and likelihood weights before its class reductions. Likelihood weights are distinct from replication. cens and trunc are admitted for exactly the families brms admits them for and refused with a located error elsewhere; every admitted family scores both log tails directly (Student-t through the incomplete beta function, von Mises through its certified Bessel series, Conway-Maxwell-Poisson through certified sums, zero atoms by composition), and the Gaussian mixture truncates each component separately as brms does. The family-by-term matrix with SVI, HMC, NUTS, a density-quadrature oracle, and bounded truncated prediction is in tests/formulas/test_recorded_event_matrix.py; distribution oracles are in tests/continuous/test_recorded_event_tails.py. Weibull and lognormal tails are scored through the exponential and Normal laws they transform, the skew-normal upper tail directly, and a hurdle interval as its atom plus its component mass, so censored fits run at any data scale: tests/continuous/test_far_tail_scoring.py (SciPy and mpmath references) and tests/formulas/test_recorded_event_scale.py (rescaling the response and the matching parameters shifts exact-row log densities by the log Jacobian and leaves event masses unchanged). posterior_epred, fitted, residuals, bayes_r2, and conditional_effects of a truncated response use the mean of the truncated law without sampling, for one-sided and two-sided bounds: closed forms through the size-biased law for the Gaussian, Student-t, lognormal, shifted lognormal, gamma, exponential, Weibull, Fréchet, inverse Gaussian, beta, positive hurdle, zero-inflated beta, Poisson, binomial, negative binomial, and geometric families (a superset of brms's posterior_epred_trunc_*, pinned against those functions in tests/formulas/oracles/brms_truncated_epred.R), finite sums for the other counts, and quantile-panel Gauss-Legendre quadrature certified against the interval mass for the other continuous laws (tests/continuous/test_truncated_mean.py, tests/formulas/test_truncated_epred.py). Deliberately different: brms caps an unbounded count range at three times the largest mean, where the count identities here are exact. Not done: a deterministic truncated mean for cox (its bounded range keeps mc_samples), and for a count law without a closed form on an unbounded range that holds less than 1e-6 of the law. cens and trunc on custom families are decided by the bound native law. rate(denom) multiplies the count mean and the negative binomial shape by the denominator for poisson, negative_binomial, negbinomial2 and geometric (which becomes the negative binomial with shape denom), matching brms's Stan code for every link. Denominators must be positive. subset() accepts numeric 0/1 as brms does. thres(n) and cat(n) declare the ordinal threshold count beyond the observed categories (pinned against brms make_standata nthres), and update_adterms edits addition terms as brms does (tests/formulas/test_addition_terms.py). thres(n, gr = g), brms's unpooled threshold vector per group, is described in the special predictor terms row. |
| Missing data and measurement error | bf("x \| mi() ~ z") responses, mi(sdx) known response errors, mi(x) and mi(x, idx) predictors (also in interactions, distributional and nonlinear-parameter formulas), index(), and subset() sparse imputation models compile through the joint program with brms's density (recorded values observed, missing values latent under the response law; Yl truths under mi(sdx)), checked against hand-written joint densities and autograd and pinned against brms make_stancode/make_standata/variables (tests/formulas/oracles/brms_missing.R). me(x, sdx, gr) predictors use brms's noncentered Xme = meanme + sdme * Lme * zme with set_mecor and prior classes meanme, sdme, corme. Families admitting mi() follow brms's list. Training-row predictions replay imputed draws; fresh rows use recorded values and are refused when an mi()/me() value is missing (brms returns NA). Pointwise mi() response scores are NaN at missing rows, and refit units are rows with recorded mi() values. fit_multiple and combine_models (brms brm_multiple, combine_models) pool recorded draws chain by chain with per-dataset R-hat. tests/formulas/test_joint_missing.py and test_multiple_imputation.py. Under default_priors="brms", meanme takes brms's improper flat prior, sdme its flat prior on (0, inf), and mi() coefficients (class b) the flat prior, and the defaults of an mi() response are scaled on its recorded values (brms's na.rm = TRUE). The quivers policy keeps proper defaults (fixed_prior, random_scale_prior). Ymi has no prior in either: its density is the response law, equal to brms's joint. An mi() term is also the slope of a group-level term, (mi(x) \| g): the varying coefficient multiplies the completed values, brms's (bsp + r[J[n]]) * Yl[n], with brms's names (sd_g__y_mix, r_g__y[level,mix]), checked against a hand-written joint density with first and second derivatives in the imputed values and pinned against brms's Stan predictor and prior rows (tests/formulas/oracles/brms_missing_slopes.R, tests/formulas/test_missing_varying_slopes.py). A varying mi() slope without the same population-level term is refused, because brms declares such a slope and omits it from the predictor. MultipleFit.update (brms update of a brm_multiple fit) refits every dataset through the first fit's recipe and requires the datasets, as brms requires newdata. mi() responses also fit under set_rescor(True) (Gaussian and Student, weights included): each missing value, or each true value under mi(sdx), is a latent site under the improper flat law, and one log-density factor scores the completed row vectors under diag(sigma) Lrescor by forward substitution, brms's multi_normal_cholesky_lpdf(Yl | Mu, LSigma) and multi_student_t_lpdf(Yl | nu, Mu, Sigma). Responses may use each other's completed values. posterior_predict draws rows jointly, posterior_epred returns the locations at the replayed completed values, and log_likelihood scores the recorded row vector or the exact marginal of a response subset, NaN where a selected response is missing. Values and first and second derivatives are checked against torch.distributions and SciPy references, and Stan statements, log_lik, posterior_epred, and posterior_linpred are pinned against brms at its draws (tests/formulas/oracles/brms_missing_rescor.R, tests/formulas/test_missing_rescor.py). Deliberately different: brms redraws the true values of an mi(sdx) response from the measurement model when they were not saved, and QVR always replays their posterior draws (brms with save_pars(latent = TRUE)). The flat sites make sample_prior, prior draws, and SMC evidence refuse such a model. Not supported: discrete mi() responses (as brms), and me() multivariate names other than the univariate pattern are unverified against brms. |
| Priors | get_prior inspects overrideable priors in the formula AST, including column autoscaling, auxiliary coefficients, and shared correlations. Unused overrides fail before fitting; fixed_parameters removes known auxiliary parameters from the latent and prior layouts. Source and formula interfaces share sample_prior, independent PriorDraws, and prior views through the existing posterior collectors. Prior-only inference disables observation likelihoods while preserving authored score potentials. Independent ancestral collection refuses potentials it cannot normalize; explicit inference can retain them. tests/test_prior_sampling.py and tests/test_prior_workflows.py check discrete/scan/simplex draws, RNG independence, and both interfaces. |
| Prior selectors, hierarchies, and bounds | PriorSpec/PriorSet resolve class, coefficient, group, distributional, nonlinear, and exact-site selectors against the same retained PriorTarget catalogue. Empty, conflicting, unused, and fully shadowed rules fail before fitting. Regularized horseshoe and R2D2 blocks share sampled hyperparameters across population and group-scale targets, retain component coordinates, and reuse the existing coefficient emitter. Selector bounds and target support compose as normalized conditional restrictions, preserving hyperprior marginals. tests/test_formula_prior_specs.py checks independent joint-density and gradient oracles, selector conflicts, component layouts, fitting with SVI/HMC/NUTS, prior views, and fresh-row prediction. Deliberately different: coef selects the prior table's label, which numbers the columns of a term with several columns (f_1, f_2), where brms joins the term and the factor level (fu, fv). The brms label is not accepted as a selector, though variables() reports b_fu. These tests do not establish every brms prior class, default, or interaction. |
| Sampling and variational fitting | Existing MCMC and variational components remain configurable through reusable methods. The source interface also supplies SMCMethod, returning the existing particle result. Every algorithm's objective, stopping condition, initialization, and checkpoint semantics stay visible. This does not establish equivalence to Stan's samplers. |
| brms default priors, flat and constant priors, prior tables | default_priors="brms" (fit, get_prior, default_prior, joint formulas) reproduces brms::default_prior for classes b (improper flat), centered Intercept (Student-t at the rounded linked median and max(2.5, mad) scale, less the mean offset), sd/sds/sdgp/sderr/sdcar and sigma (half Student-t), cor/rescor (LKJ(1)), every estimated auxiliary class of def_dpar_prior, the brms 2.23 family priors (negative binomial shapes, negbinomial2 sigma, xbeta kappa, von_mises tan-half intercept), and bounded flat structural classes, pinned against get_prior in tests/formulas/oracles/brms_default_priors.R. The quivers policy stays the default. ImproperFlat is a compilation-local Lebesgue law that fitting scores and every prior draw, sample_prior, prior initialization, and SMC evidence refuses with the flat sites named. ConstantPrior (brms constant()) binds a site deterministically, and draws() reports it. A tuple with broadcast=False fixes each coefficient of a class within one predictor and grouping factor, brms's <par> = <v> for a parameter vector (tests/formulas/test_vector_constant_priors.py, coefficient orders pinned by tests/formulas/oracles/brms_vector_constants.R). Different by design: the values follow the prior table's term order where brms follows R's model-matrix order (interactions after main effects), and brms's bs and bsp vectors are class b rows of one sequence. PriorSpec.tag, main=True on horseshoe and R2D2 (joining a predictor's classes), and brms's sd-as-scale semantics of shrinkage on standard deviations are supported. default_prior, validate_prior, prior_summary return a PriorTable with brms's columns, and the first two take knots and drop_unused_levels as get_prior does, for single and joint formulas (coefficient rows pinned against brms get_prior in tests/formulas/oracles/brms_prior_table_options.R). Deliberately different: ordinal thresholds, mixture weights, baseline hazards, structured latent terms, and the intercepts of categorical and mixture predictors (which cannot be centered) keep quivers defaults under the brms policy. check = FALSE (raw Stan code) has no counterpart, and shrinkage on ar/ma is refused. |
| brms formula options and R operators | center (brms centered intercept, reported on the original scale), decomp="QR" (Stan's scaled thin QR with positive diagonal, priors on bQ), cmc=False, sparse=True (same model, no centering, as brms), unused, the Intercept variable (0 + Intercept), and update(formula=". ~ . + z") with R's update.formula semantics (dot on either side, - term removal, group-level terms kept, added, or removed whole, pinned against R in tests/formulas/oracles/update_formula_oracle.R), on fit and on bf() for joint formulas. factor(x) and as.factor(x) code a column by treatment contrasts with retained levels (tests/formulas/test_formula_names_and_factor.py). factor(..., ordered = TRUE) and factor() in a grouping term are refused. An unknown variable or function raises an error quoting the formula and listing the data columns. Centering and QR are refused for ordinal, categorical-type, and mixture families, whose intercepts are thresholds, category logits, or components. R operators I(x^2), (a + b)^k, %in%, R's scale() (n - 1 deviation), splines::ns() (R's Householder projection, linear beyond the boundary knots), and splines::bs() (any degree, first column dropped unless intercept, quantile knots on a boundary knot moved inside, boundary polynomials continued beyond the boundary knots) are pinned with poly, log, :, *, - against R's model.matrix and predict in tests/formulas/oracles/brms_model_matrix.R. Deliberately different: interactions of factors without their main effects use a full-rank coding where R's model.matrix is rank deficient (same column space). drop_unused_levels=False (fit, formula_to_qvr, get_prior, joint formulas) keeps the declared pandas categories that no row uses: population factor columns of zeros in R's level order, and grouping-factor levels whose group effects follow their prior, pinned against brms make_standata(drop_unused_levels = ) in tests/formulas/oracles/brms_drop_unused_levels.R. A factor with unused levels in a group-level term is refused. Deliberately different under the default drop_unused_levels=True: an ordered pandas factor keeps its unused categories (the formula evaluator reads ordered categories as declared), where brms drops them. Not done: loop (vectorization only). |
| brms fitting controls | control (adapt_delta, max_treedepth, stepsize, metric), thin, init ("random" with init_r, 0, per-chain lists, functions of the chain index), and algorithm (sampling, meanfield, fullrank, laplace, fixed_param, pathfinder) configure the existing MCMC driver, NUTS/HMC kernels, guides, and the Pathfinder driver for single and joint formulas. A random initial position whose log density is not finite is redrawn from the chain's stream, up to 100 attempts, as Stan does (tests/test_mcmc_initial_retry.py). algorithm="pathfinder" is single- and multi-path Pathfinder (quivers.inference.Pathfinder, also PathfinderMethod in the model interface) with brms's chains as the path count and cmdstanr's arguments in pathfinder= (draws, single_path_draws, history_size, max_lbfgs_iters, num_elbo_draws, psis_resample, calculate_lp, save_single_paths, init_alpha, tol_*). The line search is a strong Wolfe search with cubic interpolation where CmdStan uses its own Wolfe search, so paths match CmdStan's in law, not draw for draw, and paths run in sequence. file/file_refit (never, always, on_change) cache fits through save_fit/load_fit. cores runs the MCMC chains in up to cores worker processes (quivers.inference.mcmc.parallel): each worker rebuilds the fit from the refit recipe's arguments and data (or, for MCMCMethod(cores=), recompiles the QVR source and binding) instead of receiving pickled compiled objects, runs its chains from the driver's per-chain streams, and returns checkpoint records that the parent assembles. The result equals the serial run draw for draw. A worker is a fresh interpreter running quivers.inference.mcmc._chain_entry, which never imports the calling script, so a script needs no if __name__ == "__main__": block. Every fit argument must be picklable and must not be defined in the script's main module, which fit refuses before any worker starts, and a failing worker stops the others (tests/formulas/test_parallel_chain_processes.py). knots passes user knots to the cr, cs, cc, ps and bs constructors of s() as mgcv does (pinned against mgcv smoothCon(knots = ) and brms make_standata(knots = ) in tests/formulas/oracles/mgcv_smooths.R). A tp, ts or ds basis, also over several covariates, takes its knots as the points of mgcv's tprs_setup and Duchon constructors (the eigenbasis of the knots, or one function per knot when their count equals k), and each t2() margin reads the knots of its covariates, pinned against brms make_standata(knots = ) and s2rPred on fresh rows in tests/formulas/oracles/mgcv_duchon_knots.R (tests/formulas/test_mgcv_duchon_knots.py). Different by design: knots that mgcv ignores (fewer than k, more than the rows, or for some covariates of a smooth alone) are refused. Knots of gp, fs and mrf bases are refused. Not applicable: backend, threads, opencl, stanvars, stan_model_args, rename, normalize, silent, refresh. |
| Prediction | BayesianFit.posterior_linpred, posterior_epred, and posterior_predict accept new_data, retaining training transforms, contrasts, category labels, and group coding. They preserve chain/draw axes and validate new covariates, offsets, exposures, auxiliary predictors, and per-row trials without response or likelihood-weight columns. Known groups may be reordered or repeated. New or missing group IDs require allow_new_levels=True and an explicit donor/Gaussian policy; ordinary categorical predictor levels remain strict. re_formula selects fitted varying effects, with unknown selectors refused. Neural fits require explicit new predictor_data. tests/test_formula_new_data.py checks independent prediction and derivative oracles and retained layouts. ModelFit.predict accepts checked tensor bindings with a new row count when the latent layout remains compatible. Tests additionally check joint cross-auxiliary donors, compact prediction axes, categorical group-major layouts, and group-effect/response RNG independence. Joint fits select responses with resp, and the summary methods of the brms prediction contract (predict, fitted, residuals, predictive_error, predictive_interval) are described in the other post-processing row. Deliberately different: posterior_predict, posterior_epred, posterior_linpred, and log_likelihood take num_samples and a seed and have no draw_ids, which the summary methods accept. |
| Parameter summaries and diagnostics | BayesianFit.draws preserves chain/draw axes; fixed_effects, random_effects, and coefficients reconstruct native population/group coefficients with original labels and retained level coding. tests/test_formula_posterior.py checks centered, noncentered, shared, and categorical effects. Both source and formula fits expose retained PosteriorAnalysis uncertainty summaries; recorded MCMC chains supply convergence diagnostics, while variational pseudo-chains do not. PosteriorAnalysis.covariance returns covariance and correlation from the same retained joint sample matrix, with pooled or per-chain reductions, structural event coordinates, and shared DataTree label validation. NumPy/SciPy oracles and source/formula SVI plus recorded HMC/NUTS checks cover the common path. Formula fits (single and joint) carry brms's summary surface: variables (brms parameter names in the order of brms's reorder_pars: its class order with the family's parameters between lscale and hs, intercepts first within a class, location predictors before the other predictors, gr(by = ) standard deviations level by level, and names without a brms counterpart last, with the name tests comparing ordered lists against brms's variables(); coefficient labels through brms's renaming, one naming function for single and joint fits pinned against brms variables() in tests/formulas/oracles/brms_joint_variable_names.R, I(x^2) labeled IxE2, cumulative thresholds as b_Intercept[k], other native sites under QVR names, every variable one scalar per draw, and every term naming its sites through one catalogue, quivers.formulas._variable_catalogue, checked against brms variables() for one model per term in tests/formulas/oracles/brms_term_variables.R, with bs_/sds_/s_ for smooths (labels by covariates and by variable, one block per level of a factor by, penalties counted within a block, and brms's make.unique repair of two smooths of one covariate, pinned against brms variables() in tests/formulas/oracles/brms_smooth_names.R for s, t2, factor, ordered and numeric by, the fs, gp and re bases, fx, distributional and joint models), sdgp_/lscale_/zgp_ for Gaussian processes, bsp_/simo_ for monotonic terms, bcs_ for category-specific effects, sd_<g>__<coef>:<by><level> and one correlation per by level for gr(by = ), df_<g> for Student-t group effects, ar[k]/ma[k]/cortime__a__b/sderr/err[i], theta<k>, sbhaz[k], hs_global/hs_slab/hs_local[k], R2D2_R2/R2D2_phi[k], sigma<c> and lncor__a__b for a logistic-normal response, and b_Intercept for the 0 + Intercept column), summary (brms sections including the splines table of sds(<label>_<j>) rows, prob, robust, mc_se, with Rhat/Bulk_ESS/Tail_ESS only for recorded chains), fixef, ranef, coef (brms's threshold signs), varcorr (with residual__ and residual correlations), vcov, posterior_summary, posterior_interval, ndraws/nchains/niterations/nwarmup/nvariables, nobs, ngrps, rhat, neff_ratio, nuts_params, log_posterior. tests/formulas/test_postprocess_tables.py recomputes every brms table from draws exported by tests/formulas/oracles/brms_postprocess.R and compares names and layouts of quivers fits of the same formulas. control_params returns the kernel's adapt_delta, max_treedepth, stepsize (before adaptation), and metric, and inits returns each chain's initial values on the constrained scale, read from a rerun of the fit's retained arguments that stops at the driver before sampling (the driver derives a chain's initial point from the seed and chain index, so a fixed_param run's draws equal them, which tests/formulas/test_crossproduct_fixes.py checks). Per-level group coefficients of gr(by = ) and gr(dist = "student") blocks use the per-by-level scales and Cholesky factors and the multiplier sqrt(df * udf_j). tests/formulas/test_term_postprocessing_matrix.py crosses one fitted model per term, family, and option class with every post-processing method. Each cell returns finite output of the documented shape or the documented refusal, and the per-level coefficients of every group case equal the program's own coefficient bindings at each draw. A shrinkage prior lists brms's sdb_<coef> (each coefficient's prior scale, evaluated from the program's own scale binding) and R2D2_tau2. Joint add_criterion, loo, and waic take resp, which scores the responses without missing values of a model with mi() responses as brms advises; scoring a missing mi() response is refused, where brms reports NA. Not provided: lprior and brms's constant disc variable. PSIS-based criteria need at least 25 pooled draws and refuse fewer. Bulk and tail ESS follow ArviZ, whose Geyer truncation can stop one lag pair later than R's posterior package. |
| Model comparison | ModelFit.log_likelihood(data=...) and BayesianFit.log_likelihood(new_data=...) extract raw pointwise observation densities on retained or fresh recorded outcomes. Formula scoring reuses fitted response transforms, level coding, subset/event-role binding, trial validation, group prediction, and native replay; independent Normal, categorical, count-vector, censoring, and new-group oracles are in tests/test_formula_heldout_likelihood.py. Their shared PosteriorAnalysis reuses scores for torch-only empirical WAIC, optional ArviZ PSIS-LOO, and ranked model comparison with stacking weights. Compared analyses check response values and predictive score units. Retained analyses accept explicit observation/event coordinates through the shared DataTree converter. Source and formula fits expose evidence(sampler) through the existing SMC driver, retaining normalized-prior, exact-likelihood, and typed-score checks. Independent conjugate-Normal and powered-target oracles are in tests/test_fit_evidence.py. FoldPlan and cross_validate reuse these raw scores with explicit refit callbacks, random/grouped/stratified partitions, selected folds, and joint response/fold/group units. Independent conjugate-Normal predictive and SciPy log-sum-exp oracles are in tests/test_cross_validation.py. RefitRecipe, ModelFit.update, and BayesianFit.update retain canonical fitting inputs. Their refit_callback adapters partition checked source axes or included formula rows through the same runner, including neural row inputs. PosteriorAnalysis.reloo reuses those callbacks and raw-score validation with ArviZ's existing PSIS/refit protocol; analytic Normal and source/formula adapter tests are in tests/test_reloo.py. A whole-program joint score is insufficient. Formula fits add brms's leave-one-out family: loo (moment_match through ArviZ's implicitly adaptive importance sampling with the fit's own Jacobian-corrected log joint, reloo through the refit callback, k_threshold 0.7), loo_moment_match, waic, psis, loo_subsample (native difference estimator, plpd at the unconstrained posterior mean or lpd, refused for residual dependence and joint mi() fits), kfold (random, group, stratified, grouped and loo folds, Ksub, joint, save_fits) with kfold_predict, add_criterion (stored on the fit and in artifacts), loo_compare, loo_model_weights, and model_weights (stacking, pseudo-BMA, Akaike-type loo/waic/kfold weights). Results are typed ELPDEstimate records. tests/formulas/test_postprocess_loo.py checks PSIS-LOO, WAIC, comparison, weights, E_loo, and subsampling against the R loo package on identical scores, and PSIS, moment matching, subsampling, exact refits, and k-fold against closed-form conjugate-Normal predictive densities within Monte Carlo error. k-fold partitions come from a seeded quivers stream, not R's generator. Marginal-likelihood weights (bma) are WP11. brms marginal-likelihood workflows: bridge_sampler estimates the log marginal likelihood by bridge sampling as the R bridgesampling package (normal and warp-3 proposals, coda effective sizes, Matrix nearPD, the fixed-point scheme with its restart, repetitions, error_measures with the Frühwirth-Schnatter relative MSE) on the fit's unconstrained draws and Jacobian-corrected log joint; bayes_factor, post_prob (with prior_prob) and model_weights(weights="bma") take fits or stored estimates and refuse different response data. posterior_average (with variable, missing, ndraws) and pp_average (with method, summary, probs, robust, resp) mix draws by brms's largest-remainder allocation of stacking, pseudo-BMA, information-criterion, BMA or explicit weights. tests/formulas/test_bridge_evidence.py pins the deterministic steps against bridgesampling 1.1.2, coda and Matrix (generator tests/formulas/oracles/bridge_numerics.R) and checks closed-form conjugate, latent-scale and hierarchical quadrature marginal likelihoods within four estimated coefficients of variation, agreement with SMC evidence, joint fits, NUTS and HMC draws, a rejected variant without the Jacobian, and refusals (improper priors, variational draws, different responses); tests/formulas/test_model_averaging.py checks allocation, draw identity, missing values and weights. Deliberate differences: proposal draws come from a Torch stream (estimates agree with R within Monte Carlo error); non-convergence after the restart raises instead of returning NA; a parameter constant across draws is refused; brms's deprecated weight names marglik and loo2 are refused (use bma and stacking); marglik is not cached by add_criterion (store the BridgeResult and pass it to bayes_factor or post_prob). |
| brms spellings of formulas, families, and hypotheses | fit(bf(y ~ x, zi ~ z), family=...) classifies the parameter formulas of a bf without a family under the entry point's family. lf, nlf, set_nl, and + Family extend a bf response. "b1 + b2 ~ 1" gives several parameters one formula, and a nonlinear main formula, an nlf formula, and an addition-term argument (se(sqrt(1 / (n - 3)))) are R expressions over Stan's functions (^, **, inv_logit, logit, log1m, Phi, fmin, step, and the rest of quivers.formulas._r_expression.R_FUNCTIONS), translated to QVR value expressions with numeric data read as doubles. PriorSpec(nlpar=) reaches a nonlinear intercept as brms's class b. Every brms family name resolves (negbinomial, student, Gamma, inverse.gaussian, zi_/hu_ prefixes), and brmsfamily builds a family with links, thresholds, and a reference category. Integer ordinal responses follow brms's coding 1..max(y), with max(y) - 1 thresholds overall and per thres(gr) group. Ordered-factor predictors use R's contr.poly in population and group-level terms, with brms's names. hypothesis reads brms strings with class_, group, scope, and alpha and returns brms's table. MultipleFit has the post-processing methods of its pooled fit, and fit_multiple(combine=False) returns the separate fits. loo(fit1, fit2) and waic(fit1, fit2) compute and compare, and plot, pairs, and mcmc_plot take regex=. Tested in tests/formulas/test_brms_spelling.py against brms brmsfamily, make_standata, hypothesis, and density_ratio and R's model.matrix (oracles/brms_vignette_spelling.R), and in tests/formulas/test_brms_vignettes.py, which runs the models and post-processing calls of the brms vignettes in their brms spelling. Deliberate differences follow. A fit reports registered family and parameter names (negative_binomial, and disp where brms has shape). Predicted ordinal categories are zero-based positions in category_labels, where brms returns 1..K. An integer ordinal response holding a zero keeps the codes 0..K-1, which brms refuses. Prior distributions are QVR strings ("Normal(0, 5)"), not Stan's (normal(0, 5)). A string hypothesis and a contrast expression share the hypothesis method and are told apart by a relation outside parentheses. The density ratio of a point hypothesis is interpolated by a not-a-knot cubic spline where R uses the Forsythe, Malcolm and Moler spline, and the two agree to the interpolation error. Not supported: acformula, an nlf parameter beside an additive main formula, R functions outside the table, R's %%, %/%, and ifelse in expressions, prior coef labels of factor levels by their brms names (fu), and a brms name for the negative-binomial shape. |
| Contrast summaries and region evidence | hypothesis_summary accepts retained joint contrast tensors, preserving event coordinates and explicit draw provenance. It returns means/SD or medians/scaled MAD, quantiles, strict-region posterior odds, and prior-corrected region log Bayes factors. Exact equality remains descriptive; empirical prior probabilities zero or one make the region Bayes factor undefined. tests/test_hypothesis_summary.py checks independent NumPy/SciPy summaries, exact region counts, asymmetric prior odds, degenerate/extreme/count inputs, coordinates, and source/formula retained-draw reuse. PosteriorAnalysis.hypothesis and BayesianFit.hypothesis check expressions through the existing QVR parser and QIEC checker, preserve nominal event axes, and reuse jointly aligned prior streams. tests/test_retained_contrasts.py and tests/test_formula_hypotheses.py compare arithmetic, carriers, coefficient labels, and grouped reconstruction with native/reference oracles. The shared density_ratio component estimates point ordinates with direct bounded Gaussian sums; a point-null BF01 interpretation requires caller-declared proper continuous and compatible null nuisance priors. Independent SciPy, analytic, and extreme-scale oracles are in tests/test_density_ordinates.py. PointNullSpec integrates this same density calculation into functional, retained, and formula hypothesis adapters. Checked contrasts retain their Real carrier and jointly aligned posterior/prior streams; independent and extreme-tail oracles are in tests/test_point_hypothesis_facades.py. |
| Other post-processing | Shared bayesian_r2 computes residual-based or model-variance ratios from retained conditional moments, with independent NumPy and extreme-scale checks. BayesianFit.bayes_r2 reuses retained prediction bindings and response transforms for both definitions, including ordered-category scores and unsigned Wiener times. Formula conditional_effects makes one joint prediction request over a bounded prediction_grid, preserving group policies and averaging empirical reference rows within each draw. The grid/result records reuse existing posterior summaries and covariance, with core mapping inputs independent of dataframe extras. tests/test_conditional_effects.py and tests/test_conditional_core_imports.py check nonlinear effects, dependence, group prediction, allocation bounds, and optional imports. Source posterior_expectations, ModelFit.posterior_epred, and source conditional effects reuse the same response moments, constrained draws, and observation-occurrence grouping. Scan, lexical, categorical, ordinal, truncated, conditional-upstream, and equal-size nominal-axis cases are in tests/modeling/test_expectations.py and tests/dsl/test_parameter_axis_identity.py. Explicit refit partitioning and scoring use the shared cross_validate runner; retained updates now share canonical fitting recipes. PosteriorAnalysis.to_netcdf and from_netcdf reuse the labeled DataTree representation, preserving provenance, dtypes, and observation axes with atomic writes. save_fit and load_fit restore source-model execution through checked binding, typed tensor storage, and a conditioned registry reconstruction without inference. Formula artifacts reuse the same preparation, predictor graph, design reconstruction, and posterior codecs; tests/modeling/test_formula_artifact.py checks exact prediction replay, live refit ownership, typed frames, and explicit custom factories. brms's prediction summaries: predict, fitted (scale, parameter for dpar/nlpar), residuals (ordinary, Pearson; refused for ordinal and categorical responses), predictive_error (method aliases as brms), predictive_interval, all with summary, robust, probs, and draw_ids (0-based); ordinal predictions are tabulated with posterior_table. loo_predict, loo_epred, loo_linpred, loo_predictive_interval, and loo_r2 weight predictions by PSIS through ArviZ's function-specific Pareto diagnostics. Joint fits return per-response dictionaries where brms returns arrays with a response axis. brms automatic conditional_effects (called without a grid on BayesianFit and MultivariateFit): default effects (population-level variables and two-way term combinations over all predicted parameters, special-term variables crossed), effects, conditions with make_conditions, int_conditions (values, labeled values, functions), re_formula (default "~0", brms's NA), prob, robust, method, spaghetti, surface, too_far (mgcv exclude.too.far), categorical and ordinal, resolution, select_points with point frames, resp (effects then responses, <resp>.<resp>_<effects> names), dpar, nlpar, ndraws, draw_ids; results are labeled frames with brms's columns plus the draws. conditional_smooths() on a fit computes brms's automatic smooth grids (smooths, int_conditions, prob, spaghetti, surface, resolution, too_far, ndraws, draw_ids), following brms 2.23.0: the first by variable of a one-covariate smooth becomes the second effect, and surface=FALSE holds a numeric second covariate at its mean and mean plus and minus one standard deviation (brms 2.20.4 did neither). pp_check returns the data behind every bayesplot ppc_* type brms forwards (41 types) and the 16 ppd_* types, with brms's default draws, group, x, newdata, resp, censoring handling, and PSIS weights for leave-one-out types; ArviZ draws the counterparts that exist (PPCheck.plot). mcmc_plot, plot and pairs map bayesplot's mcmc_* types onto ArviZ. tests/formulas/test_brms_conditional_effects.py pins brms 2.20.4 effects, names, conditions, grids, labels, points and spaghetti layouts (generator tests/formulas/oracles/brms_conditional_effects.R); tests/formulas/test_ppc_data.py pins bayesplot 1.10.0, loo and survival tables (generator tests/formulas/oracles/bayesplot_ppc_data.R); tests/formulas/test_pp_check.py checks brms's preparation and the ArviZ mapping. Deliberate differences: frames omit columns of transformed terms (log(w)); string factor levels sort by code point (R by locale); ordinal effects without categorical use brms's equidistant scores 1..K; transform is not provided (transform the retained draws); posterior_smooths is quivers.formulas.conditional_smooths(fit, term, new_data); variable of plot and mcmc_plot is a pattern matched against whole names unless regex=True; bayesplot's pit_ecdf simultaneous bands are not computed (ArviZ draws its own); NUTS acceptance, divergence, step-size and tree-depth plots and the recover_* plots have no ArviZ counterpart; stanplot and the ggplot themes are not applicable. conditional_smooths of a joint fit evaluates the smooths of every response or of those named by resp, and automatic conditional_effects take mc_samples for conditional means without a closed form, exclude autocorrelation terms as brms's incl_autocor = FALSE does (so a latent-residual ar model has effects), and set the trials of a count-vector response to one. |
| Custom families and backends | Immutable FamilyCatalog values retain checked signatures and native implementations per compilation. custom_family maps location, auxiliary, and typed data parameters through the existing predictor graph and response helpers; tests/formulas/test_custom_family.py checks independent likelihoods, derivatives, fitting with SVI/HMC/NUTS, updates, held-out scores, censoring, and prediction. Native factories remain explicit when restoring artifacts. Every unsupported external target reports a capability refusal. Runtime contracts cannot prove normalization or sampler correctness for caller-written implementations. |
Full coverage requires an executable fixture for every supported feature and interaction, an independent density or prediction oracle, and a stated tolerance. For instance, comparing correlated effects requires checking the covariance model; matching a formula's printed text would not establish the same prior.
The pinned released family registry
and development family registry
each contain 49 named entries plus custom; their definitions agree apart
from trailing whitespace. QVR's 50 formula entries cover all 49 of those names
after normalizing student/student_t, negbinomial/negative_binomial,
and inverse.gaussian/inverse_gaussian. Its remaining entry is generic
mixture composition. This name comparison does not establish equivalent
parameterizations, links, or fitting behavior.
Deliberate differences in the family registry: Gamma and Beta are
gamma and beta, and the negative binomial shape is the parameter disp
(brms shape). inverse_gaussian defaults to the log link (brms 1/mu^2,
available as inverse_square), which keeps the mean positive for every
linear predictor. student_t leaves nu unbounded below under the quivers
prior policy (brms bounds it at one, as default_priors="brms" does), and
posterior_epred raises for draws with nu <= 1. brms's d/p/q/r
functions have no counterpart: the native laws are distribution objects
with log_prob, cdf, icdf, and sample methods, and the Student-t,
von Mises, and zero-inflated beta laws have no public cdf or icdf.
The cox and xbeta formula frontends complete this name inventory.
cox retains an identified normalized spline baseline and a proper
positive-hazard tail through the generic BernsteinHazard law; xbeta
reuses an affine Beta law and censoring atoms. Neither name establishes
all baseline-group, response-modifier, prior, or workflow behavior.
The native kernel registry is a separate capability: a native distribution
does not imply its corresponding formula workflow. dirichlet2 is an
alternate parameterization, rather than a new distribution law.
The vector frontends share the categorical compiler's component coordinates and the ordinary posterior replay machinery. Multinomial and Dirichlet-multinomial responses retain integer row totals; Dirichlet responses retain mean/precision or component-concentration parameterizations. Additive-log-ratio Normal responses retain an explicit reference component, covariance coordinates, and the simplex Jacobian. Their optional Monte Carlo response expectations require an explicit sample budget. Independent tests compare complete joints, every fitted coefficient gradient, mixed-width group correlations, and new-data predictions. Joint multivariate formulas and residual correlations are described in the multivariate responses row.
Wiener formulas retain unsigned reaction times and decisions as separate typed inputs and encode their joint law inside QVR. The native and reference kernels share one certified rejection sampler. Density and moment tests use independent series and differential-equation oracles; formula tests cover SVI, HMC, NUTS, all distributional-parameter derivatives, and new-data predictions. Low-level predictive draws retain the signed joint encoding, while structured response draws decode reaction time and decision without repeating sampling. This does not establish support for every response modifier.
COM-Poisson and all five ordinal constructions now have formula frontends. COM uses the pinned compiled rate law consistently for fitting and prediction, while the released R helpers use a mode parameterization. The COM guide states this discrepancy and the resource limits. The ordinal guide states all 28 family/link combinations, discrimination checks, threshold support, and differences between QVR's identified-coordinate priors and the pinned brms defaults. These implementations do not establish full prior, response-modifier, or workflow parity.
The released registry also includes squareplus and softit links,
which the website's abbreviated link lists do not enumerate. QVR now
implements both with stable staged expressions; value and first/second
derivative tests include the origin and large finite predictors. Neither
the family count nor QVR's 17 inverse links establishes full coverage.
Links, thresholds, response modifiers, interactions, and the other
workflows in the table need separate acceptance tests against each pinned
baseline. Future audits should compare released and development sources
independently, retaining their commit identities and support status.
Skew-normal, shifted-lognormal, Fréchet, and GEV frontends distinguish
native location/scale parameters from response means, retain support and
moment domains in prediction, and state their GEV shape-prior policy.
tests/test_formula_shape_families.py checks those conversions, priors,
and predictions; tests/continuous/test_shape_families.py checks the
native numerical, derivative, and sampling contracts. All four support
native and checked-reference execution; all 11 external targets refuse
them explicitly. The native Truncated wrapper now uses deterministic
interval masses for independent scalar coordinates, while coupled events
without a joint rectangle-mass operation remain refused. Formula response
truncation and censoring use the same endpoint-aware event operation. Their
scalar-response contract does not imply a joint rectangle capability for coupled
vector events.
Discrete Weibull and zero-inflated asymmetric Laplace now have native
and checked-reference kernels, with independent source-density and
formula-prediction checks. Their 22 family/backend cells all refuse
external rendering explicitly. The formula-only negbinomial2 frontend
adds reciprocal dispersion to the existing negative-binomial law, with
a direct Gamma(0.4, 0.3) prior on sigma. Formula density, coefficient
gradient, SVI/HMC/NUTS, and new-data prediction checks are in
tests/test_formula_reparameterized_families.py. Discrete Weibull
expected responses retain explicit tail-certification and work limits;
its main transformed predictor is a probability rather than a mean.
Shared implementation paths¶
The consolidation audit checks both older repository implementations and additions on this branch. A new interface should extend the following paths before adding a second parser, compiler, fitting loop, or prediction collector.
| Concern | Shared implementation and preserved behavior |
|---|---|
| Static and runtime declarations | One ordered parameter telescope supplies source elaboration, typed schemas, specialization, and tooling. Display strings do not replace retained QIEC types. |
| Dependent dimensions | Family signatures collect equations into the existing exact Nat solver. Source and kernel checking share sample-carrier inference; the older independent event-offset and pure-result classifiers have been removed. Conflicting input uses retain both extents in their diagnostic. |
| Vector and ordinal regressions | Component layouts extend the existing categorical emitter. Scalar, auxiliary, category, and threshold effects use the same correlation blocks and posterior replay machinery. |
| Formula expressions | Cox and ordinary regression compilation import one set of AST builders. Fitting, source emission, and prior inspection share formula preparation, including subsets, trial validation, nonlinear leaves, and retained transform evaluators. Spline priors use the existing parsed auxiliary-prior path. |
| Nonlinear dependencies | The predictor graph uses the existing QVR expression parser, traversal, and checker. Additive leaves compile through the ordinary coefficient emitter; deterministic nodes introduce no second fitting or prediction loop. |
| Group coordinates | One immutable Gaussian group layout records scalar and component slices, scale sites, and correlation sites for compilation, prediction, and coefficient inspection. Coefficient inspection and hypotheses share vectorized reconstruction across retained sample axes. Correlated centered blocks reuse the indexed covariance emitter; the former scalar-only triangular emitter is removed. |
| Prior selection | One typed catalogue of emitted latent sites supplies selector resolution and prior inspection. Existing named overrides normalize into the same rules; regularized horseshoe and R2D2 blocks extend the same coefficient emitters and dependency order. |
| Expression substitution | All target renderers use the DSL capture-avoiding traversal, with explicit policies for opaque index bases and consumed loop axes. One affine-index adapter bridges renderer metadata; Boolean negation retains its checked operator across targets. |
| Renderer binding and shape analysis | Python, Julia, and BUGS/JAGS adapters share event-rank hints, scalar/bound-name classification, and static factor-axis lookup. Stan and WebPPL read morphism and alias tables through the canonical source indexes. Target-specific syntax and capability messages remain with each renderer. |
| Posterior moments | Covariance, correlation, regression variance ratios, and contrasts reuse retained samples and shared numeric validation, including original integer-capacity checks. Retained uncertainty and MCMC summaries share stable empirical reductions and type-7 quantiles, preserving the existing coordinate-wise NaN policy for nonfinite draws. Formula R² uses ordinary prediction preparation and native response moments, including the already existing unsigned Wiener variance. |
| Empirical uncertainty and region evidence | Retained uncertainty and contrast summaries share scaled location/dispersion arithmetic and quantile validation. One shared type-7 quantile kernel supplies convergence and contrast summaries. Region evidence reduces supplied draws without adding a parser, inference replay, density estimator, or posterior collector. |
| Prior projection | One lexical dependency projection retains requested latent sites, upstream hyperpriors, and authored potentials for both prior collection and conditional new-group draws. Observation scoring remains a separate policy. |
| Replay and observation scoring | A shared effect policy disables likelihood evaluation for prior-only inference and prediction placeholders. Raw likelihood extraction enables scoring explicitly. Prior draws reuse the existing registry geometry and posterior collectors. |
| Response carriers | Formula arrays derive Boolean, integer, or real carriers from the semantic family record. Response, trial-column, and response-role adapters share original-array integer validation and the count backends’ capacity bound. Shape and role checks remain with their adapters; prediction placeholders use the same carrier contract. |
| Hazard baselines | An immutable M-spline basis contracts into normalized Bernstein controls. Native and reference Cox adapters use the generic hazard law rather than separate density and sampling implementations. |
| Censored Beta laws | Affine coordinates retain both endpoint distances; censoring supplies the boundary atoms. Beta tails and the existing Dirichlet log-Gamma sampler are shared with the other probability laws. |
| Density and mass queries | LogDensity and LogMass use the same checked sampleable values and recursive raw constructors. Native total mass delegates to measure normalizers. A density at a selected point is not used as a mass surrogate. |
| Restrictions and mixtures | One endpoint-aware event operation handles atoms, nested restrictions, mixtures, and normalization. Formula prior bounds intersect target support through these normalized restrictions, including each conditional coefficient law in a hierarchy. Native Truncated scoring delegates to Normalize(Restrict) and the shared safe base scorer. Mixture sampling selects components by weighted raw mass; conditioning retains restricted components and normalizes their sum once. |
| Probability runtime helpers | Ordinary and canonical Python emitters compose the same target-specific source fragment before structural grafting. Generated modules remain standalone. JavaScript likewise composes its existing shared probability fragment. |
| Distribution axes | Independent(base, n) uses one strict count validator and one batch/event axis proof across checking, lowering, evaluation, and parameter packing. Full, partial, and zero reinterpretation preserve inherited batch axes, including equal extents and empty plates. |
| Refit workflows | Source and formula updates retain one fitting recipe. Cross-validation partitions original rows and declared neural row attachments through the existing prediction and raw-likelihood operations; it introduces no second optimizer, sampler, or response scorer. |
| Posterior storage | NetCDF restoration uses the existing DataTree converter and analysis record. Source and formula executable artifacts share safe tensor codecs, checked preparation, conditioned registry reconstruction, and explicit custom factories. Atomic output is shared with source migrations; MCMC resume checkpoints retain their distinct continuation semantics. |
| Custom laws | One compilation-local catalog supplies semantic checking, constructor names, native binding, cache identity, and wire contracts. Formula adapters supply existing predictor roles; they add no independent likelihood, inference loop, posterior collector, or ambient registration. |
| Source response analysis | Formula and source moments share response-law helpers. Likelihoods and moments share observation-occurrence selection; fresh formula likelihoods reuse existing prediction preparation and response-role binding. |
| Runtime graft indexing | Pyro and NumPyro parse and index composed runtime fragments through one loader, which indexes outgoing edges once before traversing helper subtrees. |
| Constructor schemas | MatrixNormal covariance and Cholesky inputs and multivariate Student scale alternatives share Gaussian geometry, checked schemas, and family signatures displayed by REPL, LSP, and notebook inspection. Covariances are factored before broadcast; supplied factors avoid repeated Cholesky work. Pure distribution values and draw syntax share one dependency-free schema catalog; the previous DSL import remains a compatibility adapter. Required and alternative argument sets are checked by the same rules. Nested prior constructors use the ordinary checked composition path, including bounds, rather than a second constructor grammar. |
| Count tails | Native scalar count laws and bare Torch count adapters use one log-tail dispatch. The scalar reference machine mirrors the retained recurrence; interval and recorded-event queries call those tails. |
| Batch reconstruction | Measures, registered laws, and bijectors select parameters through one batch-selection protocol. Intrinsic event dimensions remain intact, including shape-changing transformations. |
| Guide event layout | LatentSite.is_scalar uses the support event rank. All guide families retain singleton simplex and matrix axes; a one-component simplex allocates zero unconstrained coordinates. |
| Numerical specializations | Closed count laws preserve stable large-count scores and boundary derivatives. They remain numerical specializations of the same measures; replacing them with generic log-mixture arithmetic would lose tested endpoint derivatives. |
| Observed values | Lexical computed observations use the existing observation handler and latent registry. They add scores without allocating a second latent coordinate. |
| Editor vocabularies | One generator supplies Tree-sitter and TextMate family/builtin sets. LSP, REPL, and Pygments read the same runtime registries. |
The reference machine retains scalar standard-library arithmetic, while native kernels retain Torch arrays and automatic differentiation. Standalone emitted runtimes likewise require their host's array operations. These execution boundaries share semantic records and numerical recurrences where possible. Independent test oracles retain their own density, moment, and prediction calculations; reusing a production kernel as its own oracle would remove that check. These execution and verification boundaries are deliberate. Shared names alone do not establish agreement.
Open enhancement issues¶
The table covers every open enhancement returned by the repository issue listing on the audit date. It records requirements on the interface without asserting that the proposed executors or distributions have been implemented.
| Issue | Requirement on model and fitting interfaces |
|---|---|
| #232 | Preserve a checked entry independently of its tensor executor. The built-in methods refuse unsupported CheckedProgram fitting. Future tensor execution must guard changes in a run's site structure. |
| #333 | Retain typed carriers, ordered rules, contexts, substitutions, and parameter ownership. ModelSchema preserves QIEC type objects; a rendered type string is only a display. Rule presentations and their adapters remain separate work. |
| #334 | Keep computed structured inputs and results in QIEC. InferenceMethod[Result] returns the method's own type, avoiding an obligatory tensor or posterior-draw conversion. Providers and typed composition still need integration tests. |
| #335 | Keep sampling, scoring, enumeration, normalization, and semantic outcome aggregation as distinct capabilities. Binding retains live values and gradients; it does not claim structured distribution adapters or exact semantic marginalization. |
| #336 | A solver must check its algebraic laws, observer requirements, recursion contract, and resource limits. A generic run(bound) entry point supplies no exactness or termination guarantee. |
| #337 | Sparse finite-state data and lazy relations need typed provider-owned representations. The binding maps retain object identity, though current validation supports tensor and string inputs. Provider validators must be integrated before sparse structured inputs can be bound. |
| #338 | Preserve differentiable scores, topology ownership, and parameter identity. Path sums, decoding, expected statistics, and derivatives of a solver need separate result contracts and enumeration oracles. |
| #339 | Permit message results with explicit family, normalization scale, approximation status, schedule, and stopping reason. Such results can be returned by a method without pretending they are samples. |
| #340 | MAP results must identify their objective, assignment, primal and dual bounds, agreement, and certification conditions. A custom method's certificate is retained unchanged; this interface does not certify it. |
| #341 | EP methods need their projection direction, message family, penalty, damping, feature complexity, and local and outer convergence outcomes. Convergence of messages must not be reported as exact marginals. |
| #342 | Preserve the roadmap's separation of model implementation, executor capability, approximation, and experimental reproduction. The four proposed model deliverables need independent executable acceptance programs. |
Sequencing further work¶
- Finish typed structured binding, explicit executor capability checks, and regression artifacts with persistent design and group coding.
- Extend joint multivariate responses with
mi()missing-data plans and the remaining family interactions and response modifiers, each with numerical oracles. - Extend response selection through the shared exact-refit and artifact interfaces. Retained analysis archives preserve posterior tensors and labels; executable fitted artifacts additionally reconstruct retained design and group coding. New formula terms must extend that reconstruction contract rather than serialize live evaluators.
- Connect the structured executors as their issues land, retaining each solver's objective, approximation, termination, and differentiation contract.
The useful open questions are concrete: which observer must a structured result support, which dimensions may change at prediction time, and which cached objects remain valid after parameters change? Each answer should be expressed in a typed contract and tested before a new executor or formula term is advertised.