Skip to main content

Crate gam_spec

Crate gam_spec 

Source

Structs§

GlmLikelihoodSpec
Explicit GLM likelihood specification: response/link spec plus scale semantics.
IllegalLikelihoodCell
Error returned when an illegal (ResponseFamily, InverseLink) cell is presented to LikelihoodSpec::try_new or surfaced during deserialization. Only the cells enumerated by LikelihoodSpec::kind are legal; every other product cell would silently mask a wrong response transformation (e.g. Poisson + Identity predicting μ = η, which can go negative).
InvalidLikelihoodScale
Failure to resolve family and scale metadata into one likelihood contract.
LatentCLogLogState
Fixed latent Gaussian scale for the exact marginal cloglog family.
LikelihoodSpec
Unified likelihood specification: response distribution + parameterized link.
LikelihoodSpecWire
Transparent serde shadow of LikelihoodSpec with the identical wire shape (response, link). All (de)serialization of LikelihoodSpec routes through this type so the legal-matrix check in TryFrom<LikelihoodSpecWire> runs on every load, closing the saved-bytes hole: an illegal (response, link) cell deserializes into a serde error instead of a silently-masked spec.
MixtureLinkSpec
User-facing configuration for a blended inverse link.
MixtureLinkState
Runtime blended-link state with precomputed softmax weights.
PositiveLikelihoodScale
Positive finite likelihood-scale scalar with its stable log coordinate.
ResponseDegeneracy
Degenerate-response detail produced by ResponseFamily::validate_response_degeneracy.
ResponseInferenceRefusal
Auto-inference refusal carrying the levels seen in the source column so the workflow error can echo them in its message.
ResponseSupportViolation
Domain-violation detail produced by ResponseFamily::validate_response_support.
SasLinkSpec
User-facing configuration for the continuous sinh-arcsinh inverse link.
SasLinkState
Runtime state shared by the two-parameter Sas and BetaLogistic links: an epsilon skew/asymmetry term plus a raw log-scale parameter (log_delta) and its derived positive companion (delta). The delta field’s meaning is link-specific — see its doc — so derivative kernels must consume log_delta, never delta.
StateBearingLinkInStandardSlot
Error returned when narrowing a wide LinkFunction into a StandardLink. Sas and BetaLogistic are state-bearing and have no legal Standard(_) representation; they must be routed through InverseLink::Sas / InverseLink::BetaLogistic.
UnsupportedLinkError
Error returned when an InverseLink cannot be paired with a particular response family because the link is structurally unsupported for that family. Carries the link name so call sites can produce a useful message without losing the offending variant.
WigglePenaltyConfig
Shared default for monotone wiggle/deviation blocks. Formula DSL defaults, workflow configs, and runtime deviation blocks should all derive from this type so reproducible presets do not drift across layers.

Enums§

CoefficientGroupPrior
Hyperprior placed on a coefficient group’s precision / log-precision.
FamilySpecKind
Legal-only enumeration of the (ResponseFamily, InverseLink) cells the engine recognises. LikelihoodSpec is the product type with ~40 nominal cells (8 response variants × 5 inverse-link variants), but only the cells listed here are honoured by the family math; the rest are silently masked by fallback arms. FamilySpecKind is the canonical projection used by naming, predicates, and dispatch.
InverseLink
Parameterized inverse-link selector used where mu/derivatives are evaluated.
LikelihoodScaleMetadata
How a likelihood’s scale parameter is handled by the fit/result contract.
LinkComponent
Supported inverse-link components for convex blended inverse links.
LinkFunction
Shared engine-level link selector for generalized models. This is the “wide” link descriptor: CLI parsing, formula DSL, and the projection from InverseLink::link_function() all live in this enum, so it carries every link kind the engine knows about — including the state-bearing Sas / BetaLogistic cases.
LogLikelihoodNormalization
Whether a stored log-likelihood includes response-only normalization constants.
ResolvedGammaScale
Gamma may be resolved from a shape directly or from a fixed dispersion phi = 1 / shape. Keeping the provenance avoids an eager reciprocal that can overflow even though log(shape) = -log(phi) remains representable.
ResolvedLikelihoodScale
Validated, family-aware likelihood-scale ownership.
ResponseColumnKind
Caller-supplied description of the response column’s source kind.
ResponseDegeneracyKind
Classifier for a ResponseDegeneracy. Each variant carries the family- specific evidence the caller needs to format a useful message without having to re-derive the diagnostic.
ResponseFamily
Pure response distribution selector — no link information.
ResponseInferenceRefusalReason
Reason ResponseFamily::infer_from_response refused to pick a default family. Kept as an enum so future policy extensions (e.g. “refuse on constant response” — currently a separate CLI-side check) can be added without breaking the call site’s match arms.
RhoPrior
Fixed prior family for smoothing parameters in joint HMC refinement.
StandardLink
Legal-only link descriptor for the state-less InverseLink::Standard cell.

Constants§

BINOMIAL_BINARY_TOL
Absolute tolerance for the exact-{0, 1} test that defines the scalar Bernoulli (Binomial) response support.
COUNT_INTEGER_TOL
Round tolerance for recognising an integer-valued (count) response.
GAUSSIAN_MIN_SAMPLE_SD
Minimum admissible sample standard deviation for a Gaussian response.

Functions§

inverse_link_diagnostic_name
inverse_link_to_binomial_spec
Resolve a binomial-flavoured LikelihoodSpec from an InverseLink.
is_valid_tweedie_power