Skip to main content

SmoothCollectionGauge

Struct SmoothCollectionGauge 

Source
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: SmoothCollectionGaugeArm

Which 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: bool

Whether 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: usize

The 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

Source§

fn clone(&self) -> SmoothCollectionGauge

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SmoothCollectionGauge

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V