pub struct SpatialLengthScaleOptimizationOptions {
pub enabled: bool,
pub max_outer_iter: usize,
pub rel_tol: f64,
pub log_step: f64,
pub min_length_scale: f64,
pub max_length_scale: f64,
pub pilot_subsample_threshold: usize,
}Fields§
§enabled: boolEnable outer-loop optimization over spatial κ (= 1 / length_scale) for supported radial-kernel smooths. This applies to ThinPlate, Matérn, and Duchon terms.
max_outer_iter: usizeMaximum number of outer iterations in the exact joint [rho, psi] solve.
rel_tol: f64Relative improvement threshold for terminating the outer solve.
log_step: f64Initial log(length_scale) perturbation used for seed construction.
min_length_scale: f64Minimum allowed length_scale during κ search.
max_length_scale: f64Maximum allowed length_scale during κ search.
pilot_subsample_threshold: usizeAutomatic geometry-initializer threshold for biobank-scale spatial fits.
When n exceeds twice this value, the fitter uses a spatially stratified subsample only to seed κ/anisotropy geometry: centers are resolved, axis contrasts are initialized from center/data spread, and one or two cheap ψ reseeding updates are applied. It never runs PIRLS, REML, ARC, BFGS, or any recursive optimizer on the pilot.
The final coefficients, smoothing parameters, and spatial geometry are always optimized on the full dataset.
Set to 0 to skip the pilot geometry initializer.
Implementations§
Source§impl SpatialLengthScaleOptimizationOptions
impl SpatialLengthScaleOptimizationOptions
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate the struct’s invariants. Callers that construct these options
from external input (CLI, config, Python API) should call this before
passing the options into the fitter. Returns Err with a descriptive
message when an invariant is violated; the fitter then panics or
returns EstimationError at its own boundary.
Invariants:
min_length_scale > 0, finitemax_length_scale > 0, finitemin_length_scale < max_length_scalerel_tol > 0, finitelog_step > 0, finite
These invariants are what the downstream κ-bound and ψ-window code
assumes (-log(max_ls) must be finite, (min,max) must not be
inverted, etc.). Without validation, invalid options produce silent
NaN-propagation inside the outer optimizer.
Trait Implementations§
Source§impl Clone for SpatialLengthScaleOptimizationOptions
impl Clone for SpatialLengthScaleOptimizationOptions
Source§fn clone(&self) -> SpatialLengthScaleOptimizationOptions
fn clone(&self) -> SpatialLengthScaleOptimizationOptions
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 SpatialLengthScaleOptimizationOptions
impl RefUnwindSafe for SpatialLengthScaleOptimizationOptions
impl Send for SpatialLengthScaleOptimizationOptions
impl Sync for SpatialLengthScaleOptimizationOptions
impl Unpin for SpatialLengthScaleOptimizationOptions
impl UnsafeUnpin for SpatialLengthScaleOptimizationOptions
impl UnwindSafe for SpatialLengthScaleOptimizationOptions
Blanket Implementations§
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
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,
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
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.