https://github.com/corentinravoux/flip/blob/fb90d4d8920513a46a9405d16ec82a25a293477f/flip/fitter.py#L279