length(deltas)
    delta = deltas(i);
    modelHuber = linregRobustHuberFit(Xtrain, y, delta);
    yhatHuber{i} = linregPredict(modelHuber, Xtest); %#ok
end

%% Laplace and student on same plot
legendStr ={'least squares', 'laplace', ...
    sprintf('student, %s=%3.1f', '\nu', modelStudent.dof), ...
    sprintf('Huber, %s=%3.1f', '\delta', deltas(1))
    };
doPlot(x, y,  {yhatLS, yhatLaplace, yhatStudent,...
    yhatHuber{1}}, ...
    legendStr)
printPmtkFigure('linregRobustAll')


end

%%%

function doPlot