function chisq = BindingChiSq(x,y, Kd)
%This function will compute the Chi sq of the function given a set of data
%points and will return this fit. It takes three arguments, the x and y
%data points, and Kd (the fit parameter).
%Calculate the value of our binding curve at each x value.
theoryAtX = (x/Kd) ./ (1 + x/Kd);
%The theoryAtX is the predicted y value. Now we will compute thesquare of
%the difference between our actual y value and the theoretical value.
chisq = sum((y - theoryAtX).^2);
end