-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Labels
feature requestRequest for a new featureRequest for a new feature
Description
Error Description
It is possible for the BetaUnivariate to raise an error when fitting to some data:
from copulas.univariate import BetaUnivariate
BetaUnivariate().fit(np.array([0.7122827 , 0.04830956, 0.54410219, 0.04173127, 0.54462469, 0.54565197, 0.05497849, 0.07792652, 0.6817948 , 0.19735519]))
# Fails with the following:
scipy.stats._warnings_errors.FitError: Optimization converged to parameters that are outside the range allowed by the distribution.The error happens when fitting the univariate in the following line:
Copulas/copulas/univariate/beta.py
Line 30 in a168631
| a, b, loc, scale = beta.fit(X, loc=loc, scale=scale) |
Expected Behavior
Investigate what causes scipy to fail and what can be done to improve the convergence rate.
Additional Context
This happens because "scipy.stats.fit doesn't guarantee success".
Note: On the rare occasion when this error happens, the synthesizers - either in Copulas or in SDV - would still work, since they have a fallback distribution for such cases.
Metadata
Metadata
Assignees
Labels
feature requestRequest for a new featureRequest for a new feature