Functions to perform linear regression using RcppEigen