shrinkage::Link
Shrinkage for Rust · rust · 0.3.0
Source: src/link.rs
A differentiable, monotone link between a mean and a linear predictor.
Implementations must keep the forward and inverse operations consistent on their domains. Derivatives are with respect to the predictor. Override the log-scale helpers when ordinary probabilities or derivatives lose tail bits. Runtime callbacks belong outside observation loops; Rust links use static dispatch and do not need to implement Clone or Copy.
Methods
initial_predictor
Source: src/link.rs
Supply a fallback predictor when family reference means are unavailable.
Errors
Reject configurations without a finite initial predictor.
inverse_link
Source: src/link.rs
Transform a finite predictor to a mean.
Errors
Reject predictors outside the link domain or nonfinite arithmetic.
inverse_link_derivative
Source: src/link.rs
Evaluate d mu / d eta, retaining its sign even after underflow.
Errors
Reject invalid predictors or nonfinite arithmetic.
link
Source: src/link.rs
Transform a mean to a finite predictor.
Errors
Reject means outside the link domain or nonfinite arithmetic.
link_from_log_probabilities
Source: src/link.rs
Transform normalized log probabilities to a predictor.
Override the default mean conversion to retain rare probability tails.
Errors
Reject invalid means or a nonfinite predictor.
log_abs_inverse_link_derivative
Source: src/link.rs
Return log(abs(d mu / d eta)); negative infinity represents zero.
Errors
Reject invalid predictors or derivatives.
log_probabilities
Source: src/link.rs
Return log(mu) and log(1 - mu) for binomial calculations.
Errors
Reject predictors without an interior probability or finite log tails.
valid_eta
Source: src/link.rs
Test the predictor domain without evaluating the loss.
validate
Source: src/link.rs
Validate parameters independently of any predictor-domain check.
Errors
Reject invalid link configuration.
Implementation of Link
Source: src/link.rs
Implementation of Link
Source: src/link.rs
Implementation of Link
Source: src/link.rs
