You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, SPEI relies on an offset to shift the water budget to positive values for zero-bounded statistical distributions. The offset was currently hardcoded as in the monocongo/climate_indices library : 1mm/d.
This can be insufficient, as seen in #1474 where a greater shift was needed.
There was already some plan to let this offset parameter available to user as an argument in SPEI function #1311.
scipy has a parameter loc that could be used to remove the arbitrariness of the offset used. However, if a certain loc is computed, I'm not sure how things will go (there might be NaNs in the final output SPEI) for a dataset with smaller (negative) values of the water budget outside of the calibration period.
The R library has a SPEI function, as far as I can tell, there is not an offset parameter in this case. I will explore alternative ways to get SPEI values
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
The paper introducing SPEI uses the three-parameter distribution of log-logistic (the two-parameter version only has support on positive values, where loc is the third parameter ). I think we should just go with this way of proceeding unless I find important issues (only one I can think of is: what happens when min(all data) < loc < min(calibration data) , I should check this.
<!-- Please ensure the PR fulfills the following requirements! -->
<!-- If this is your first PR, make sure to add your details to the
AUTHORS.rst! -->
### Pull Request Checklist:
- [x] This PR addresses an already opened issue (for bug fixes /
features)
- This PR fixes #xyz
- [x] (If applicable) Documentation has been added / updated (for bug
fixes / features).
- [x] (If applicable) Tests have been added.
- [x] CHANGES.rst has been updated (with summary of main changes).
- [x] Link to issue (:issue:`number`) and pull request (:pull:`number`)
has been added.
### What kind of change does this PR introduce?
* Tests for the GIS module were too strict.
* Changes were made in `xclim v0.49.0` with how the `gamma` and `fisk`
distributions were initiated in `xclim`, which changed the fitting
results and parametric quantiles. It just so happened that we
arbitrarily used the `gamma` for our tests. To be backwards-compatible,
those tests were changed to the `gumbel_r`.
### Does this PR introduce a breaking change?
- No.
### Other information:
Changes to the `gamma` distribution:
Ouranosinc/xclim#1477Ouranosinc/xclim#1720
Generic Issue
Currently, SPEI relies on an offset to shift the water budget to positive values for zero-bounded statistical distributions. The offset was currently hardcoded as in the monocongo/climate_indices library : 1mm/d.
This can be insufficient, as seen in #1474 where a greater shift was needed.
There was already some plan to let this offset parameter available to user as an argument in SPEI function #1311.
scipy has a parameter
loc
that could be used to remove the arbitrariness of the offset used. However, if a certainloc
is computed, I'm not sure how things will go (there might be NaNs in the final output SPEI) for a dataset with smaller (negative) values of the water budget outside of the calibration period.The R library has a SPEI function, as far as I can tell, there is not an offset parameter in this case. I will explore alternative ways to get SPEI values
Code of Conduct
The text was updated successfully, but these errors were encountered: