-
Notifications
You must be signed in to change notification settings - Fork 59
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
SPI index error: FitError: Optimization converged to parameters that are outside the range allowed by the distribution. #1567
Comments
Hi @PraewKPT, This error does not ring a bell to me, but may be my colleague who coded SPI knows about it. In any case, would you be able to provide a minimal example that raises the error ? What data are you using, is it shareable ? Could you show us what code you have and which parameters you use ? Thanks. |
Hi! It seems like a scipy error. I'll wait for details. It could be a bug on our side, but I suspect it could also be the data that is hard to fit? We'll see. |
Thank you for your help. I am new to SPI.
|
Hi @PraewKPT, thanks for sharing more info.
pr = pr.isel(lat=slice(100,120), lon=slice(100,120)) # or something else that makes sense in your context and see if you still have the error. Maybe your problem only happens on a few pixels and it would be hard to find it, so if you're not successful after trying a couple small regions, don't lose too much time on this. But if it works, it would be nice if you can simply share a small .nc file here. Cheers! |
Hi @coxipi , thank you for your advice. |
The method "APP" is an approximation. In the case of the gamma distribution, it's based on an approximation of the maximum likelihood formulation of the gamma parameters, see eq.22 here |
Setup Information
INSTALLED VERSIONS
python: 3.11.7
boltons: installed
bottleneck: 1.3.7
cf_xarray: 0.8.7
cftime: 1.6.2
click: 8.1.6
clisops: None
dask: 2022.02.0
flox: None
jsonpickle: 3.0.2
lmoments3: 1.0.6
numba: 0.58.1
pandas: 2.1.4
pint: 0.23
scipy: 1.9.3
sklearn: 1.3.2
statsmodels: 0.14.0
xarray: 2023.11.0
xclim: 0.47.0
Anaconda-based environment: no
Context
How can I fix this problem?
"FitError: Optimization converged to parameters that are outside the range allowed by the distribution."
I don't know where is the problem from?
Code of Conduct
The text was updated successfully, but these errors were encountered: