Skip to main content

fit_correction

Function fit_correction 

Source
pub fn fit_correction(
    base: &dyn ElectronicStopping,
    dataset: &StoppingDataset,
    settings: FitSettings,
) -> Result<CorrectionFit, StoppingError>
Expand description

Fit a Correction of base to a single-system element-target dataset.

The dataset must hold points of one ion (same Z and mass) on one element target, at no fewer than degree + 2 + held_out points with at least two distinct energies, and base must return a positive value at every point. Anything else is an StoppingError::InvalidFit (or the base model’s own error), so no point is dropped silently.