plans.stochastic.frequency#
Exceedance probabilities, return periods and the Gumbel model.
Formulas use \(r\) for the rank (1 is the largest value), \(n\) for the sample size, \(s\) for the standard deviation and \(T\) for the return period.
Functions
|
Get the empirical exceedance probability P(X) |
|
Get the Gumbel CDF for the data (it assumes that is a maxima dataset). |
|
Get the Weibull model for the data. |
|
Get data frequencies. |
|
Simple function for computing the Return Period from the CDF |
|
Get the Gringorten exceedance probability P(X) |
|
Gumbel Frequency Factor K(T) |
|
Gumbel probability distribution F(X) |
|
Gumbel Standard Error for the MM fitted Gumbel function |
|
Gumbel return period distribution T(X) |
|
Get the Weibull exceedance probability P(X) |
- plans.stochastic.frequency.get_tx(fx)[source]#
Simple function for computing the Return Period from the CDF
\[T = \frac{1}{1 - F}\]- Parameters:
fx (float |
numpy.ndarray) – CDF (FX)- Returns:
Return Period
- Return type:
float |
numpy.ndarray
- plans.stochastic.frequency.gumbel_fx(x, a, b)[source]#
Gumbel probability distribution F(X)
\[F(x) = \exp\left[ -\exp\left( -\frac{x - a}{b} \right) \right]\]- Parameters:
x (float |
numpy.ndarray) – function inputsa (float) – distribution parameter a
b (float) – distribution parameter b
- Returns:
function output
- Return type:
float |
numpy.ndarray
- plans.stochastic.frequency.gumbel_tx(x, a, b)[source]#
Gumbel return period distribution T(X)
\[T(x) = \frac{1}{1 - F(x)}\]- Parameters:
x (float |
numpy.ndarray) – function inputsa (float) – distribution parameter a
b (float) – distribution parameter b
- Returns:
function output
- Return type:
float |
numpy.ndarray
- plans.stochastic.frequency.gumbel_freqfactor(tx=2)[source]#
Gumbel Frequency Factor K(T)
\[K_T = -\frac{\sqrt{6}}{\pi} \left[ 0.5772 + \ln \ln \left( \frac{T}{T - 1} \right) \right]\]- Parameters:
tx (float |
numpy.ndarray) – return period T- Returns:
function output
- Return type:
float |
numpy.ndarray
- plans.stochastic.frequency.gumbel_se(std_sample, n_sample, tx)[source]#
Gumbel Standard Error for the MM fitted Gumbel function
\[S_e = \frac{s}{\sqrt{n}} \sqrt{1 + 1.14 K_T + 1.1 K_T^2}\]- Parameters:
std_sample (float) – sample standard deviation
n_sample (int) – sample size
tx (float |
numpy.ndarray) – return period T
- Returns:
function output
- Return type:
float |
numpy.ndarray
- plans.stochastic.frequency.empirical_px(ranks)[source]#
Get the empirical exceedance probability P(X)
\[P(X) = \frac{r}{n}\]- Parameters:
ranks (
numpy.ndarray) – vector of ranks- Returns:
empirical exceedance probability P(X)
- Return type:
numpy.ndarray
- plans.stochastic.frequency.weibull_px(ranks)[source]#
Get the Weibull exceedance probability P(X)
\[P(X) = \frac{r}{n + 1}\]- Parameters:
ranks (
numpy.ndarray) – vector of ranks- Returns:
Weibull exceedance probability P(X)
- Return type:
numpy.ndarray
- plans.stochastic.frequency.gringorten_px(ranks)[source]#
Get the Gringorten exceedance probability P(X)
\[P(X) = \frac{r - 0.44}{n + 0.12}\]- Parameters:
ranks (
numpy.ndarray) – vector of ranks- Returns:
Gringorten exceedance probability P(X)
- Return type:
numpy.ndarray
- plans.stochastic.frequency.get_frequency(data)[source]#
Get data frequencies.
- Parameters:
data (
numpy.ndarray) – vector of data without nan values- Returns:
result dataframe
- Return type:
pandas.DataFrame
- plans.stochastic.frequency.get_cdf_weibull(data)[source]#
Get the Weibull model for the data.
\[P(X) = \frac{r}{n + 1}, \qquad F(X) = 1 - P(X)\]- Parameters:
data (
numpy.ndarray) – vector of data without nan values- Returns:
model dataframe
- Return type:
pandas.DataFrame
- plans.stochastic.frequency.get_cdf_gumbel(df, varfield)[source]#
Get the Gumbel CDF for the data (it assumes that is a maxima dataset).
Stages by return period use the frequency factor and the standard error, with Student’s t bands at confidence \(c\):
\[x_T = \bar{x} + K_T s, \qquad x_T \pm t_{(1 + c) / 2, \, n - 1} \, S_e\]- Parameters:
df (
pandas.DataFrame) – dataframe without nan values. Other columns are kept in the output.varfield (str) – name of the variable column
- Returns:
multiple results from the assessment. Keys: Data, Data_T(X), Data_QQ, Metadata
- Return type:
dict