Extreme Value Parameters#
statista.parameters.extreme_value
#
L-moments parameter estimation for extreme value distributions.
Distributions: GEV, Gumbel, Generalized Pareto.
gev(lmoments)
#
Estimate parameters for the Generalized Extreme Value (GEV) distribution.
The Generalized Extreme Value distribution combines the Gumbel, Frechet, and Weibull distributions into a single family to model extreme values. The distribution is characterized by three parameters: shape, location, and scale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lmoments
|
list[float | int]
|
A list of L-moments [l1, l2, l3, ...] where: - l1 is the mean (first L-moment) - l2 is the L-scale (second L-moment) - l3 is the L-skewness (third L-moment) At least 3 L-moments must be provided. |
required |
Returns:
| Type | Description |
|---|---|
list[float | int]
|
A list of distribution parameters [shape, location, scale] where: - shape: Controls the tail behavior of the distribution - location: Shifts the distribution along the x-axis - scale: Controls the spread of the distribution |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the L-moments are invalid (l2 <= 0 or |l3| >= 1). |
ConvergenceError
|
If the parameter estimation algorithm fails to converge. |
Examples:
- Estimate GEV parameters from L-moments:
- Calculate L-moments from data
-
Estimate GEV parameters
-
Using predefined L-moments:
- Predefined L-moments
- Estimate GEV parameters
Note
The GEV distribution has the cumulative distribution function: F(x) = exp(-[1 + xi((x-mu)/sigma)]^(-1/xi)) for xi != 0 F(x) = exp(-exp(-(x-mu)/sigma)) for xi = 0 (Gumbel case)
Where xi is the shape parameter, mu is the location parameter, and sigma is the scale parameter.
Source code in src/statista/parameters/extreme_value.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
gumbel(lmoments)
#
Estimate parameters for the Gumbel distribution.
The Gumbel distribution (also known as the Type I Extreme Value distribution) is used to model the maximum or minimum of a number of samples of various distributions. It is characterized by two parameters: location and scale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lmoments
|
list[float | int]
|
A list of L-moments [l1, l2, ...] where: - l1 is the mean (first L-moment) - l2 is the L-scale (second L-moment) At least 2 L-moments must be provided. |
required |
Returns:
| Type | Description |
|---|---|
list[float | int]
|
A list of distribution parameters [location, scale] where: - location: Shifts the distribution along the x-axis - scale: Controls the spread of the distribution |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the L-moments are invalid (l2 <= 0). |
Examples:
- Estimate Gumbel parameters from L-moments:
- Calculate L-moments from data
-
Estimate Gumbel parameters
-
Using predefined L-moments:
- Predefined L-moments
- Estimate Gumbel parameters
Note
The Gumbel distribution has the cumulative distribution function: F(x) = exp(-exp(-(x-mu)/beta))
Where mu is the location parameter and beta is the scale parameter.
The Gumbel distribution is a special case of the GEV distribution with shape parameter = 0.
Source code in src/statista/parameters/extreme_value.py
generalized_pareto(lmoments)
#
Estimate parameters for the Generalized Pareto distribution.
The Generalized Pareto distribution is a flexible three-parameter family of distributions used to model the tails of other distributions. It is characterized by location, scale, and shape parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lmoments
|
list[float | int]
|
A list of L-moments [l1, l2, l3, ...] where: - l1 is the mean (first L-moment) - l2 is the L-scale (second L-moment) - l3 is the L-skewness (third L-moment) At least 3 L-moments must be provided. |
required |
Returns:
| Type | Description |
|---|---|
list[float] | None
|
A list of distribution parameters [location, scale, shape] where: - location: Shifts the distribution along the x-axis (lower bound) - scale: Controls the spread of the distribution - shape: Controls the tail behavior of the distribution |
list[float] | None
|
Returns None if the L-moments are invalid. |
Examples:
- Estimate Generalized Pareto parameters from L-moments:
- Calculate L-moments from data
-
Estimate Generalized Pareto parameters
-
Using predefined L-moments:
- Predefined L-moments
- Estimate Generalized Pareto parameters
Note
The Generalized Pareto distribution has the cumulative distribution function: F(x) = 1 - [1 - k(x-mu)/alpha]^(1/k) for k != 0 F(x) = 1 - exp(-(x-mu)/alpha) for k = 0
Where mu is the location parameter, alpha is the scale parameter, and k is the shape parameter.
The method returns None if: - The second L-moment (l2) is less than or equal to zero - The absolute value of the third L-moment (l3) is greater than or equal to 1
These conditions indicate invalid L-moments for the Generalized Pareto distribution.
The shape parameter determines the tail behavior: - k < 0: The distribution has an upper bound - k = 0: The distribution is exponential - k > 0: The distribution has a heavy upper tail
Source code in src/statista/parameters/extreme_value.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | |