-
Notifications
You must be signed in to change notification settings - Fork 9
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
Problem with Example #2
Comments
It seems you are using the pip version of the code. Please use the latest code on github. Pip code has a few issues which have been resolved. However, I have not pushed the latest version to pip as the normal correction for multi-dimensional data is still not working. Will push the code to pip once this issue is resolved. Thanks |
Hello |
You could have a single excel file for model, reference and data_to_be_corrected or separate files for all these three. However, model and reference should have some overlap time period. In short, model and reference are datasets which you use to find bias and then this bias is used to correct the data_to_be_corrected. |
Thanks for your answer |
MODEL.txt Here are the requested files. Hope it's useful. Thanks |
Yes this is one error about ax.legend() |
Hello, Thank you for sharing your bias correction programs
I am following the example from https://github.com/pankajkarman/bias_correction/blob/master/example.ipynb.
However, when I get some error when I try to bias correction by using this command: df2 = bc.correct(method='basic_quantile').
The error as followed:
ValueError Traceback (most recent call last)
in ()
----> 1 df1 = bc.correct(method='basic_quantile')
~/anaconda3/lib/python3.7/site-packages/bias_correction.py in correct(self, method, lower_limit, cdf_threshold)
136 cdf_threshold=cdf_threshold)
137 elif method == 'basic_quantile':
--> 138 corrected = quantile_correction(self.obs_data, self.mod_data, self.sce_data, modified = False)
139 else:
140 corrected = quantile_correction(self.obs_data, self.mod_data, self.sce_data, modified = True)
~/anaconda3/lib/python3.7/site-packages/bias_correction.py in quantile_correction(obs_data, mod_data, sce_data, modified)
15
16 def quantile_correction(obs_data, mod_data, sce_data, modified = True):
---> 17 cdf = ECDF(mod_data)
18 p = cdf(sce_data)
19 cor = np.subtract(*[np.nanpercentile(x, p) for x in [obs_data, mod_data]])
~/anaconda3/lib/python3.7/site-packages/statsmodels/distributions/empirical_distribution.py in init(self, x, side)
139 nobs = len(x)
140 y = np.linspace(1./nobs,1,nobs)
--> 141 super(ECDF, self).init(x, y, side=side, sorted=True)
142 else:
143 return interp1d(x,y,drop_errors=False,fill_values=ival)
~/anaconda3/lib/python3.7/site-packages/statsmodels/distributions/empirical_distribution.py in init(self, x, y, ival, sorted, side)
87 if _x.shape != _y.shape:
88 msg = "x and y do not have the same shape"
---> 89 raise ValueError(msg)
90 if len(_x.shape) != 1:
91 msg = 'x and y must be 1-dimensional'
ValueError: x and y do not have the same shape
I was wondering how can I fix this issue.
Thank you in advance
The text was updated successfully, but these errors were encountered: