Skip to main content

BernoulliMarginalSlopePredictor

Struct BernoulliMarginalSlopePredictor 

Source
pub struct BernoulliMarginalSlopePredictor {
Show 16 fields pub beta_marginal: Array1<f64>, pub beta_logslope: Array1<f64>, pub beta_score_warp: Option<Array1<f64>>, pub beta_link_dev: Option<Array1<f64>>, pub base_link: InverseLink, pub z_column: String, pub latent_z_normalization: SavedLatentZNormalization, pub latent_measure: LatentMeasureKind, pub baseline_marginal: f64, pub baseline_logslope: f64, pub covariance: Option<Array2<f64>>, pub score_warp_runtime: Option<SavedCompiledFlexBlock>, pub link_deviation_runtime: Option<SavedCompiledFlexBlock>, pub gaussian_frailty_sd: Option<f64>, pub latent_z_calibration: Option<LatentZRankIntCalibration>, pub latent_z_conditional_calibration: Option<LatentZConditionalCalibration>,
}

Fields§

§beta_marginal: Array1<f64>§beta_logslope: Array1<f64>§beta_score_warp: Option<Array1<f64>>§beta_link_dev: Option<Array1<f64>>§base_link: InverseLink§z_column: String§latent_z_normalization: SavedLatentZNormalization§latent_measure: LatentMeasureKind§baseline_marginal: f64§baseline_logslope: f64§covariance: Option<Array2<f64>>§score_warp_runtime: Option<SavedCompiledFlexBlock>§link_deviation_runtime: Option<SavedCompiledFlexBlock>§gaussian_frailty_sd: Option<f64>§latent_z_calibration: Option<LatentZRankIntCalibration>§latent_z_conditional_calibration: Option<LatentZConditionalCalibration>

Implementations§

Source§

impl BernoulliMarginalSlopePredictor

Source

pub fn likelihood_family(&self) -> LikelihoodSpec

Source

pub fn mean_from_eta( &self, eta: &Array1<f64>, ) -> Result<Array1<f64>, EstimationError>

Source

pub fn mean_derivative_from_eta( &self, eta: &Array1<f64>, ) -> Result<Array1<f64>, EstimationError>

Source

pub fn from_unified( unified: &UnifiedFitResult, z_column: String, latent_z_normalization: SavedLatentZNormalization, latent_measure: LatentMeasureKind, baseline_marginal: f64, baseline_logslope: f64, base_link: InverseLink, frailty: FrailtySpec, score_warp_runtime: Option<SavedCompiledFlexBlock>, link_deviation_runtime: Option<SavedCompiledFlexBlock>, latent_z_calibration: Option<LatentZRankIntCalibration>, latent_z_conditional_calibration: Option<LatentZConditionalCalibration>, ) -> Result<Self, String>

Source

pub fn theta(&self) -> Array1<f64>

Source

pub fn final_eta_and_gradient_from_theta( &self, input: &PredictInput, theta: &Array1<f64>, need_gradient: bool, ) -> Result<(Array1<f64>, Option<Array2<f64>>), EstimationError>

Source

pub fn final_eta_from_theta( &self, input: &PredictInput, theta: &Array1<f64>, ) -> Result<Array1<f64>, EstimationError>

Per-row final (base-scale) linear predictor for an arbitrary coefficient vector theta in the saved [marginal | logslope | score_warp? | link_dev?] block order. The marginal-slope rigid kernel is applied exactly per row, so the returned η is the same object the point predictor consumes — only parameterised by an external draw instead of self.theta(). Used by the posterior predictive path (#1049) to map each Laplace draw to its η surface before the shared eta→bands collapse; the response scale is the probit inverse link μ = Φ(η).

Source

pub fn theta_len(&self) -> usize

Length of the concatenated coefficient vector this predictor consumes (marginal + logslope + score_warp? + link_dev?). The posterior predictive path validates each saved draw against this before mapping it through Self::final_eta_from_theta.

Source

pub fn predict_eta_and_q_chain( &self, input: &PredictInput, ) -> Result<(Array1<f64>, Array1<f64>), EstimationError>

Per-row (eta, ∂eta/∂q_marginal) under the exact IFT pull-back.

Returns the same eta as predict_plugin_response/predict_linear_predictor plus the analytic derivative of the internal probit index with respect to the per-row marginal q (the linear predictor before the de-nested calibration). Survival prediction multiplies the second component by the per-row dq/dt to obtain the exact hazard time derivative under score-warp / link-deviation flex blocks.

Rigid path (no flex blocks): ∂eta/∂q = c = sqrt(1 + (s b)^2), recovering the rigid-path probit-frailty composition. Flex path: ∂eta/∂q = scale · link_c_obs · a_q where link_c_obs = 1 + Δ_w'(eta_base) is the link-deviation slope at the observed eta_base = a + b z and a_q = φ(q) / |F_a| is the implicit-function derivative of the calibration intercept (mirrors the bernoulli final_eta_and_gradient_from_theta flex branch lines 1399-1593).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V