pub struct GridSpline2dDesign { /* private fields */ }Expand description
Banded sufficient statistics of one streaming pass plus the exact penalty: everything needed to evaluate the REML criterion and solve at any λ.
Implementations§
Source§impl GridSpline2dDesign
impl GridSpline2dDesign
Sourcepub fn build(
x1: &[f64],
x2: &[f64],
y: &[f64],
w: &[f64],
k: usize,
metric: [f64; 2],
) -> Result<Self, String>
pub fn build( x1: &[f64], x2: &[f64], y: &[f64], w: &[f64], k: usize, metric: [f64; 2], ) -> Result<Self, String>
Single-response entry: see Self::build_multi.
Sourcepub fn build_multi(
x1: &[f64],
x2: &[f64],
responses: &[&[f64]],
w: &[f64],
k: usize,
metric: [f64; 2],
) -> Result<Self, String>
pub fn build_multi( x1: &[f64], x2: &[f64], responses: &[&[f64]], w: &[f64], k: usize, metric: [f64; 2], ) -> Result<Self, String>
One streaming pass over the rows plus the exact per-cell quadrature
assembly of the penalty. k is the number of cells per axis;
metric = [a1, a2] is the diagonal anisotropy of the biharmonic form.
responses holds one length-n response per dimension; the design,
penalty, and the REML-shared λ are common to all dimensions (one
surface smoothness), only the right-hand sides differ.
Sourcepub fn lower_corner(&self) -> [f64; 2]
pub fn lower_corner(&self) -> [f64; 2]
Lower corner of the data bounding box per axis.
Sourcepub fn cell_widths(&self) -> [f64; 2]
pub fn cell_widths(&self) -> [f64; 2]
Knot-cell width per axis.
Sourcepub fn penalty_value(&self, coeff: &[f64]) -> Result<f64, String>
pub fn penalty_value(&self, coeff: &[f64]) -> Result<f64, String>
Exact penalty quadratic form J(f) = c'Sc of a coefficient vector —
the assembled anisotropic biharmonic energy of the spline it encodes.
Sourcepub fn posterior(
&self,
fit: &GridSpline2dFit,
) -> Result<GridSpline2dPosterior, String>
pub fn posterior( &self, fit: &GridSpline2dFit, ) -> Result<GridSpline2dPosterior, String>
Posterior summary of a fit FROM THIS DESIGN, in the exact algebra of the solved system (no approximation):
unit_covariance = (X'WX + λS)⁻¹(scale-free Bayesian posterior covariance of the row-major coefficient vec, shared by dimensions);edf = tr[(X'WX + λS)⁻¹ X'WX](the smoother’s effective degrees of freedom at the fitted λ);residual_cross_cov[d,e] = r_d'W r_e / (n − edf)assembled from the streamed sufficient statistics (y_d'Wy_e − c_d'X'Wy_e − c_e'X'Wy_d + c_d'X'WX c_e).
Auto Trait Implementations§
impl Freeze for GridSpline2dDesign
impl RefUnwindSafe for GridSpline2dDesign
impl Send for GridSpline2dDesign
impl Sync for GridSpline2dDesign
impl Unpin for GridSpline2dDesign
impl UnsafeUnpin for GridSpline2dDesign
impl UnwindSafe for GridSpline2dDesign
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> 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.