Function peroxide::statistics::stat::lm

source ·
pub fn lm(input: &Matrix, target: &Matrix) -> Matrix
Expand description

R like linear regression

§Examples

#[macro_use]
extern crate peroxide;
use peroxide::fuga::*;

fn main() {
    let a: Matrix = c!(1,2,3,4,5).into();
    let b: Matrix = &a + &Normal(0,1).sample(5).into();
    lm(&a, &b).print();

    //        c[0]
    // r[0] 0.7219
    // r[1] 0.8058
}