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/matlab/lserr_gradient.m
Fabian Sinz 763b332eea done
2014-10-16 17:53:22 +02:00

10 lines
241 B
Matlab

function grad = lserr_gradient(param, x, y)
h = 1e-6;
grad = 0*param;
for i = 1:length(param)
paramh = param;
paramh(i) = param(i) + h;
grad(i) = (lserr(paramh,x,y) - lserr(param,x,y))/h;
end