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
    