def update_function(self, param_vals):
self.model = self.func(param_vals, *self.func_args, **self.func_kwargs)<EOL>d = self.calc_residuals()<EOL>return np.dot(d.flat, d.flat)<EOL>
Takes an array param_vals, updates function, returns the new error