modif in error computing

modified the function for computing error by linear approximation in
order to take into account the key/time of the data sample