Skip to main content

FitModel

Trait FitModel 

Source
pub trait FitModel {
    // Required method
    fn evaluate(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>;

    // Provided method
    fn analytical_jacobian(
        &self,
        _params: &[f64],
        _free_param_indices: &[usize],
        _y_current: &[f64],
    ) -> Option<FlatMatrix> { ... }
}
Expand description

A model that can be fitted to data.

Required Methods§

Source

fn evaluate(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>

The model’s predictions at params, one per data point.

Provided Methods§

Source

fn analytical_jacobian( &self, _params: &[f64], _free_param_indices: &[usize], _y_current: &[f64], ) -> Option<FlatMatrix>

The Jacobian at params if available analytically, else None.

Implementations on Foreign Types§

Source§

impl<M: FitModel + ?Sized> FitModel for &M

Source§

fn evaluate(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>

Source§

fn analytical_jacobian( &self, params: &[f64], free_param_indices: &[usize], y_current: &[f64], ) -> Option<FlatMatrix>

Source§

impl<M: FitModel + ?Sized> FitModel for Box<M>

Source§

fn evaluate(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>

Source§

fn analytical_jacobian( &self, params: &[f64], free_param_indices: &[usize], y_current: &[f64], ) -> Option<FlatMatrix>

Implementors§