error calculation from the overlap function as in holger phd thesis.