pub struct SavedAnchoredDeviationRuntime {
pub kernel: String,
pub breakpoints: Vec<f64>,
pub basis_dim: usize,
pub span_c0: Vec<Vec<f64>>,
pub span_c1: Vec<Vec<f64>>,
pub span_c2: Vec<Vec<f64>>,
pub span_c3: Vec<Vec<f64>>,
pub anchor_residual_coefficients: Option<Vec<Vec<f64>>>,
pub anchor_residual_components: Vec<SavedAnchorComponent>,
pub anchor_residual_rotation: Option<Vec<Vec<f64>>>,
}Fields§
§kernel: String§breakpoints: Vec<f64>§basis_dim: usize§span_c0: Vec<Vec<f64>>§span_c1: Vec<Vec<f64>>§span_c2: Vec<Vec<f64>>§span_c3: Vec<Vec<f64>>§anchor_residual_coefficients: Option<Vec<Vec<f64>>>Cross-block anchor-residual coefficient matrix M of shape
d × basis_dim. When present, predict-time evaluation subtracts
n_row · M from each cubic-span row (where n_row stacks the
per-row parametric anchor values in the order given by
anchor_residual_components).
anchor_residual_components: Vec<SavedAnchorComponent>Ordered list of parametric anchor components whose stacked row
values combine into n_row. Empty unless
anchor_residual_coefficients is Some.
anchor_residual_rotation: Option<Vec<Vec<f64>>>Optional d × d orthonormalising rotation. The current
construction bakes the rotation into
anchor_residual_coefficients, so this is always either None
or the identity. Reserved for layouts that store the rotation
separately from the coefficient matrix.
Implementations§
Source§impl SavedAnchoredDeviationRuntime
impl SavedAnchoredDeviationRuntime
pub fn breakpoints(&self) -> Result<Vec<f64>, String>
pub fn span_count(&self) -> Result<usize, String>
pub fn span_index_for(&self, value: f64) -> Result<usize, String>
pub fn local_cubic_on_span( &self, beta: &Array1<f64>, span_idx: usize, ) -> Result<LocalSpanCubic, String>
pub fn basis_span_cubic( &self, span_idx: usize, basis_idx: usize, ) -> Result<LocalSpanCubic, String>
pub fn basis_cubic_at( &self, basis_idx: usize, value: f64, ) -> Result<LocalSpanCubic, String>
pub fn local_cubic_at( &self, beta: &Array1<f64>, value: f64, ) -> Result<LocalSpanCubic, String>
pub fn design(&self, values: &Array1<f64>) -> Result<Array2<f64>, String>
Sourcepub fn design_uncorrected(
&self,
values: &Array1<f64>,
) -> Result<Array2<f64>, String>
pub fn design_uncorrected( &self, values: &Array1<f64>, ) -> Result<Array2<f64>, String>
Raw cubic-span design without any anchor-residual subtraction.
Exposed for callers that intend to apply the n_row · M correction
post-hoc (e.g., BMS link_terms_value_d1 subtracts a precomputed
correction.dot(beta) scalar from the linear-predictor contribution
rather than building a full anchor-row matrix). Equivalent to
design() when no residual is present.
Sourcepub fn design_with_anchor_rows(
&self,
values: &Array1<f64>,
anchor_rows: ArrayView2<'_, f64>,
) -> Result<Array2<f64>, String>
pub fn design_with_anchor_rows( &self, values: &Array1<f64>, anchor_rows: ArrayView2<'_, f64>, ) -> Result<Array2<f64>, String>
Evaluate the residual-corrected design at the supplied values.
anchor_rows must be an n × d matrix where n == values.len()
and d == sum of anchor_residual_components ncols. Each row holds
the concatenated parametric anchor design at the same prediction
row as the corresponding values[i]. When the runtime has no
anchor residual, anchor_rows must have zero columns (or be
Array2::zeros((n, 0))).
Sourcepub fn anchor_correction_matrix(
&self,
n_anchor_rows: ArrayView2<'_, f64>,
) -> Result<Option<Array2<f64>>, String>
pub fn anchor_correction_matrix( &self, n_anchor_rows: ArrayView2<'_, f64>, ) -> Result<Option<Array2<f64>>, String>
Build the n × basis_dim per-row, per-basis correction matrix
N · M for a batch of predict rows.
n_anchor_rows is the n × d matrix of stacked parametric anchor
rows at the prediction rows (concatenation of the marginal and
logslope design rows in component order). Returns None when the
runtime has no anchor residual (zero-cost path).
pub fn first_derivative_design( &self, values: &Array1<f64>, ) -> Result<Array2<f64>, String>
pub fn second_derivative_design( &self, values: &Array1<f64>, ) -> Result<Array2<f64>, String>
pub fn third_derivative_design( &self, values: &Array1<f64>, ) -> Result<Array2<f64>, String>
pub fn fourth_derivative_design( &self, values: &Array1<f64>, ) -> Result<Array2<f64>, String>
Trait Implementations§
Source§impl Clone for SavedAnchoredDeviationRuntime
impl Clone for SavedAnchoredDeviationRuntime
Source§fn clone(&self) -> SavedAnchoredDeviationRuntime
fn clone(&self) -> SavedAnchoredDeviationRuntime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de> Deserialize<'de> for SavedAnchoredDeviationRuntime
impl<'de> Deserialize<'de> for SavedAnchoredDeviationRuntime
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 SavedAnchoredDeviationRuntime
impl RefUnwindSafe for SavedAnchoredDeviationRuntime
impl Send for SavedAnchoredDeviationRuntime
impl Sync for SavedAnchoredDeviationRuntime
impl Unpin for SavedAnchoredDeviationRuntime
impl UnsafeUnpin for SavedAnchoredDeviationRuntime
impl UnwindSafe for SavedAnchoredDeviationRuntime
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.