function [diffs,residuals,se,sse]=compute_residuals(y_data,y_model,n)

residuals=zeros(1,n);
diffs=y_data-y_model;
for i=1:n
    residuals(i)=abs(y_data(i)-y_model(i));
end

se=sum(residuals);
sse=0;
for i=1:n
    sse=sse+residuals(i)^2;
end

