This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/statistics-fabian/matlab/lserr.m

6 lines
167 B
Matlab

function [err, grad] = lserr(x, y, param)
err = mean( (param(1)*x + param(2) - y).^2 );
if nargout == 2
grad = lserr_gradient(param, x,y);
end