function resvec = build_residual(xs,ts,ys)
    m = length(ts);
    resvec = zeros(m,1);
    for i=1:m
        t = ts(i);
        y = ys(i);
        resvec(i) = y - evalF(xs,t);
    end
end
