Shrinkage

shrinkage::GapSafePenalty

Shrinkage for Rust · rust · 0.3.0

pub trait GapSafePenalty: ProximalPenalty

Complete-penalty dual feasibility and exact fixed-zero restrictions.

A fixed-zero constraint differs from excluding a coordinate from a penalty. Implementations must retain every interaction with removed zeros.

Methods

dual_feasible

fn dual_feasible(
    &self,
    correlations: &[f64],
    errors: &[f64]
) -> Result<bool, FitError>

Check complete feasibility for all correlations within the error bounds.

Errors

Reject incompatible dimensions or invalid penalty settings.

dual_scaling

fn dual_scaling(
    &self,
    _correlations: &[f64],
    _errors: &[f64]
) -> Result<Option<f64>, FitError>

Return an analytic feasible divisor, or request the generic search.

Errors

Reject incompatible dimensions or invalid penalty settings.

has_sparsity

fn has_sparsity(&self) -> bool

Whether this penalty has a positive sparsity component.

prox_zeroed

fn prox_zeroed(
    &self,
    input: &[f64],
    zeroed: &[bool],
    step: f64,
    output: &mut [f64]
) -> Result<(), FitError>

Evaluate the exact prox with true coordinates constrained to zero.

Errors

Reject invalid parameters, dimensions, steps, or arithmetic.

screen_zeros

fn screen_zeros(
    &self,
    correlations: &[f64],
    errors: &[f64],
    zeroed: &mut [bool]
) -> Result<(), FitError>

Add proven zeros using bounds on the optimal correlations.

errors[j] includes the safe radius times the column norm and rounding. Existing true entries must remain fixed.

Errors

Reject incompatible dimensions or invalid penalty settings.

Implementation of GapSafePenalty

impl GapSafePenalty for shrinkage::ChainFusedLasso

Implementation of GapSafePenalty

impl GapSafePenalty for shrinkage::ClusteredLasso

Implementation of GapSafePenalty

impl GapSafePenalty for shrinkage::Slope