climate_indices icon indicating copy to clipboard operation
climate_indices copied to clipboard

Add a log-logistic distribution fitting

Open monocongo opened this issue 6 years ago • 6 comments

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.

monocongo avatar Apr 23 '18 20:04 monocongo

Apparently, the log-logistic distribution is also referred to as the Fisk distribution, available within SciPy.

monocongo avatar Apr 23 '18 20:04 monocongo

Related to issue #190.

monocongo avatar Oct 03 '18 13:10 monocongo

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.

Emmadd avatar Aug 26 '21 10:08 Emmadd

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.

monocongo avatar Aug 26 '21 12:08 monocongo

I don't think so. But if someone with more statistical knowledge thinks otherwise it would be good to know.

Emmadd avatar Aug 26 '21 16:08 Emmadd

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.

Emmadd avatar Sep 02 '21 06:09 Emmadd