Struct criterion_stats::bivariate::regression::StraightLine
[−]
[src]
pub struct StraightLine<A> where
A: Float, {
pub intercept: A,
pub slope: A,
}
A straight line y = m * x + b
Fields
intercept: A
The y-intercept of the line
slope: A
The slope of the line
Methods
impl<A> StraightLine<A> where
A: Float,
[src]
A: Float,
fn fit(data: Data<A, A>) -> StraightLine<A>
[src]
Fits the data to a straight line using ordinary least squares
- Time:
O(length)
fn r_squared(&self, data: Data<A, A>) -> A
[src]
Computes the goodness of fit (coefficient of determination) for this data set
- Time:
O(length)
Trait Implementations
impl<A: Clone> Clone for StraightLine<A> where
A: Float,
[src]
A: Float,
fn clone(&self) -> StraightLine<A>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<A: Copy> Copy for StraightLine<A> where
A: Float,
[src]
A: Float,