Skip to content

Commit a878281

Browse files
authored
Merge pull request #126 from viccollado/feature/extremes
Merge Feature/extremes into develop with a stable version of NonStatGEV
2 parents d1a1f94 + 9934376 commit a878281

File tree

3 files changed

+1131
-576
lines changed

3 files changed

+1131
-576
lines changed

bluemath_tk/distributions/_base_distributions.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,13 +555,15 @@ def return_period(self, ax: plt.axes = None) -> Tuple[plt.figure, plt.axes]:
555555
else:
556556
fig = None
557557

558+
return_years = np.asarray([1.001, 1.1, 1.2, 1.3, 1.4, 1.5, 1.75, 2, 3, 4, 5, 7.5, 10, 15, 20, 25, 50, 100, 250, 500, 1000])
559+
ecdf_fitted = 1 - 1/return_years
558560
sorted_data = np.sort(self.data)
559561
exceedance_prob = 1 - self.ecdf
560562
return_period = 1 / exceedance_prob
561563

562564
ax.plot(
563-
return_period,
564-
self.dist.qf(self.ecdf, *self.params),
565+
return_years,
566+
self.dist.qf(ecdf_fitted, *self.params),
565567
color="tab:red",
566568
label="Fitted Distribution",
567569
)
@@ -577,7 +579,7 @@ def return_period(self, ax: plt.axes = None) -> Tuple[plt.figure, plt.axes]:
577579
ax.set_xscale("log")
578580
ax.set_xticks([1, 2, 5, 10, 25, 50, 100, 250, 1000, 10000])
579581
ax.set_xticklabels([1, 2, 5, 10, 25, 50, 100, 500, 1000, 10000])
580-
ax.set_xlim(right=np.max(return_period) * 1.2)
582+
# ax.set_xlim(right=np.max(return_period) * 1.2)
581583
ax.set_xlabel("Return Period")
582584
ax.set_ylabel("Data Values")
583585
ax.set_title("Return Period Plot")

0 commit comments

Comments
 (0)