Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion standard_precip/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ def best_fit_distribution(data: np.array, dist_list: list, fit_type: str='lmom',
sse: dict (key - distribution, value - sum of square error)
The sum of the squares error between fitted distribution and pdf.
'''
from standard_precip.lmoments import distr
y, x = np.histogram(data, bins=bins, normed=True)
x = (x + np.roll(x, -1))[:-1] / 2.0

sse = {}
fig, ax = plt.subplots()
ax.bar(x, y, width=0.5, align='center', color='b', alpha=0.5, label='data')
ax.scatter(x, y, color='b', alpha=1, label='data')

for dist_name in dist_list:
distrb = getattr(distr, dist_name)
Expand Down