Matrix based regression calculations for polynomial coefficients

Written before we had access to Apache Commons Math :slight_smile: .