Skip to main content

Module basis

Module basis 

Source
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§

AnisoBasisPsiDerivatives
Per-axis psi_a derivative package for anisotropic spatial terms.
AnisoPenaltyCrossProvider
AutoBSplineKnots
Result of auto-deriving a clamped B-spline knot vector from 1-D data.
BSplineBasisSpec
1D B-spline basis configuration.
BSplineBoundaryConditions
Left/right pair of B-spline endpoint constraints.
BasisBuildResult
Standardized basis build result for engine-level composition.
BasisOptions
Options for basis generation, controlling derivative order.
BasisPsiDerivativeBundle
BasisPsiDerivativeResult
BasisPsiSecondDerivativeResult
BasisWorkspace
Explicit per-run workspace for reusable basis-construction caches.
BsplineDerivativeWorkspace
Reusable scratch arena for the shared B-spline higher-derivative recurrence.
CanonicalPenaltyBlock
CollocationOperatorMatrices
ConstantCurvatureBasisSpec
Constant-curvature smooth configuration (curv(x, z, kappa = …)).
CubicRegressionBasis
Precomputed natural cubic regression spline geometry for a fixed knot set.
Dense
Marker type for dense basis matrix output.
DuchonBasisSpec
Duchon-like basis configuration with explicit low-frequency null-space control and explicit spectral power.
DuchonOperatorPenaltyMatrices
DuchonOperatorPenaltySpec
DuchonPartialFractionCoeffs
ImplicitDesignPsiDerivative
Implicit representation of ∂X/∂ψ_d that supports matrix-vector products without materializing the full (n x p) derivative matrices.
JointNullRotation
Joint-null absorption rotation, attached to a smooth’s basis when the basis’s joint penalty Σ_k S_k has a non-trivial null space.
KroneckerFactoredBasis
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) with i >= j. The zeroth-order “direction” (the value itself) is handled separately; this names the active first-order channels.
LatentCoordDesignDerivative
Streaming design derivative for one per-row latent coordinate t[n, a].
MaternBasisSpec
Matérn basis configuration.
MaternSplineBasis
Matérn radial basis and penalties.
MeasureJetAnisotropyJets
The anisotropic energy together with its exact first and second jets with respect to the lower-triangular Cholesky factor entries of L.
MeasureJetBand
Realized geometric scale band: eps ascending, log_step the constant log-spacing ln(eps[ℓ+1]/eps[ℓ]) used as the Mellin quadrature weight.
MeasureJetBasisSpec
Measure-jet smooth configuration (mjs(x0, …, xd)).
MeasureJetEnergyJets
The energy and its exact hyperparameter jets in the live dials. s and α enter only through per-block log-weights. The retained ln τ 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.
MeasureJetFrozenQuadrature
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.
MeasureJetJetStats
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.
MeasureJetMomentTable
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.
PenaltyCandidate
PenaltyInfo
PeriodicBSplineBasisSpec
Configuration for a dense one-dimensional periodic B-spline basis.
PeriodicSplineCurve
Fitted vector-valued periodic spline curve.
Sparse
Marker type for sparse basis matrix output.
SpatialBasisPlan
Resource-aware plan for a spatial smooth (Duchon / Matérn / TPS).
SphericalSplineBasisSpec
Intrinsic S² (sphere) smooth configuration.
SplineScratch
Scratch memory for B-spline evaluation to avoid allocations in tight loops.
ThinPlateBasisSpec
Thin-plate basis configuration.
ThinPlatePenaltyMatrix
ThinPlateSplineBasis
Thin-plate regression spline basis and penalty (order m=2).

Enums§

