JAGS_formula_predictor_basis() uses the fitted parameter map and persisted formula design to construct the exact observation-level change in a fixed linear predictor for a supplied direction through fitted coefficient coordinates. The result is conditional on all coordinates outside that direction, including fitted random effects.

The accessor reports "affine" only when the stored metadata proves that the selected update is additive on the fitted predictor scale. Coordinates reused by formula expressions, coefficient multipliers, expression-point coefficients, or random-effect scale sources are reported as non-affine or unsupported so callers can retain a generic evaluator.

A logged intercept is additive in its own logarithm rather than in the fitted coordinate: the predictor adds log(new) - log(current) times the intercept's model column. Such a direction is reported as "affine" with coordinate = "log" when the intercept is the only moving coordinate, and the caller must form the update from the logarithms. Every other affine result carries coordinate = "identity". A direction that moves a logged intercept together with ordinary coefficients mixes the two coordinates and remains non-affine.

JAGS_formula_predictor_basis(fit, directions, posterior_samples = NULL)

Arguments

fit

fitted object created by JAGS_fit().

directions

a fully named numeric vector, or a numeric matrix with unique coefficient-coordinate column names. Matrix rows define separate posterior-row update directions.

posterior_samples

optional posterior sample matrix aligned with the rows of directions. It is required when a selected formula term has a parameter-valued multiply_by attribute that is not a scalar constant declared by the fitted design; when omitted, draws are obtained from fit. A declared constant is used in preference to a column of the draws.

Value

A BayesTools_formula_predictor_basis list with status, reason, formula parameter, selected coordinates, the coordinate the update is additive in ("identity" or "log"), and an S by N numeric basis. basis is present only when status is "affine".