AtheMathmo / rulinalg

A linear algebra library written in Rust

Home Page:https://crates.io/crates/rulinalg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Variance and mean could be calculated in a better way

vks opened this issue · comments

Currently the mean is calculated in a very naive way, which has numerical problems. Also it is possible to calculate the variance (and higher moments) in a single pass over the data, instead of two passes (see Wikipedia). (I implemented such an algorithm in Rust in this crate.)

Indeed. Also related issue: #182.