pub trait Summation<D: Dimension>: Function<D> {
    // Required methods
    fn terms(&self) -> usize;
    fn term_value(&self, position: &Array<f64, D>, term: usize) -> f64;

    // Provided method
    fn partial_value(&self, position: &Array<f64, D>, terms: &[usize]) -> f64 { ... }
}
Expand description

Defines a summation of individual functions, i.e., f(x) = ∑ᵢ fᵢ(x).

Required Methods§

source

fn terms(&self) -> usize

Returns the number of individual functions that are terms of the summation.

source

fn term_value(&self, position: &Array<f64, D>, term: usize) -> f64

Comptues the value of one individual function indentified by its index term, given the position x.

Provided Methods§

source

fn partial_value(&self, position: &Array<f64, D>, terms: &[usize]) -> f64

Computes the partial sum over a set of individual functions identified by terms. without dividing by anything!!

Implementors§

source§

impl Summation<Dim<[usize; 1]>> for SSE<Ix1>

source§

impl Summation<Dim<[usize; 2]>> for LogisticRegression

We implement the trait Summation using 2 dimensional Arrays. We use the variable coefficients : Array2<f64> so that a row is coefficient array corresponding to (1 augmented) observations and a column is coefficients by class. Recall that ndarray is by default with C storage (row oriented)