added option to specify fitting method as least squares or non-negative least squares