pub struct DuchonBasisSpec {
pub center_strategy: CenterStrategy,
pub periodic: Option<Vec<Option<f64>>>,
pub length_scale: Option<f64>,
pub power: f64,
pub nullspace_order: DuchonNullspaceOrder,
pub identifiability: SpatialIdentifiability,
pub aniso_log_scales: Option<Vec<f64>>,
pub operator_penalties: DuchonOperatorPenaltySpec,
pub boundary: OneDimensionalBoundary,
pub radial_reparam: Option<Array2<f64>>,
}Expand description
Duchon-like basis configuration with explicit low-frequency null-space control and explicit spectral power.
Fields§
§center_strategy: CenterStrategy§periodic: Option<Vec<Option<f64>>>§length_scale: Option<f64>Optional hybrid Matérn width. None means pure scale-free Duchon with
spectrum ||w||^(2p + 2s). Some(length_scale) enables the hybrid
spectrum ||w||^(2p) * (kappa^2 + ||w||^2)^s, kappa = 1/length_scale.
power: f64Literal Duchon spectral power s (f64, fractional values fully
threaded end-to-end). The pure-Duchon kernel exponent is 2(p + s) − d,
so this is the knob that sets φ(r): s = 0 is the integer-order Duchon
kernel r^{2p−d} (its r²·log r log case in even d, ≡ the thin-plate
kernel); s = (d − 1)/2 gives the cubic r³ in every dimension.
This field is taken LITERALLY by the basis builder — power = 0 means
s = 0, NOT “use a default”. The magic cubic default (applied when the
user gives no explicit power) is a request-layer choice resolved by the
formula / CLI / pyffi front-ends via duchon_cubic_default; by the time
a spec reaches the builder this value is the final intended s. The
hybrid Duchon–Matérn path (length_scale = Some) still requires an
integer s (read via spec.power_as_usize()).
nullspace_order: DuchonNullspaceOrder§identifiability: SpatialIdentifiability§aniso_log_scales: Option<Vec<f64>>Per-axis anisotropy log-scales η_a.
For hybrid Duchon (length_scale=Some), these are centered contrasts in
the decomposition Λ = κA with det(A)=1. For pure Duchon
(length_scale=None), they parameterize shape-only axis warping on the
public path and are centered before basis evaluation/writeback so no
global length scale is introduced.
When Some, the distance is r = √(Σ_a exp(2η_a) · (x_a - c_a)²). When None, isotropic distance r = ‖x - c‖ is used.
operator_penalties: DuchonOperatorPenaltySpec§boundary: OneDimensionalBoundary§radial_reparam: Option<Array2<f64>>Data-metric radial reparameterization V (#1355), mirroring the
thin-plate Wood-TPRS reparam. When Some, the constrained kernel
transform is folded to Z·V so the realized design columns rotate into
the G_c-orthonormal generalized eigenbasis of Ω_c v = μ G_c v and the
native penalty becomes the diagonal curvature-per-unit-data-variance
spectrum (mgcv’s cliff), preventing the REML over-smoothing collapse to
EDF = 1. Frozen at the cold dense build and replayed verbatim by the
predict / κ-trial / ψ-derivative paths so they stay bit-consistent with
the fit-time design. None on the lazy/streaming path (huge n), which
retains the original constrained basis.
Implementations§
Source§impl DuchonBasisSpec
impl DuchonBasisSpec
Sourcepub fn power_as_usize(&self) -> usize
pub fn power_as_usize(&self) -> usize
Integer view of power for the existing integer-only downstream chain.
Non-finite or non-integer values fall back to 0 (the integer-only
validators downstream already reject this case with a clear message).
Trait Implementations§
Source§impl Clone for DuchonBasisSpec
impl Clone for DuchonBasisSpec
Source§fn clone(&self) -> DuchonBasisSpec
fn clone(&self) -> DuchonBasisSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DuchonBasisSpec
impl Debug for DuchonBasisSpec
Source§impl<'de> Deserialize<'de> for DuchonBasisSpec
impl<'de> Deserialize<'de> for DuchonBasisSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DuchonBasisSpec
impl RefUnwindSafe for DuchonBasisSpec
impl Send for DuchonBasisSpec
impl Sync for DuchonBasisSpec
impl Unpin for DuchonBasisSpec
impl UnsafeUnpin for DuchonBasisSpec
impl UnwindSafe for DuchonBasisSpec
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.