climate_indices
climate_indices copied to clipboard
Add a log-logistic distribution fitting
It's been shown that a log-logistic distribution fitting is optimal for SPEI calculations. Let's add this to complement the gamma and Pearson III distribution fittings we already have available. This may already be available in some form in statsmodels or SciPy, we should investigate there before rolling our own.
Apparently, the log-logistic distribution is also referred to as the Fisk distribution, available within SciPy.
Related to issue #190.
I created a draft (there are some minor issues) pull request for a Fisk implementation in #440 However, looking into the R code some more, I realised that the R SPEI package uses a generalised logistic distribution, more similar to genlogistic in SciPy than to Fisk. The distributions might be similar when c=-/k, but I am not certain.
Thanks for your work on this @Emmadd
Is it useful for us to also provide a generalized logistic distribution? I'd like to include it if so, but only if truly useful as it will add maintenance cost, and this project is already due significant maintenance, we don't want to add even more technical debt.
I don't think so. But if someone with more statistical knowledge thinks otherwise it would be good to know.
After some further investigation it seems the python SciPy Fisk option is the better one to use. The genlogistic in python is a special generalised logistic distribution, not THE generalised logistic distribution that R uses, which resembles Fisk. So #440 can be continued.