1313class MaximumStatistics :
1414 """Recurrence statistics for a sample of maximum values.
1515
16+ All statistics are computed based on a fitted continuous probability
17+ distribution. Results will only be meaningful if this fitted distribution
18+ is representative of the sample statistics.
19+
20+ Use, e.g., to compute expected return periods of extreme precipitation or
21+ flooding events based on past observations.
22+
1623 Parameters
1724 ----------
1825 sample: array_like
@@ -22,18 +29,10 @@ class MaximumStatistics:
2229 The axis along which to compute the statistics.
2330 freq: number | timedelta
2431 Temporal frequency of the input data. Used to scale return periods.
25- Defaults to 1, i.e., no scaling applied. When supplying a numpy
26- timedelta64, unit carries over to return periods, so make sure the
27- resolution is sufficient.
32+ Defaults to 1, i.e., no scaling applied. Note: when supplying a numpy
33+ timedelta64, the unit carries over to return periods.
2834 dist:
2935 Continuous probability distribution fitted to the input data.
30-
31- All statistics are computed based on a fitted continuous probability
32- distribution. Results will only be meaningful if this fitted distribution
33- is representative of the sample statistics.
34-
35- Use, e.g., to compute expected return periods of extreme precipitation or
36- flooding events based on past observations.
3736 """
3837
3938 def __init__ (self , sample , axis = 0 , freq = 1.0 , dist = MaxGumbel ):
@@ -43,7 +42,7 @@ def __init__(self, sample, axis=0, freq=1.0, dist=MaxGumbel):
4342
4443 @property
4544 def dist (self ):
46- """Estimated ontinuous probability distribution for the data."""
45+ """Estimated continuous probability distribution for the data."""
4746 return self ._dist
4847
4948 @property
@@ -56,13 +55,14 @@ def probability_of_threshold(self, threshold):
5655
5756 Parameters
5857 ----------
59- threshold: array_like
58+ threshold: Number | array_like
6059 Input threshold.
6160
6261 Returns
6362 -------
64- The probability ([0, 1]) of a value to exceed the input threshold in a
65- time interval.
63+ array_like
64+ The probability ([0, 1]) of a value to exceed the input threshold
65+ in a time interval.
6666 """
6767 return self .dist .cdf (threshold )
6868
@@ -71,12 +71,13 @@ def return_period_of_threshold(self, threshold):
7171
7272 Parameters
7373 ----------
74- threshold: array_like
74+ threshold: Number | array_like
7575 Input threshold.
7676
7777 Returns
7878 -------
79- The return period of the input threshold.
79+ array_like
80+ The return period of the input threshold.
8081 """
8182 return self .freq / self .probability_of_threshold (threshold )
8283
@@ -85,12 +86,14 @@ def threshold_of_probability(self, probability):
8586
8687 Parameters
8788 ----------
88- probability: array_like
89+ probability: Number | array_like
8990 Input probability.
9091
9192 Returns
9293 -------
93- Threshold with exceedance probability equal to the input probability.
94+ array_like
95+ Threshold with exceedance probability equal to the input
96+ probability.
9497 """
9598 return self .dist .ppf (probability )
9699
@@ -99,11 +102,12 @@ def threshold_of_return_period(self, return_period):
99102
100103 Parameters
101104 ----------
102- return_period: array_like
105+ return_period: Number | array_like
103106 Input return period.
104107
105108 Returns
106109 -------
107- Threshold with return period equal to the input return period.
110+ array_like
111+ Threshold with return period equal to the input return period.
108112 """
109113 return self .threshold_of_probability (self .freq / return_period )
0 commit comments