I am writing a function which computes sum of squares of errors. x
and y
are vectors of the same length; y
is observation data, x
is data computed by my model.
The code is like:
>> res = y.ravel() - x.ravel()
>> np.dot(res.T, res)
>> 1026.7059479504269
>> np.sum(res**2)
>> 1026.7059479504273
Now look at the last two digits. Can anyone tell me what is the reason for it? Both calls should result in the same operations. Does anyone know where this difference comes from?