function for epsilon fitting from chunked data