std_dev::regression

Trait LinearEstimator

source
pub trait LinearEstimator {
    // Required method
    fn model_linear(
        &self,
        predictors: &[f64],
        outcomes: &[f64],
    ) -> LinearCoefficients;

    // Provided method
    fn boxed_linear(self) -> Box<dyn LinearEstimator>
       where Self: Sized + 'static { ... }
}
Available on crate feature regression only.
Expand description

Implemented by all estimators yielding a linear 2 variable regression (a line).

Required Methods§

source

fn model_linear( &self, predictors: &[f64], outcomes: &[f64], ) -> LinearCoefficients

Model the LinearCoefficients from predictors and outcomes.

§Panics

The two slices must have the same length.

Provided Methods§

source

fn boxed_linear(self) -> Box<dyn LinearEstimator>
where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.

Implementations on Foreign Types§

source§

impl<T: LinearEstimator + ?Sized> LinearEstimator for &T