[][src]Struct linreg_rs::LinReg

pub struct LinReg { /* fields omitted */ }

Linear Regression (linreg)

use linreg_rs::LinReg;
use ta_common::traits::Indicator;

let mut linreg = LinReg::new(5);
assert_eq!(linreg.next(81.59), None);
assert_eq!(linreg.next(81.06), None);
assert_eq!(linreg.next(82.87), None);
assert_eq!(linreg.next(83.00), None);
assert_eq!(linreg.next(83.61), Some(83.622));
assert_eq!(linreg.next(83.15), Some(83.72199999999998));
assert_eq!(linreg.next(82.84), Some(83.11199999999998));
assert_eq!(linreg.next(83.99), Some(83.55999999999997));
assert_eq!(linreg.next(84.55), Some(84.17199999999997));
assert_eq!(linreg.next(84.36), Some(84.60399999999998));
assert_eq!(linreg.next(85.53), Some(85.40399999999998));
assert_eq!(linreg.next(86.54), Some(86.20999999999998));
assert_eq!(linreg.next(86.89), Some(86.94599999999997));
assert_eq!(linreg.next(87.77), Some(87.85399999999996));
assert_eq!(linreg.next(87.29), Some(87.75399999999996));

Implementations

impl LinReg[src]

pub fn new(period: u32) -> LinReg[src]

Trait Implementations

impl Indicator<f64, Option<f64>> for LinReg[src]

Auto Trait Implementations

impl RefUnwindSafe for LinReg

impl Send for LinReg

impl Sync for LinReg

impl Unpin for LinReg

impl UnwindSafe for LinReg

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.