parse varargin within functions
Add least squares support
Add logistic regression support