Expand description
Conditional transformation model: estimate h(y|x) such that h(Y|x) ~ N(0,1).
Given a response variable y and covariates x with a pre-built covariate design operator, this family estimates a smooth monotone transformation h(y | x) mapping the conditional distribution of Y|x onto a standard normal.
The response-direction basis is [1, I_1(y), ..., I_K(y)], tensored with an
arbitrary covariate design operator. Column 0 is an unconstrained location
component b(x). The I-spline columns are shape components with squared
covariate-side coefficients, giving the SCOP representation
h(y, x) = b(x) + ε·(y−median_y) + Σ_k I_k(y) γ_k(x)^2 and
h'(y, x) = ε + Σ_k M_k(y) γ_k(x)^2. Monotonicity is structural:
the fixed derivative floor ε keeps the change-of-variables log-density
away from the log(0) singularity, while the non-negative M-spline basis
and squared covariate-side coefficients supply the learned shape.
The log-likelihood per observation is the finite-support normalized change-of-variables density for a standard normal target:
ℓ_i = -½ h_i² + log(h’_i) - log(Φ(h_U(x_i)) - Φ(h_L(x_i)))
where h_i = b(x_i) + ε·(y_i−median_y) + Σ_k I_k(y_i) γ_k(x_i)^2
and h'_i = ε + Σ_k M_k(y_i) γ_k(x_i)^2. The endpoint normalizer is
required because the I-spline response basis saturates at finite support
values rather than mapping onto the full real line.
Structs§
- Transformation
Normal Config - Transformation
Normal Family - Conditional transformation model mapping Y|x to N(0,1).
- Transformation
Normal FitResult - Result of
fit_transformation_normal. - Transformation
Warm Start - Optional warm-start for the transformation model: per-observation location and scale values from a prior mean/SD normalizer.
Enums§
- Transformation
Normal Error - Typed errors emitted by the transformation-normal family pipeline.
Constants§
- TRANSFORMATION_
MONOTONICITY_ EPS - Strict-feasibility margin for
h' > 0on the monotonicity grid. Used both by the fit-time fraction-to-boundary line search (so accepted β keepsh'(grid) ≥ EPS) and by the predict-time monotonicity check ininference::predict_input(which rejects predictions whose minimumh'on the response grid drops below this threshold). Keeping these in sync prevents the predict path from rejecting fits that the optimizer accepted as feasible — and vice versa. - TRANSFORMATION_
NORMAL_ H_ ABS_ MAX - Absolute bound for feasible transformation scores on the standard-normal
scale. The CTN likelihood targets
h(Y|x) ~ N(0,1); accepting exact-Newton iterates with finite positiveh'but astronomical|h|lets curvature diagnostics overflow into meaningless values. This is a numerical runaway guard, not a statistical plausibility filter: startup seeds can temporarily land outside practically observable normal quantiles before the line search moves them back into the likelihood’s high-density region.
Functions§
- build_
tensor_ psi_ derivatives - Build
CustomFamilyBlockPsiDerivativeobjects for the tensor product. - effective_
response_ num_ internal_ knots - fit_
transformation_ normal - Fit a conditional transformation model with N-block spatial length-scale optimization over the covariate side.
- transformation_
normal_ pit_ score