Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with convergence of ParametricLifetimeDistribution.fit() #5

Open
figolus opened this issue Aug 18, 2022 · 0 comments
Open

Issue with convergence of ParametricLifetimeDistribution.fit() #5

figolus opened this issue Aug 18, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@figolus
Copy link
Collaborator

figolus commented Aug 18, 2022

Some issues may happen when fitting data. There is a convergence problem using with the minimize function of scipy.
Here is an example with Gompertz distribution:

from relife import *

weibull = Weibull(c=7.531, rate=0.037)
rtf = RunToFailure(weibull, cf=1)

datagen = rtf.sample(T=300, n_samples=100, random_state=0)
time, event, entry = datagen.to_lifetime_data(t0=0,tf=30).astuple()
gompertz = Gompertz().fit(time,event,entry)

/home/xxx/.local/lib/python3.8/site-packages/relife/parametric.py:347: RuntimeWarning: invalid value encountered in sqrt
self.se = np.sqrt(np.diag(self.var))

Problem may be solved by improving the initialization "params0" and/or using another type of solver (by default L-BFGS).

@figolus figolus added the bug Something isn't working label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants