gev_return_level#
- gpjax.distributions.gev_return_level(return_period, loc, scale, concentration)[source]#
The GEV return level for a return period.
The return level \(z_T\) is the level that the annual maximum exceeds with probability \(1/T\), that is, on average once in \(T\) years:
\[z_T = \mu - \frac{\sigma}{\xi}\left[1 - \{-\log(1 - 1/T)\}^{-\xi}\right], \qquad z_T = \mu - \sigma \log\{-\log(1 - 1/T)\} \quad (\xi = 0).\]The function is accurate and has finite gradients for all \(\xi\), including \(\xi = 0\), and for large \(T\). All arguments broadcast with the NumPy rules. Thus a user who has samples of \((\mu, \sigma, \xi)\) from any source gets samples of the return level.
Example
>>> import jax.numpy as jnp >>> from gpjax.distributions import gev_return_level >>> periods = jnp.array([10.0, 100.0]) >>> levels = gev_return_level(periods, loc=40.0, scale=12.0, ... concentration=0.1) >>> levels.shape (2,)
- Parameters:
return_period (float | int | Float[jaxlib._jax.Array, '...'] | Float[ndarray, '...'] | Int[jaxlib._jax.Array, '...'] | Int[ndarray, '...']) – The return period \(T > 1\), in blocks (for example, years for annual maxima). \(T = 1\) gives the lower end point and \(T = \infty\) the upper end point; \(T < 1\) gives NaN.
loc (float | int | Float[jaxlib._jax.Array, '...'] | Float[ndarray, '...'] | Int[jaxlib._jax.Array, '...'] | Int[ndarray, '...']) – The location \(\mu\).
scale (float | int | Float[jaxlib._jax.Array, '...'] | Float[ndarray, '...'] | Int[jaxlib._jax.Array, '...'] | Int[ndarray, '...']) – The scale \(\sigma > 0\).
concentration (float | int | Float[jaxlib._jax.Array, '...'] | Float[ndarray, '...'] | Int[jaxlib._jax.Array, '...'] | Int[ndarray, '...']) – The shape \(\xi\). \(\xi > 0\) is the heavy-tailed (Fréchet) type and \(\xi < 0\) the bounded (Weibull) type. This is the climate convention;
scipy.stats.genextremeuses \(c = -\xi\).
- Returns:
The return levels, with the broadcast shape of the arguments.
- Return type:
Float[jaxlib._jax.Array, ‘…’] | Float[ndarray, ‘…’]
Expand for references to
gpjax.distributions.gev_return_level