Skip to content
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

@oliverangelil @iameztoy The newest lmoment3 package #23

Open
Koni2020 opened this issue Sep 23, 2023 · 1 comment
Open

@oliverangelil @iameztoy The newest lmoment3 package #23

Koni2020 opened this issue Sep 23, 2023 · 1 comment

Comments

@Koni2020
Copy link

          @oliverangelil @iameztoy 

Really sorry for the delay. I recently had some time to go back to this and look. I was fitting distributions using Scipy and I didn't really take the time to understand how they were fitting the distributions. The R-package and the NCAR program are using l-moments to fit the distribution.

I implemented the lmoments3 package and now the results are consistent with R and NCAR.

Thank you guys for pointing this out and I'm really sorry this took so long.

from standard_precip import spi
import numpy as np  

SPI = spi.SPI()    
rainfall_data = np.genfromtxt('data/rainfall_test2.csv', delimiter=',')
SPI.set_rolling_window_params(span=10, window_type='boxcar', center=False)
SPI.set_distribution_params(dist_type='gam')
result = SPI.calculate(rainfall_data, starting_month=1)
print (result[-10:].T)

>>> [[ 1.22413246  1.51489351  1.44305272  1.4146816   1.72507352  1.6718702
   1.83455935  1.53496329  0.76220079 -0.09562831]]

Also, I've updated for pep8 compliance and started adding testing. Please keep looking at the code and let me know if there are any other issues.

Thanks!!

Originally posted by @e-baumer in #2 (comment)

@Koni2020
Copy link
Author

Koni2020 commented Sep 23, 2023

Hi! The lmoment3 have already upgraded 1.0.6 version which supports fit 'glo' distribution based on lmoments. Request a replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant