pub struct SmoothCollectionGauge {
pub arm: SmoothCollectionGaugeArm,
pub constraint_block: Array2<f64>,
pub owner_terms: Vec<usize>,
pub has_parametric_block: bool,
pub local_identifiability_transform: Option<Array2<f64>>,
pub joint_null_rotation: Option<JointNullRotation>,
pub coefficient_transform: Array2<f64>,
pub local_columns: usize,
}Expand description
The COLLECTION’s gauge for one smooth term: the realized constraint block it was made orthogonal to, and which construction did it.
§Why this is freezable, and why a term-local rebuild needs it
C = [intercept | owned linear axes | owner smooths' realized blocks] is a
function of the data and of OTHER terms — never of this term’s own basis
parameters. So C is invariant along an outer search over this term’s ψ
(a length scale, a curvature, a measure-jet dial), while the two objects
derived FROM it are not: T and R are both functions of the realized
design, so both move with ψ.
That asymmetry is the whole content of gam#2747’s second half. The spatial
outer search rebuilds one term LOCALLY per trial and splices the result into
the collection design; a term-local build cannot see C, so before this
existed the splice replaced the design and its chart while leaving the
collection’s R behind, and the fit shipped X(ψ̂)·Z − C·R(ψ₀) — a block
orthogonal to nothing, with ‖XᵀC‖/(‖X‖‖C‖) measured at 4.15e-1 against
the 1e-8 bar the same step asserts whenever it applies a transform.
Carrying the ψ-INDEPENDENT half forward and re-deriving the ψ-dependent half is therefore not an optimization — it is the only formulation under which the criterion an outer search minimizes and the model the fit ships are the same object.
Fields§
§arm: SmoothCollectionGaugeArmWhich construction the collection chose.
constraint_block: Array2<f64>C, n × q, exactly as build_constraint_block stacked it.
owner_terms: Vec<usize>Indices into the collection’s smooth terms of the owner smooths whose
realized designs joined C, in stack order. Recorded for the same
reason ParametricResidualizationChart::owner_terms is.
has_parametric_block: boolWhether the parametric block led C.
local_identifiability_transform: Option<Array2<f64>>The TERM-LOCAL identifiability chart the gauged block was derived ON —
z_local, before this gauge composed its own T on top of it (gam#2760).
The term’s BasisMetadata records the COMPOSITION z_local · T0, which
is what a predict-time replay wants. A caller that moves ψ must rebuild
in z_local, then apply the separately stored fixed
Self::coefficient_transform and fixed row-space projection. Starting
from the composition would apply T0 twice.
Measured before this existed, on a one-Duchon-term collection with
C = [1] and the Delete arm: the replay spec carried
FrozenTransform(12, 11), the doubly-charted rebuild had orthogonality
residual 1.5e-12 at the fit’s own ℓ and 9.0e-1 one octave away. The
term reached the splice one column short and every κ fixture on a Duchon
term refused in 0.2 s.
None means the term-local build applied no chart of its own. The radial
families under OrthogonalToParametric defer entirely to this gauge and
report an identity placeholder instead (freeze_raw_spatial_metadata), so
for them this is Some(I); either way it carries no rotation.
Like C and the arm, this is ψ-INDEPENDENT: it is a center-space
constraint (1ᵀα = 0, a linear-orthogonality frame) or a frozen replay
chart, never a function of the realized design.
joint_null_rotation: Option<JointNullRotation>The stage-2 joint-null absorption rotation Q the collection applied to
this term’s TERM-LOCAL build BEFORE it derived
Self::coefficient_transform (gam#2760).
The aggregation loop rotates the local design and penalties by Q, and
T0 is then derived on X_local · Q, so the complete fixed map from the
local build’s own coordinates to the collection’s is Q · T0. Once the
gauge has composed Q · T0 into the term’s metadata the term reports
None for its own rotation, and Q cannot be recovered from the
composition, so it travels here: a moving-ψ replay rebuilds in the local
chart above, applies Q, and only then the fixed T0 — the order the
collection used.
Measured before this existed, on the kappa_loop_n_scaling Duchon spec
at the fit’s OWN length scale: the replay put the unrotated block through
the chart derived on the rotated one, every design column and every
penalty block came out wrong (‖ΔS‖_F/‖S‖_F 0.69–1.41, nullities
[1,10,0,0,1] → [4,10,2,1,3]), and the criterion sat 679 above the
collection’s at n = 1000 — the “route agreement” gap the joint κ search
was then minimizing against.
ψ-INDEPENDENT like the rest of this gauge: an orthogonal chart chosen once at the reference realization and never re-derived.
coefficient_transform: Array2<f64>The collection coefficient chart derived at the fit’s reference realization, in TERM-LOCAL coefficient coordinates.
This is a coordinate section, not a statistical parameter. A spatial
outer move therefore replays this fixed T0 and projects the moving
value design on the LEFT through the fixed row-space complement of C:
X_g(psi) = P_C X_local(psi) T0. Re-deriving RRQR/eigenvectors
T(psi) at every trial makes the objective depend on an arbitrary
moving coefficient chart; after per-penalty Frobenius normalization it
even changes the meaning of fixed rho. Penalties and local inequality
rows are consequently transported through this same fixed transform.
local_columns: usizeThe width of the TERM-LOCAL block this gauge was derived on, before the arm ran (gam#2760).
The collection’s stored width is
coefficient_transform.ncols(). A moving-psi rebuild whose LOCAL width
differs from this value is not the basis the fixed chart was derived on
and is a defect; numerical rank may change at a trial, but it must never
change the number or identity of coefficient coordinates.
Trait Implementations§
Source§impl Clone for SmoothCollectionGauge
impl Clone for SmoothCollectionGauge
Source§fn clone(&self) -> SmoothCollectionGauge
fn clone(&self) -> SmoothCollectionGauge
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SmoothCollectionGauge
impl RefUnwindSafe for SmoothCollectionGauge
impl Send for SmoothCollectionGauge
impl Sync for SmoothCollectionGauge
impl Unpin for SmoothCollectionGauge
impl UnsafeUnpin for SmoothCollectionGauge
impl UnwindSafe for SmoothCollectionGauge
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.