AnisoSeedMode
How the Matérn forward design build interprets an exactly all-zero aniso_log_scales vector.
BSplineEndpointBoundaryCondition
Per-endpoint boundary constraint policy for B-spline 1D bases.
BSplineIdentifiability
Per-smooth identifiability policy for 1D B-spline bases.
BSplineKnotPlacement
Internal-knot placement strategy when knots are automatically inferred.
BSplineKnotSpec
Which knot strategy to use for 1D B-spline bases.
BasisError
Re-export of the neutral basis-error contract. #1521: BasisError lives in gam-problem so EstimationError can wrap it (#[from]) without a back-edge; gam-terms re-exports it to preserve gam_terms::basis::BasisError. A comprehensive error type for all operations within the basis module.
BasisEvalKind
BasisFamily
Basis-family selector for 1D spline evaluation.
BasisMetadata
Metadata returned by generic basis builders.
BasisStorageLayout
Storage layout discriminant for BasisOutputFormat impls. 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.
CenterCountRequest
How plan_spatial_basis should pick the spatial center count.
CenterStrategy
Spatial center selection strategy.
CenterStrategyKind
ConstantCurvatureIdentifiability
Realized-design identifiability policy for the constant-curvature smooth. Mirrors super::SphericalSplineIdentifiability (#532): the fit-time center-space sum-to-zero z gets 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 recomputing z from the centers.
DuchonNullspaceOrder
Duchon null-space polynomial degree.
KnotSource
Specifies the source of knots for basis generation.
MaternIdentifiability
Per-smooth identifiability policy for Matérn kernel coefficients.
MaternNu
Matérn smoothness parameter nu (half-integer variants with closed forms).
MeasureJetExtrapolationSpectrum
MeasureJetIdentifiability
Realized-design identifiability policy for the measure-jet smooth. Mirrors super::ConstantCurvatureIdentifiability (#532): the fit-time center-space sum-to-zero z gets 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 recomputing z from the centers.
OneDimensionalBoundary
Boundary-condition policy for one-dimensional smooth bases.
OperatorPenaltySpec
PenaltyDropReason
PenaltySource
RadialScalarKind
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.
SpatialIdentifiability
Per-smooth identifiability policy for spatial (TPS / Duchon) bases.
SpatialStorageMode
Storage mode recommended by plan_spatial_basis.
SphereMethod
Which intrinsic S² smooth construction to use.
SphereWahbaKernel
Which reproducing kernel to use for SphereMethod::Wahba.
SphericalSplineIdentifiability
Realized-design identifiability policy for the Wahba spherical spline (#532).

Traits§

BasisOutput
Trait for selecting basis storage format at compile time.
BasisOutputFormat
Trait for building basis matrices with different storage formats. This is an implementation detail for the unified create_basis function.
LocalDesignJacobianProvider
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_centers Duchon 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 ∂Φ/∂t per 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 penalty zᵀ K_κ(centers, centers) z, and the replayable BasisMetadata::ConstantCurvature. Structure mirrors the Wahba S² builder (build_spherical_spline_basis); geometry comes from ConstantCurvature at 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_auto produce 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_scales literally as the isotropic metric, rather than the κ-optimizer’s geometry-seeding sentinel. This is what the public matern_basis FFI evaluates, so a caller’s explicit isotropic request is not silently hijacked into a data-driven anisotropic kernel (#1042). For every internal/fit build, use build_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 replayable BasisMetadata::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_q and 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 of closed_form_operator_penalty_in_total_basis. Uses closed_form_anisotropic_pair_block_pure to 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 where radial_derivatives_of_isotropic_duchon is 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_q and its log-κ derivatives S_q_psi, S_q_psi_psi in the final (post-transform) basis space, computed via pair_block_radial_with_j_second_derivatives from the closed_form_penalty module. Bundle’s d_kappa and d2_kappa are κ-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 design B = K_κ(data,centers)·z against y, with the unpenalized intercept appended and the raw RKHS Gram penalty S profiled over λ (profiled_reml_with_intercept). This is the criterion whose argmin over the chart-bounded κ window IDENTIFIES the curvature, and the one curvature_inference_forspec walks 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: rides distance_kappa_jet (Tower4, FD-gated in geometry::constant_curvature) through the chain rule for K = exp(−d/ℓ) at κ-FIXED ℓ and centers (see the module κ-contract):
constant_curvature_kernel_matrix
K_κ(data, centers) — the geodesic-exponential kernel matrix exp(−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_wrap and its first/second γ-derivatives, where S_wrap = S_circle − S_open is the seam-closing contribution and c(γ) is the boundary-conductance interpolant (c(0)=0, c(1)=1). At γ = 1 this is exactly the cyclic penalty; at γ = 0 it 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 S for a B-spline basis from a difference matrix D. The penalty is of the form S = D' * D, penalizing the squared order-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'D over 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 (mgcv sos default) 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 dimension d: 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_scale purely 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/∂t per row.
duchon_power_to_usize
Convert a Duchon spectral-power f64 into the integer view used by the closed-form code paths. Non-finite, negative, or fractional values clamp to 0 so the validator downstream emits the canonical error.
duchon_pure_kernel_amplification
Scalar kernel amplification α that build_duchon_basis applies to the pure scale-free polyharmonic Duchon kernel block (length_scale = None, power = 0, no anisotropy) for the given requested null-space order.
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 with duchon_sae_atom_basis_with_jet column-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 with duchon_sae_atom_basis_with_jet and duchon_sae_atom_second_jet column-for-column and α-for-α.
estimate_penalty_nullity
evaluate_bspline_basis_scalar
Evaluates B-spline basis functions at a single scalar point x into a provided buffer.
evaluate_bspline_derivative_scalar
Evaluates B-spline basis derivatives at a single scalar point x into 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 x into out.
evaluate_bsplinesecond_derivative_scalar
Evaluates B-spline second derivatives at a single scalar point x into out.
evaluate_bsplinethird_derivative_scalar
Evaluates B-spline third derivatives at a single scalar point x into out.
evaluate_ispline_scalar
evaluate_ispline_scalarwith_scratch
Evaluates I-spline basis functions at a scalar point x into a provided buffer.
evaluate_mspline_scalar
Evaluates M-spline basis functions at a scalar point x into a provided buffer.
expand_periodic_centers
filter_active_penalty_candidates
filter_active_penalty_candidates_with_ops
Same filtering pass as filter_active_penalty_candidates but 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 channel channel.
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×d factor in column-major order (column j, rows j..d). This is the canonical order every output of this module uses for its L-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 ∂Φ/∂t under 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 Q for the metric A = L Lᵀ. With L = I this returns the isotropic super::measure_jet_energy_form bit-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 == 0 requests the auto count clamp(⌈log2(ε_max/ε_min)⌉ + 1, 3, 8); a degenerate band (ceiling ≤ floor) collapses to the single floor scale with log_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. With g_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_ℓ = Q exactly (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 clears coverage_floor × q̄_ℓ); levels finer than ε★ contribute their full prior variance λ̂_ℓ⁻¹, levels from ε★ up contribute the uncovered fraction (1 − a_ℓ(x★)) · λ̂_ℓ⁻¹ with a_ℓ(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 ℓ is vᵀ Q_ℓ v, the detail energy charged at scale ε_ℓ. Sums exactly to vᵀ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 ∂/∂s reweightings.
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 of operator_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 ∂Φ̃/∂t per 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_scale is used verbatim; the 0.0 sentinel 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_scale is used verbatim; the 0.0 sentinel 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 k cr knots at evenly-spaced quantiles of the unique sorted data, exactly as mgcv’s default cr knot placement: the first and last knots are the min/max, and the interior knots are at the 1/(k-1) … (k-2)/(k-1) quantiles of the unique observed values. Returns a strictly increasing length-k knot 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 length lmax + 1 with result[ℓ] = c_ℓ. The GPU s2_wahba_legendre_colmajor kernel uploads exactly this array.
sphere_first_derivative_nd
N-D Sobolev-sphere first-derivative jet ∂Φ/∂t per row, on the unit sphere S^{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_ℓ with coeffs.len() = lmax + 1. The recurrence is p_{ℓ+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 of build_spherical_spline_basis with the given spec. Returns (N, K, 2) where K equals 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_scale from FROZEN basis geometry — no data rows touched (#1033, n-free per-ψ penalty re-key). Mirrors the cold penalty assembly in build_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-frozen BasisMetadata::ThinPlate (centers, identifiability transform); only length_scale moves.
thin_plate_polynomial_basis_dimension