Expand description
Spline / spatial / spherical basis construction, penalties, and the
hyperparameter (ψ) derivative machinery that the smooth terms build on.
The module is decomposed into single-concern submodules. Shared crate
imports live in prelude.rs and are pulled into this module’s
namespace; every submodule re-imports them (together with the sibling
re-exports below) through use super::*. The pub use <module>::*
re-exports flatten each concern back onto the basis:: path so external
callers keep referring to e.g. basis::CenterStrategy regardless of which
submodule now owns the item.
Re-exports§
pub use closed_form_operator::ClosedFormPenaltyOperator;
Modules§
- closed_
form_ operator - Operator form of the closed-form Duchon penalty.
- closed_
form_ penalty - Closed-form scalar building blocks for Riesz, Matérn, and isotropic hybrid Duchon kernels.
- input_
loc_ derivatives - Input-location derivatives of basis design columns.
- matern_
gradient - Streaming closed-form gradients for Matérn radial basis values.
- radial_
profile - Certified 1-D Chebyshev profile of the radial design scalars
(φ, q, t). - sphere_
gpu - GPU NVRTC Wahba intrinsic-S2 kernel matrix construction.
Structs§
- Aniso
Basis PsiDerivatives - Per-axis psi_a derivative package for anisotropic spatial terms.
- Aniso
Penalty Cross Provider - AutoB
Spline Knots - Result of auto-deriving a clamped B-spline knot vector from 1-D data.
- BSpline
Basis Spec - 1D B-spline basis configuration.
- BSpline
Boundary Conditions - Left/right pair of B-spline endpoint constraints.
- Basis
Build Result - Standardized basis build result for engine-level composition.
- Basis
Options - Options for basis generation, controlling derivative order.
- Basis
PsiDerivative Bundle - Basis
PsiDerivative Result - Basis
PsiSecond Derivative Result - Basis
Workspace - Explicit per-run workspace for reusable basis-construction caches.
- Bspline
Derivative Workspace - Reusable scratch arena for the shared B-spline higher-derivative recurrence.
- Canonical
Penalty Block - Collocation
Operator Matrices - Constant
Curvature Basis Spec - Constant-curvature smooth configuration (
curv(x, z, kappa = …)). - Cubic
Regression Basis - Precomputed natural cubic regression spline geometry for a fixed knot set.
- Dense
- Marker type for dense basis matrix output.
- Duchon
Basis Spec - Duchon-like basis configuration with explicit low-frequency null-space control and explicit spectral power.
- Duchon
Operator Penalty Matrices - Duchon
Operator Penalty Spec - Duchon
Partial Fraction Coeffs - Implicit
Design PsiDerivative - Implicit representation of ∂X/∂ψ_d that supports matrix-vector products without materializing the full (n x p) derivative matrices.
- Joint
Null Rotation - Joint-null absorption rotation, attached to a smooth’s basis when the
basis’s joint penalty
Σ_k S_khas a non-trivial null space. - Kronecker
Factored Basis - Factored tensor-product basis metadata for operator-backed downstream use.
- LIndex
- A single requested derivative direction in
L-space: the lower-triangular entry(i, j)withi >= j. The zeroth-order “direction” (the value itself) is handled separately; this names the active first-order channels. - Latent
Coord Design Derivative - Streaming design derivative for one per-row latent coordinate
t[n, a]. - Matern
Basis Spec - Matérn basis configuration.
- Matern
Spline Basis - Matérn radial basis and penalties.
- Measure
JetAnisotropy Jets - The anisotropic energy together with its exact first and second jets with
respect to the lower-triangular Cholesky factor entries of
L. - Measure
JetBand - Realized geometric scale band:
epsascending,log_stepthe constant log-spacingln(eps[ℓ+1]/eps[ℓ])used as the Mellin quadrature weight. - Measure
JetBasis Spec - Measure-jet smooth configuration (
mjs(x0, …, xd)). - Measure
JetEnergy Jets - The energy and its exact hyperparameter jets in the live dials.
sandαenter only through per-block log-weights. The retainedln τslots are zero because the local fit is the exact weighted affine projection and no longer depends on τ. All forms are scattered from the SAME local residual blocks, and the ψ-channel consumes them with zero design drift. - Measure
JetFrozen Quadrature - Fit-time quadrature of the empirical measure (center masses + realized scale band), frozen onto the spec so predict-time rebuilds replay the exact fit-time penalty. Recomputing either from predict rows would silently change the penalty the coefficients were estimated under.
- Measure
JetJet Stats - The local jet-fit sufficient statistics read off one table — exactly the
per-block quantities
assemble_weighted_forms(measure_jet_smooth.rs) computes from raw points when the table weights are frozen at the same center and scale, reproduced in closed form from stored moments. - Measure
JetMoment Table - Per-cell moment table: Gaussian-weighted coordinate moments of orders
0..=2 crossed with response channels, all centered at the cell’s
reference point
c. - Penalty
Candidate - Penalty
Info - PeriodicB
Spline Basis Spec - Configuration for a dense one-dimensional periodic B-spline basis.
- Periodic
Spline Curve - Fitted vector-valued periodic spline curve.
- Sparse
- Marker type for sparse basis matrix output.
- Spatial
Basis Plan - Resource-aware plan for a spatial smooth (Duchon / Matérn / TPS).
- Spherical
Spline Basis Spec - Intrinsic S² (sphere) smooth configuration.
- Spline
Scratch - Scratch memory for B-spline evaluation to avoid allocations in tight loops.
- Thin
Plate Basis Spec - Thin-plate basis configuration.
- Thin
Plate Penalty Matrix - Thin
Plate Spline Basis - Thin-plate regression spline basis and penalty (order m=2).
Enums§
- Aniso
Seed Mode - How the Matérn forward design build interprets an exactly all-zero
aniso_log_scalesvector. - BSpline
Endpoint Boundary Condition - Per-endpoint boundary constraint policy for B-spline 1D bases.
- BSpline
Identifiability - Per-smooth identifiability policy for 1D B-spline bases.
- BSpline
Knot Placement - Internal-knot placement strategy when knots are automatically inferred.
- BSpline
Knot Spec - Which knot strategy to use for 1D B-spline bases.
- Basis
Error - Re-export of the neutral basis-error contract. #1521:
BasisErrorlives ingam-problemsoEstimationErrorcan wrap it (#[from]) without a back-edge; gam-terms re-exports it to preservegam_terms::basis::BasisError. A comprehensive error type for all operations within the basis module. - Basis
Eval Kind - Basis
Family - Basis-family selector for 1D spline evaluation.
- Basis
Metadata - Metadata returned by generic basis builders.
- Basis
Storage Layout - Storage layout discriminant for
BasisOutputFormatimpls. Encoded as an enum rather than a bool so the type-level distinction reads as “Dense vs Sparse” at call sites instead of a polarity-sensitive flag. - Center
Count Request - How
plan_spatial_basisshould pick the spatial center count. - Center
Strategy - Spatial center selection strategy.
- Center
Strategy Kind - Constant
Curvature Identifiability - Realized-design identifiability policy for the constant-curvature smooth.
Mirrors
super::SphericalSplineIdentifiability(#532): the fit-time center-space sum-to-zerozgets the parametric orthogonalization composed onto it by the global identifiability pipeline, and the composed transform is frozen here so predict-time (and future per-ψ-trial) rebuilds replay it verbatim instead of recomputingzfrom the centers. - Duchon
Nullspace Order - Duchon null-space polynomial degree.
- Knot
Source - Specifies the source of knots for basis generation.
- Matern
Identifiability - Per-smooth identifiability policy for Matérn kernel coefficients.
- Matern
Nu - Matérn smoothness parameter
nu(half-integer variants with closed forms). - Measure
JetExtrapolation Spectrum - Measure
JetIdentifiability - Realized-design identifiability policy for the measure-jet smooth.
Mirrors
super::ConstantCurvatureIdentifiability(#532): the fit-time center-space sum-to-zerozgets the parametric orthogonalization composed onto it by the global identifiability pipeline, and the composed transform is frozen so predict-time (and per-ψ-trial) rebuilds replay it verbatim instead of recomputingzfrom the centers. - OneDimensional
Boundary - Boundary-condition policy for one-dimensional smooth bases.
- Operator
Penalty Spec - Penalty
Drop Reason - Penalty
Source - Radial
Scalar Kind - Which radial kernel family is being used. Stored in the streaming operator so that (q, t) scalars can be recomputed on the fly without a closure.
- Spatial
Identifiability - Per-smooth identifiability policy for spatial (TPS / Duchon) bases.
- Spatial
Storage Mode - Storage mode recommended by
plan_spatial_basis. - Sphere
Method - Which intrinsic S² smooth construction to use.
- Sphere
Wahba Kernel - Which reproducing kernel to use for
SphereMethod::Wahba. - Spherical
Spline Identifiability - Realized-design identifiability policy for the Wahba spherical spline (#532).
Traits§
- Basis
Output - Trait for selecting basis storage format at compile time.
- Basis
Output Format - Trait for building basis matrices with different storage formats.
This is an implementation detail for the unified
create_basisfunction. - Local
Design Jacobian Provider - The complete contract a per-row latent / novel-manifold coordinate type must supply to participate in the REML design-derivative operator surface.
Functions§
- accumulate_
moment_ table - Accumulate one cell’s moment table from raw rows. The single point where data rows are read; everything downstream is closed-form algebra on the result.
- analyze_
penalty_ block - analyze_
penalty_ block_ with_ op - apply_
linear_ extension_ from_ first_ derivative - Applies first-order linear extension outside a knot-domain interval to a basis matrix that was evaluated at clamped coordinates.
- apply_
sum_ to_ zero_ constraint - Applies a sum-to-zero constraint to a basis matrix for model identifiability.
- apply_
sum_ to_ zero_ constraint_ sparse - Build a sum-to-zero reparametrization for a sparse basis.
- applyweighted_
orthogonality_ constraint - Reparameterizes a basis matrix so its columns are orthogonal (with optional weights) to a supplied constraint matrix.
- assert_
no_ dense_ derivative_ materialization - assert_
spatial_ centers_ below_ large_ scale_ cap - auto_
centers_ 1d_ equal_ mass - Place
num_centersDuchon centers on 1-D data via the equal-mass strategy. - auto_
knot_ vector_ 1d_ quantile - Build a clamped B-spline full knot vector from 1-D data.
- auto_
spatial_ center_ strategy - auto_
streaming_ chunk_ size_ for_ dense - Auto-derive a streaming row chunk size for dense basis evaluation.
- bspline_
tensor_ first_ derivative - Tensor-product 1-D-B-spline first-derivative jet
∂Φ/∂tper row. - build_
bspline_ basis_ 1d - Generic 1D B-spline builder returning design + penalty list.
- build_
constant_ curvature_ basis - Build the constant-curvature reproducing-kernel smooth: realized design
K_κ(data, centers)·z, RKHS penaltyzᵀ K_κ(centers, centers) z, and the replayableBasisMetadata::ConstantCurvature. Structure mirrors the Wahba S² builder (build_spherical_spline_basis); geometry comes fromConstantCurvatureat the spec’s fixed κ. - build_
constant_ curvature_ basis_ kappa_ derivatives - κ-derivative bundle for the constant-curvature smooth — the ψ-channel hook that lets κ join the outer LAML/REML optimization as one signed, design-moving coordinate (#944 stage 3 final wiring).
- build_
cubic_ regression_ basis_ 1d - Build a natural cubic regression spline (mgcv
bs="cr"/"cs", #1074) basis from a fixed Lancaster–Salkauskas knot set. - build_
duchon_ basis - Generic Duchon builder returning design + penalty list.
- build_
duchon_ basis_ design_ and_ jets - Forward design, input-location first jet, and input-location second jet
(Hessian) of the general Duchon basis — the same matrix
build_duchon_basis/build_duchon_basis_mixed_periodicity_autoproduce for the resolved spec, differentiated exactly. - build_
duchon_ basis_ log_ kappa_ derivative - build_
duchon_ basis_ log_ kappa_ derivatives - build_
duchon_ basis_ log_ kappa_ derivativeswith_ collocationwithworkspace - build_
duchon_ basis_ log_ kappa_ derivativeswithworkspace - build_
duchon_ basis_ log_ kappa_ derivativewithworkspace - build_
duchon_ basis_ log_ kappasecond_ derivative - build_
duchon_ basis_ log_ kappasecond_ derivativewithworkspace - build_
duchon_ basis_ mixed_ periodicity_ auto - Public driver for the mixed-periodicity Duchon basis: derives per-axis
(left_j, period_j)from the supplied centers (mirroring how the 1D periodic path infers the period from min/max), then dispatches into [build_duchon_basis_mixed_periodicity]. - build_
duchon_ basiswithworkspace - build_
duchon_ collocation_ operator_ matrices - build_
duchon_ collocation_ operator_ matriceswithworkspace - build_
duchon_ native_ penalty_ psi_ derivatives - build_
duchon_ operator_ penalty_ matrices - build_
duchon_ operator_ penalty_ psi_ derivatives - build_
matern_ basis - build_
matern_ basis_ literal_ aniso - Public forward Matérn design that honors an explicit all-zero
aniso_log_scalesliterally as the isotropic metric, rather than the κ-optimizer’s geometry-seeding sentinel. This is what the publicmatern_basisFFI evaluates, so a caller’s explicit isotropic request is not silently hijacked into a data-driven anisotropic kernel (#1042). For every internal/fit build, usebuild_matern_basis(auto-seed). - build_
matern_ basis_ log_ kappa_ aniso_ derivatives - Build per-axis ψ_a derivatives for anisotropic Matérn terms, including both design-matrix and penalty derivatives.
- build_
matern_ basis_ log_ kappa_ derivative - build_
matern_ basis_ log_ kappa_ derivatives - build_
matern_ basis_ log_ kappa_ derivativeswithworkspace - build_
matern_ basis_ log_ kappa_ derivativewithworkspace - build_
matern_ basis_ log_ kappasecond_ derivative - build_
matern_ basis_ log_ kappasecond_ derivativewithworkspace - build_
matern_ basiswithworkspace - build_
matern_ collocation_ operator_ matrices - build_
matern_ operator_ penalty_ psi_ derivatives - build_
measure_ jet_ basis - Build the measure-jet smooth: Gaussian representer design
K(data, centers)·z, multiscale jet-residual penalty (one candidate per scale in spectral mode, one fused candidate in pinned-order mode), and the replayableBasisMetadata::MeasureJet. The geometry comes from the empirical measure (centers + masses + band) through the shared realization helper — the same source the ψ-derivative producer uses. - build_
measure_ jet_ basis_ psi_ derivatives - Exact ψ-jets of the REALIZED measure-jet penalty candidates, adapted to the anisotropic group-ψ carrier the spatial optimizer consumes.
- build_
nullspace_ shrinkage_ penalty - Build the double-penalty ridge from the structural null space of a PSD penalty.
- build_
periodic_ bspline_ basis_ 1d - Build a dense periodic cardinal B-spline design for one circular parameter.
- build_
spherical_ spline_ basis - build_
thin_ plate_ basis - Generic thin-plate builder returning design + penalty list.
- build_
thin_ plate_ basis_ log_ kappa_ derivative - build_
thin_ plate_ basis_ log_ kappa_ derivatives - build_
thin_ plate_ basis_ log_ kappa_ derivativeswithworkspace - build_
thin_ plate_ basis_ log_ kappa_ derivativewithworkspace - build_
thin_ plate_ basis_ log_ kappasecond_ derivative - build_
thin_ plate_ basis_ log_ kappasecond_ derivativewithworkspace - build_
thin_ plate_ basiswithworkspace - build_
thin_ plate_ penalty_ matrix - build_
thin_ plate_ penalty_ psi_ derivativeswithworkspace - center_
strategy_ is_ auto - center_
strategy_ kind - center_
strategy_ num_ centers - center_
strategy_ with_ num_ centers - clamped_
knot_ vector_ from_ internal_ positions - Build a clamped full B-spline knot vector from explicit internal knot
positions (mgcv
knots=semantics). - closed_
form_ aniso_ psi_ derivatives_ in_ total_ basis - Closed-form anisotropic penalty
S_qand its raw-η derivatives — full d×d Hessian materialized — in the final (post-transform) basis space. Returns(S_q, S_q_eta_a per axis, S_q_eta_a_a per axis, S_q_eta_a_b for (a, b) with a < b). All derivatives are with respect to raw η components directly per math team Letter A §9 — no centering, no apply_raw_psi_scaling. - closed_
form_ anisotropic_ pair_ block - closed_
form_ anisotropic_ pair_ block_ pure - Pure-Duchon (κ=0) variant of
closed_form_anisotropic_pair_block. - closed_
form_ matern_ pair_ block - Closed-form pair-block penalty for the pure Matérn basis at operator order
q ∈ {0, 1, 2}. - closed_
form_ operator_ penalty_ in_ total_ basis - closed_
form_ operator_ penalty_ in_ total_ basis_ pure - Pure-Duchon (κ=0 /
length_scale = None) counterpart ofclosed_form_operator_penalty_in_total_basis. Usesclosed_form_anisotropic_pair_block_pureto evaluate the closed-form penalty via analytic radial derivatives of the pure-Riesz kernel, which is finite for R > 0 in any (m, s, d, q) regime whereradial_derivatives_of_isotropic_duchonis defined. Self-pair (R=0) regularization is handled inside the pair-block routine. - closed_
form_ psi_ derivatives_ in_ total_ basis - Closed-form penalty value
S_qand its log-κ derivativesS_q_psi,S_q_psi_psiin the final (post-transform) basis space, computed viapair_block_radial_with_j_second_derivativesfrom the closed_form_penalty module. Bundle’sd_kappaandd2_kappaare κ-derivatives; chain rule converts to log-κ:∂/∂ψ = κ·∂/∂κ,∂²/∂ψ² = κ²·∂²/∂κ² + κ·∂/∂κ. - compute_
geometric_ constraint_ transform - Compute the constraint transform Z using Greville abscissae (geometric constraints).
- compute_
greville_ abscissae - Compute Greville abscissae for a B-spline basis.
- compute_
joint_ null_ rotation - conservative_
secondary_ centers - Conservative center count for a secondary (distributional) predictor’s spatial smooth — e.g. the log-σ scale model in a Gaussian location-scale fit.
- constant_
curvature_ effective_ length - Effective kernel length
L(κ)and its EXACT κ-jet(L, L′, L″). - constant_
curvature_ honest_ profiled_ reml_ score - #1464: the honest fixed-κ profiled-REML score
V_p(κ)for a constant-curvature smooth — the textbook Gaussian profiled-REML negative-log-evidence of the realized designB = K_κ(data,centers)·zagainsty, with the unpenalized intercept appended and the raw RKHS Gram penaltySprofiled over λ (profiled_reml_with_intercept). This is the criterion whose argmin over the chart-bounded κ window IDENTIFIES the curvature, and the onecurvature_inference_forspecwalks for the magnitude CI and the κ = 0 flatness LR test. - constant_
curvature_ kappa_ fair_ sign_ score - constant_
curvature_ kernel_ kappa_ jets (K, ∂K/∂κ, ∂²K/∂κ²)of the raw (pre-constraint) kernel matrix — the ψ-channel hook. Exact: ridesdistance_kappa_jet(Tower4, FD-gated ingeometry::constant_curvature) through the chain rule forK = exp(−d/ℓ)at κ-FIXED ℓ and centers (see the module κ-contract):- constant_
curvature_ kernel_ matrix K_κ(data, centers)— the geodesic-exponential kernel matrixexp(−d_κ(x_i, c_j)/ℓ).- create_
basis - Unified B-spline basis generation with configurable storage, knot source, and options.
- create_
closure_ difference_ penalty_ jet - The closure-aware difference penalty
S(γ) = S_open + c(γ)·S_wrapand its first/second γ-derivatives, whereS_wrap = S_circle − S_openis the seam-closing contribution andc(γ)is the boundary-conductance interpolant (c(0)=0,c(1)=1). Atγ = 1this is exactly the cyclic penalty; atγ = 0it is exactly the open penalty. Returns(S, ∂S/∂γ, ∂²S/∂γ²). - create_
cyclic_ difference_ penalty_ matrix - Creates a cyclic finite-difference penalty
S = D' D. - create_
difference_ penalty_ matrix - Creates a penalty matrix
Sfor a B-spline basis from a difference matrixD. The penalty is of the formS = D' * D, penalizing the squaredorder-th differences of the spline coefficients. This is the core of P-splines. - create_
duchon_ basis_ 1d_ derivative_ dense - create_
ispline_ derivative_ dense - Compute the k-th derivative of an I-spline basis as a dense matrix.
- create_
matern_ spline_ basiswithworkspace - Creates a Matérn spline basis from data and centers.
- create_
open_ difference_ penalty_ matrix - Creates the OPEN (non-wrapping) finite-difference penalty
S = D'Dover the same coefficient ring, but with the difference stencils truncated at the endpoints instead of closed across the seam. - create_
thin_ plate_ spline_ basis - Creates a thin-plate regression spline basis from data and knot locations.
- create_
thin_ plate_ spline_ basis_ with_ knot_ count - High-level TPS constructor: selects knots from data, then builds basis+penalty.
- create_
thin_ plate_ spline_ basis_ with_ knot_ count_ andworkspace - create_
thin_ plate_ spline_ basiswithworkspace - default_
num_ centers - Adaptive default center count for spatial smooths (TPS, Duchon, Matérn).
- default_
spatial_ center_ strategy - default_
spherical_ harmonic_ degree - Default L for the harmonic basis when the user does not set
max_degree. Targets ~k = 50 columns (mgcvsosdefault) for sample sizes large enough to support that many parameters, scaling down toward L=2 for small n (target ≈ n/4 columns), and capped at L=12 (168 cols) at the upper end. - duchon_
cubic_ default - The magic request-layer default
(nullspace_order, power)for a non-periodic Euclidean Duchon basis of dimensiond: the cubic polyharmonic kernel in every dimension. - duchon_
max_ active_ operator_ derivative_ order - Returns the maximum derivative order required by the active operator
penalties: 2 if stiffness is Active, else 1 if tension is Active, else 0.
Mass-only (or no active operator) penalties only require kernel validity
(
2(p+s) > d), tension requires D1 collocation (2(p+s) > d+1), and stiffness requires D2 collocation (2(p+s) > d+2). - duchon_
nullspace_ dimension - duchon_
penalties_ at_ length_ scale - Rebuild the Duchon penalty list at a NEW
length_scalepurely from FROZEN basis geometry — no data rows touched (#1033, n-free per-ψ penalty re-key). - duchon_
polynomial_ first_ derivative_ nd - N-D Duchon polynomial-nullspace first derivative
∂P/∂tper row. - duchon_
power_ to_ usize - Convert a Duchon spectral-power
f64into the integer view used by the closed-form code paths. Non-finite, negative, or fractional values clamp to0so the validator downstream emits the canonical error. - duchon_
pure_ kernel_ amplification - Scalar kernel amplification
αthatbuild_duchon_basisapplies to the pure scale-free polyharmonic Duchon kernel block (length_scale = None,power = 0, no anisotropy) for the given requested null-spaceorder. - duchon_
radial_ first_ derivative_ nd - N-D Duchon radial first-derivative
φ'(r)evaluated for every(row, center)pair. - duchon_
radial_ second_ derivative_ nd - N-D Duchon radial second derivative
φ''(r)evaluated for every(row, center)pair. - duchon_
radial_ third_ derivative_ nd - N-D Duchon radial third derivative
φ'''(r)evaluated for every(row, center)pair. - duchon_
sae_ atom_ basis_ with_ jet - Forward design and input-location first jet of the scale-free Duchon atom
used by the SAE-manifold path, recomputed self-consistently at arbitrary
latent coordinates
t. - duchon_
sae_ atom_ penalty - Reproducing-norm smoothness penalty for the scale-free Duchon SAE atom,
consistent column-for-column with
duchon_sae_atom_basis_with_jet. - duchon_
sae_ atom_ second_ jet - Second input-location jet of the scale-free Duchon SAE atom (the analytic
Hessian
∂²Φ / ∂t_a ∂t_c), consistent withduchon_sae_atom_basis_with_jetcolumn-for-column andα-for-α. - duchon_
sae_ atom_ third_ jet - Third input-location jet of the scale-free Duchon SAE atom (the analytic
∂³Φ / ∂t_a ∂t_c ∂t_e), consistent withduchon_sae_atom_basis_with_jetandduchon_sae_atom_second_jetcolumn-for-column andα-for-α. - estimate_
penalty_ nullity - evaluate_
bspline_ basis_ scalar - Evaluates B-spline basis functions at a single scalar point
xinto a provided buffer. - evaluate_
bspline_ derivative_ scalar - Evaluates B-spline basis derivatives at a single scalar point
xinto a provided buffer. - evaluate_
bspline_ derivative_ scalar_ into - Zero-allocation version: pass pre-allocated buffers for lower_basis and scratch.
- evaluate_
bspline_ fourth_ derivative_ scalar - Evaluates B-spline fourth derivatives at a single scalar point
xintoout. - evaluate_
bsplinesecond_ derivative_ scalar - Evaluates B-spline second derivatives at a single scalar point
xintoout. - evaluate_
bsplinethird_ derivative_ scalar - Evaluates B-spline third derivatives at a single scalar point
xintoout. - evaluate_
ispline_ scalar - evaluate_
ispline_ scalarwith_ scratch - Evaluates I-spline basis functions at a scalar point
xinto a provided buffer. - evaluate_
mspline_ scalar - Evaluates M-spline basis functions at a scalar point
xinto a provided buffer. - expand_
periodic_ centers - filter_
active_ penalty_ candidates - filter_
active_ penalty_ candidates_ with_ ops - Same filtering pass as
filter_active_penalty_candidatesbut also returns the per-active-penalty operator handles and null-space bases. - fit_
periodic_ bspline_ curve - Fit a vector-valued 1D periodic spline curve by penalized least squares.
- initial_
aniso_ contrasts - Compute initial anisotropy contrasts η_a from knot center geometry.
- initializewiggle_
knots_ from_ seed - Generate a B-spline knot vector spanning a 1-D seed sample.
- jet_
sufficient_ stats - Read the local jet-fit sufficient statistics off a moment table at scale
eps, for value channelchannel. - knot_
cloud_ axis_ scales - Compute per-axis standard deviations of knot center coordinates.
- lower_
triangular_ indices - Enumerate the active lower-triangular entries of a
d×dfactor in column-major order (columnj, rowsj..d). This is the canonical order every output of this module uses for itsL-derivative channels. - matern_
input_ location_ hessian_ nd - N-D Matérn input-location Hessian
∂²Φ/∂t∂tᵀunder the anisotropic metric. - matern_
input_ location_ jet_ nd - N-D Matérn input-location jet
∂Φ/∂tunder the anisotropic metric. - matern_
radial_ first_ derivative_ nd - N-D Matérn radial first-derivative
φ'(r)evaluated for every(row, center)pair. - matern_
radial_ second_ derivative_ nd - N-D Matérn radial second derivative
φ''(r)evaluated for every(row, center)pair. - measure_
jet_ anisotropy_ energy_ form - The det-normalized anisotropic measure-jet energy form
Qfor the metricA = L Lᵀ. WithL = Ithis returns the isotropicsuper::measure_jet_energy_formbit-for-bit. - measure_
jet_ anisotropy_ energy_ form_ with_ jets - The det-normalized anisotropic energy together with its EXACT first and
second derivatives with respect to the lower-triangular Cholesky factor
entries of
L. Value and jets come from one block walk so they cannot drift apart. - measure_
jet_ band - Build the realized geometric scale band from the center set: floor at the
median nearest-center spacing (below it the quadrature resolves nothing),
ceiling at half the bounding-box diagonal (a deterministic diameter-scale
cap; local fits remain center-weighted and distinct there).
num_scales == 0requests the auto countclamp(⌈log2(ε_max/ε_min)⌉ + 1, 3, 8); a degenerate band (ceiling ≤ floor) collapses to the single floor scale withlog_step = ln 2. - measure_
jet_ center_ masses - Per-center masses of the empirical measure (the zeroth-moment half of
measure_jet_quadrature_nodes; single assignment source). - measure_
jet_ design_ matrix - Gaussian representer features
exp(−‖x − c‖²/(2ℓ²))(n × m). - measure_
jet_ energy_ form - The multiscale jet-residual energy
Q(m × m, symmetric PSD) on the center set. See the module docs for the formula and contracts; the local residual form is assembled through the closed-form identities - measure_
jet_ energy_ form_ with_ jets - The energy together with its exact first and second jets in the live
dials, plus zero slots for the retained
ψ_τ = ln τcoordinate. Withg_s = −2 ln ε,g_α = −2 ln q: - measure_
jet_ energy_ forms_ per_ scale - The per-scale energy forms
Q_ℓ(each m × m, symmetric PSD), withΣ_ℓ Q_ℓ = Qexactly (same blocks, one-hot weights). These are the spectral-split carriers: emitted as separate penalty candidates they let the multi-penalty REML engine learn per-level amplitudes λ_ℓ directly — scale adaptivity at ρ-speed with no rebuild and no new optimizer code. - measure_
jet_ extrapolation_ variance - Frame-note §5: closed-form extrapolation variance at a query — the price of
ignorance off the web, read from the fitted spectrum.
ε★= the first covering scale (smallest band scale at which the query’s kernel mass clearscoverage_floor×q̄_ℓ); levels finer thanε★contribute their full prior varianceλ̂_ℓ⁻¹, levels fromε★up contribute the uncovered fraction(1 − a_ℓ(x★)) · λ̂_ℓ⁻¹witha_ℓ(x★) = min(q_ℓ(x★)/q̄_ℓ, 1)the smooth on-web-ness weight. Equivalently (see the module docs) the total prior ignoranceΣ_ℓ λ̂_ℓ⁻¹minus the §5 coverage-recovered sumΣ_{ℓ: ε_ℓ ≥ ε★} a_ℓ(x★)/λ̂_ℓ. On-web queries (ε★ = ε_0, a ≈ 1) pay ≈ 0 extra; queries never covered by the band payΣ_ℓ λ̂_ℓ⁻¹exactly — intervals widen monotonically with distance (theorem in the module docs). - measure_
jet_ multiscale_ mode - Whether a measure-jet spec runs in multiscale mode (per-scale spectral
penalties +
(α, ln τ)ψ dials + the affine-preserving ridge). The single source of truth for the mode decision, shared by the builder and the outer-engine enrollment predicates so the penalty count and the ψ-dimension cannot disagree. Multiscale is an explicit opt-in (spec.multiscale); there is no center-count auto-gate (#1116). - measure_
jet_ quadrature_ nodes - First-moment-exact quadrature of the empirical measure on the cell partition induced by the seed centers: nearest-center assignment (deterministic tie-break: lowest center index) yields per-cell masses, and each non-empty cell’s quadrature node is its mass-weighted barycenter. Empty cells keep their seed coordinates with zero mass (the assembly skips them; their representer columns remain valid).
- measure_
jet_ scale_ spectrum - Per-scale energy decomposition of center values
v: element ℓ isvᵀ Q_ℓ v, the detail energy charged at scaleε_ℓ. Sums exactly tovᵀQv(same blocks, one-hot weights) and doubles as the scale spectrum diagnostic of the fitted intensity field — where along the band the signal lives, and the analytic carrier of∂/∂sreweightings. - measure_
jet_ support_ curve - The support diagnostic
ε ↦ q_ε(x★): kernel mass of the (frozen) center quadrature seen from each query point at every band scale (n_query × L). A query ON the web sees its strand’s mass already at fine scales; a query OFF the web accumulates mass only once ε reaches its distance to the support. This is the on-web-ness statistic shipped alongside predictions — smooth, multiresolution, derived from the measure with no neighbor sets. - merge_
moment_ tables - Monoid merge: recenter compatible frozen-weight tables onto a common reference, then add componentwise. Exact for those polynomial moments (pure binomial shift, no kernel re-evaluation) and deterministic.
- minimum_
duchon_ power_ for_ operator_ penalties - monomial_
exponents - operator_
penalty_ candidates_ closed_ form - operator_
penalty_ candidates_ closed_ form_ pure - Pure-Duchon (κ=0 /
length_scale = None) counterpart ofoperator_penalty_candidates_closed_form. - orthogonality_
transform_ for_ design - penalty_
greville_ abscissae_ for_ knots - Selects Greville abscissae for difference-penalty scaling.
- periodic_
bspline_ first_ derivative_ nd - N-D periodic-cyclic-B-spline first-derivative jet
∂Φ̃/∂tper row. - plan_
spatial_ basis - Build a resource-aware plan for a spatial smooth basis.
- pseudo_
s2_ truncated_ coefficients - Build the truncated pseudo-spline coefficient array
c_0 = 0,c_ℓ = 2 / (4π · Π_{k=1..m+1}(ℓ + k))forℓ = 1..=lmax. - radial_
input_ location_ jet_ nd - Per-
(row, center)input-location jet of a radial kernel from its scalar first derivativeφ'(r). - realized_
constant_ curvature_ length_ scale - Resolve the realized kernel range ℓ. An explicit positive
spec_length_scaleis used verbatim; the0.0sentinel auto-initializes from the median pairwise CHART distance among the centers, doubled to match the κ = 0 chart gauge (d_0 = 2‖Δ‖). - realized_
measure_ jet_ length_ scale - Resolve the realized representer range ℓ. An explicit positive
spec_length_scaleis used verbatim; the0.0sentinel auto-initializes from the median nearest-center spacing (one spacing width: neighbors overlap at exp(−1/2) ≈ 0.61, smooth blend without collinearity). - recenter_
moment_ table - Exact recentering via the binomial shift: the same frozen-weight
polynomial table re-expressed about
new_center, with no kernel re-evaluation. This is not a moving-kernel identity; if the Gaussian center changes, the caller must recompute or approximate the weights. - recompute_
null_ eigenvectors - Compute the joint-null absorption rotation for a smooth with one or more active penalty blocks.
- resolve_
duchon_ orders - Resolve a fully admissible Duchon
(nullspace_order, power)pair. - select_
centers_ by_ strategy - select_
cr_ knots - Place
kcr knots at evenly-spaced quantiles of the unique sorted data, exactly as mgcv’s defaultcrknot placement: the first and last knots are the min/max, and the interior knots are at the1/(k-1) … (k-2)/(k-1)quantiles of the unique observed values. Returns a strictly increasing length-kknot vector. - select_
spherical_ farthest_ point_ centers - select_
thin_ plate_ knots - Deterministically selects thin-plate knots via farthest-point sampling.
- should_
use_ implicit_ operators_ with_ policy - Determine whether implicit operators should be used based on problem size
and the supplied [
ResourcePolicy]. - should_
use_ sparse_ basis - Returns true if the B-spline basis should be built in sparse form based on density.
- sobolev_
s2_ truncated_ coefficients - Build the truncated Sobolev coefficient array
c_0 = 0,c_ℓ = (2ℓ+1) / (4π · [ℓ(ℓ+1)]^m)forℓ = 1..=lmax. Returned vector has lengthlmax + 1withresult[ℓ] = c_ℓ. The GPUs2_wahba_legendre_colmajorkernel uploads exactly this array. - sphere_
first_ derivative_ nd - N-D Sobolev-sphere first-derivative jet
∂Φ/∂tper row, on the unit sphereS^{dim−1}. - sphere_
truncated_ spectral_ eval - Evaluate
Σ_{ℓ=0..=lmax} c_ℓ · P_ℓ(cos γ)via the same Legendre 3-term recurrence the GPU kernel runs.coeffs[ℓ] = c_ℓwithcoeffs.len() = lmax + 1. The recurrence isp_{ℓ+1} = ((2ℓ+1)·t·p_ℓ − ℓ·p_{ℓ−1}) / (ℓ + 1). - spherical_
spline_ design_ jet - Realized-design DESIGN jet
∂Φ/∂(lat, lon)for the spherical-spline basis, matching the column layout ofbuild_spherical_spline_basiswith the givenspec. Returns(N, K, 2)whereKequals the forward design’s column count and the last axis is(∂col/∂lat, ∂col/∂lon)in the same angular units as the raw input. - spherical_
wahba_ kernel_ matrix - spherical_
wahba_ kernel_ matrix_ with_ kind - thin_
plate_ penalties_ at_ length_ scale - Rebuild the thin-plate (Matérn-blended) penalty list at a NEW
length_scalefrom FROZEN basis geometry — no data rows touched (#1033, n-free per-ψ penalty re-key). Mirrors the cold penalty assembly inbuild_thin_plate_basiswithworkspace(the bending + optional ridge built by [build_thin_plate_penalty_matrices], normalized, gauge-restricted through the frozen identifiability transform, then filtered), but every input is the already-frozenBasisMetadata::ThinPlate(centers, identifiability transform); onlylength_scalemoves. - thin_
plate_ polynomial_ basis_ dimension