rte-france / relife

ReLife is an open source Python library for asset management based on reliability theory and lifetime data analysis.
Apache License 2.0
17 stars 2 forks source link

Numerical instability in the derivative of the upper gamma function #10

Open AlexisFremond opened 1 year ago

AlexisFremond commented 1 year ago

The computation of the derivative of the upper gamma function in

def _jac_uppergamma_c(c: np.ndarray, x: np.ndarray) -> np.ndarray:
     return shifted_laguerre(lambda s: np.log(s) * s ** (c - 1), x, ndim=np.ndim(x))

is unstable for low values of the parameters. The numerical result diverges from the true value as parameters go to 0. Test example : c = 0.001, x = 0.002.