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 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 · T, which is
what a predict-time replay wants: predict does not move ψ, so replaying
the composed chart reproduces the fitted block exactly. A caller that DOES
move ψ re-derives T here and must therefore rebuild in z_local, not
in the composition — otherwise the collection’s orthogonalization is
applied twice, once in the stale ψ₀ chart carried by the spec and once
freshly by this gauge.
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, so
the gauge resolved a direction and deleted a column at every ψ. The
term reached the splice one column short and every κ fixture on a Duchon
term refused in 0.2 s. On the Residualize arm the second application is
idempotent, which is why the same defect was invisible on Matérn.
None means the term-local build applied no chart of its own — the usual
case for the radial families, whose OrthogonalToParametric policy defers
entirely to this gauge.
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.
local_columns: usizeThe width of the TERM-LOCAL block this gauge was derived on, before the arm ran (gam#2760).
The collection’s realized width is this minus whatever the arm removed, and both halves are needed to read a rebuild that comes out narrow. A rebuild whose LOCAL width differs from this is not the same basis and is a defect; a rebuild that matches here and still comes out narrow after the arm has hit a ψ at which the realized design loses rank in this gauge’s chart — a statement about the trial point, not about the rebuild.
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.