-
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
Support freq="W" in standardized indices #1952
Conversation
All in all, the weekly resampling seems to work well. On the question of the treatment of zeroes, climate-indices, R package, and xclim, all seem to work differently. I'm starting to think I have the right implementation, but if anyone wants to chip in, I would be glad if someone wants to give a fresh look on this |
Co-authored-by: Trevor James Smith <[email protected]>
If the calendar is not appropriate, there will simply be problems with resampling or groupby ? Is that sufficient for documentation purposes? |
I would say yes. Xarray will fail. The error is W (business week) doesn't make sense in non-real calendars, I think users would be aware of that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! But I thought the solution for lmoments3 was the opposite.
Co-authored-by: Pascal Bourgault <[email protected]>
for more information, see https://pre-commit.ci
I don't know why #1892 was not closed, I thought it was automatic |
Pull Request Checklist:
number
) and pull request (:pull:number
) has been addedWhat kind of change does this PR introduce?
Does this PR introduce a breaking change?
No
Other information:
I realize that xclim and climate_indices treat zero-inflated distributions differently. I will investigate which library does it correctly and include changes if needed
EDIT: I believe
xclim
has the correct implementation. The probability of zeroes should be determined in the fitting procedure, not by using the full dataset. The idea is when you compute a CDF, a zero value should be mapped to theprob_of_zero
in the calibration period. That is the same logic as using the fitting params of the distribution in the calibration period to compute the CDF in the full dataset.I confirmed this is also how it's done in the case of the R package (SPEI), although I find some steps a bit weird, but I'm not too familiar with R.