pub struct SavedLinkWiggleRuntime {
pub knots: Vec<f64>,
pub degree: usize,
pub penalty_metadata: Option<WigglePenaltyMetadata>,
pub beta: Vec<f64>,
pub index_shift: Option<Vec<f64>>,
}Fields§
§knots: Vec<f64>§degree: usize§penalty_metadata: Option<WigglePenaltyMetadata>Canonical penalty metadata is mandatory for standard fitted link-wiggles, whose posterior sampler consumes it. Other model classes do not expose the standard joint-wiggle sampling target.
beta: Vec<f64>§index_shift: Option<Vec<f64>>Frozen-index mean-coordinate shift s (#2141). When present the predict
layer evaluates the warp basis at the frozen index
η̂ = base + X·s rather than at the de-aliased base predictor base, so
predict reproduces the exact q (and deviance) the fit computed. This is
mandatory for standard link-wiggle fits and None only for other model
classes whose warp path never de-aliased, where the base predictor is
already the warp index.
Implementations§
Source§impl SavedLinkWiggleRuntime
impl SavedLinkWiggleRuntime
pub fn constrained_basis( &self, q0: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, basis_options: BasisOptions, ) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, FittedModelError>
pub fn design( &self, q0: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, FittedModelError>
Sourcepub fn warp_index(
&self,
base: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
mean_design: &DesignMatrix,
) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, FittedModelError>
pub fn warp_index( &self, base: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, mean_design: &DesignMatrix, ) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, FittedModelError>
Reconstruct the exact index at which the saved link-wiggle basis is evaluated.
The frozen-basis de-aliased standard link fit persists a mean-coordinate
shift s so its fitted warp index is base + X s (#2141). Other warp
paths persist no shift and evaluate at base. Keeping this operation on
the saved runtime gives prediction and public affine-design export one
source of truth for the fitted coordinate frame.
pub fn basis_row_scalar( &self, q0: f64, ) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, FittedModelError>
pub fn apply( &self, q0: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, FittedModelError>
Sourcepub fn apply_with_index(
&self,
base: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
warp_index: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, FittedModelError>
pub fn apply_with_index( &self, base: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, warp_index: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, FittedModelError>
Apply the warp with the additive base predictor base and the warp basis
evaluated at a possibly distinct index warp_index (#2141):
q = base + B(warp_index)·β. The frozen-basis de-aliased binomial-mean
link fit pins B at the frozen index η̂, which differs from the
de-aliased base predictor base by X·s; evaluating B at warp_index
(= base + X·s) reproduces the exact q the fit scored. Monotonicity is
certified at warp_index, where the link’s dq/dη = 1 + B'(warp_index)·β
is defined. When no shift is active warp_index == base and this reduces
to the original q = q0 + B(q0)·β.
pub fn derivative_q0( &self, q0: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, FittedModelError>
Trait Implementations§
Source§impl Clone for SavedLinkWiggleRuntime
impl Clone for SavedLinkWiggleRuntime
Source§fn clone(&self) -> SavedLinkWiggleRuntime
fn clone(&self) -> SavedLinkWiggleRuntime
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 SavedLinkWiggleRuntime
impl RefUnwindSafe for SavedLinkWiggleRuntime
impl Send for SavedLinkWiggleRuntime
impl Sync for SavedLinkWiggleRuntime
impl Unpin for SavedLinkWiggleRuntime
impl UnsafeUnpin for SavedLinkWiggleRuntime
impl UnwindSafe for SavedLinkWiggleRuntime
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<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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.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.