bluemath_tk.distributions package
Submodules
bluemath_tk.distributions.copula module
bluemath_tk.distributions.gev module
- class bluemath_tk.distributions.gev.GEV[source]
Bases:
BaseDistribution
Generalized Extreme Value (GEV) distribution class.
This class contains all the methods assocaited to the GEV distribution.
Notes
This class is designed to obtain all the properties associated to the GEV distribution.
Examples
>>> from bluemath_tk.distributions.gev import GEV >>> gev_pdf = GEV.pdf(x, loc=0, scale=1, shape=0.1) >>> gev_cdf = GEV.cdf(x, loc=0, scale=1, shape=0.1) >>> gev_qf = GEV.qf(p, loc=0, scale=1, shape=0.1)
- static cdf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Cumulative distribution function
- Parameters:
x (np.ndarray) – Values to compute their probability
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
p – Probability
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static fit(data: ndarray, **kwargs) FitResult [source]
Fit GEV distribution
- Parameters:
data (np.ndarray) – Data to fit the GEV distribution
**kwargs (dict, optional) – Additional keyword arguments for the fitting function. These can include options like method, bounds, etc. See fit_dist for more details. If not provided, default fitting options will be used.
- Returns:
Result of the fit containing the parameters loc, scale, shape, success status, and negative log-likelihood value.
- Return type:
FitResult
- static mean(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Mean
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
mean – Mean value of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static median(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Median
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
median – Median value of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static nll(data: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Negative Log-Likelihood function
- Parameters:
data (np.ndarray) – Data to compute the Negative Log-Likelihood value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
nll – Negative Log-Likelihood value
- Return type:
float
- static pdf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Probability density function
- Parameters:
x (np.ndarray) – Values to compute the probability density value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
pdf – Probability density function values
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static qf(p: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Quantile function (Inverse of Cumulative Distribution Function)
- Parameters:
p (np.ndarray) – Probabilities to compute their quantile
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
q – Quantile value
- Return type:
np.ndarray
- Raises:
ValueError – If probabilities are not in the range (0, 1).
ValueError – If scale is not greater than 0.
- static random(size: int, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0, random_state: int = None) ndarray [source]
Generates random values from GEV distribution
- Parameters:
size (int) – Number of random values to generate
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
random_state (np.random.RandomState, optional) – Random state for reproducibility. If None, do not use random stat.
- Returns:
x – Random values from GEV distribution
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static sf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Survival function (1-Cumulative Distribution Function)
- Parameters:
x (np.ndarray) – Values to compute their survival function value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
sp – Survival function value
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static stats(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) Dict[str, float] [source]
Summary statistics
Return summary statistics including mean, std, variance, etc.
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
stats – Summary statistics of GEV distribution with the given parameters
- Return type:
dict
- Raises:
ValueError – If scale is not greater than 0.
- static std(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Standard deviation
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
std – Standard Deviation of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static variance(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Variance
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
var – Variance of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
bluemath_tk.distributions.gpd module
- class bluemath_tk.distributions.gpd.GPD[source]
Bases:
BaseDistribution
Generalized Pareto Distribution (GPD) class.
This class contains all the methods assocaited to the GPD distribution.
Notes
This class is designed to obtain all the properties associated to the GPD distribution.
Examples
>>> from bluemath_tk.distributions.gpd import GPD >>> gpd_pdf = GPD.pdf(x, loc=0, scale=1, shape=0.1) >>> gpd_cdf = GPD.cdf(x, loc=0, scale=1, shape=0.1) >>> gpd_qf = GPD.qf(p, loc=0, scale=1, shape=0.1)
- static cdf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Cumulative distribution function
- Parameters:
x (np.ndarray) – Values to compute their probability
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
p – Probability
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static fit(data: ndarray, **kwargs) FitResult [source]
Fit GEV distribution
- Parameters:
data (np.ndarray) – Data to fit the GEV distribution
**kwargs (dict, optional) – Additional keyword arguments for the fitting function. These can include options like method, bounds, etc. See fit_dist for more details. If not provided, default fitting options will be used.
- Returns:
Result of the fit containing the parameters loc, scale, shape, success status, and negative log-likelihood value.
- Return type:
FitResult
- static mean(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Mean
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
mean – Mean value of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
Warning – If shape is greater than or equal to 1, mean is not defined. In this case, it returns infinity.
- static median(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Median
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
median – Median value of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static nll(data: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Negative Log-Likelihood function
- Parameters:
data (np.ndarray) – Data to compute the Negative Log-Likelihood value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
nll – Negative Log-Likelihood value
- Return type:
float
- static pdf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Probability density function
- Parameters:
x (np.ndarray) – Values to compute the probability density value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
pdf – Probability density function values
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static qf(p: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Quantile function (Inverse of Cumulative Distribution Function)
- Parameters:
p (np.ndarray) – Probabilities to compute their quantile
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
q – Quantile value
- Return type:
np.ndarray
- Raises:
ValueError – If probabilities are not in the range (0, 1).
ValueError – If scale is not greater than 0.
- static random(size: int, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0, random_state: int = None) ndarray [source]
Generates random values from GPD distribution
- Parameters:
size (int) – Number of random values to generate
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
random_state (np.random.RandomState, optional) – Random state for reproducibility. If None, do not use random stat.
- Returns:
x – Random values from GEV distribution
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static sf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Survival function (1-Cumulative Distribution Function)
- Parameters:
x (np.ndarray) – Values to compute their survival function value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
sp – Survival function value
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static stats(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) Dict[str, float] [source]
Summary statistics
Return summary statistics including mean, std, variance, etc.
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
stats – Summary statistics of GEV distribution with the given parameters
- Return type:
dict
- Raises:
ValueError – If scale is not greater than 0.
- static std(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Standard deviation
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
std – Standard Deviation of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static variance(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Variance
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
var – Variance of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
Warning – If shape is greater than or equal to 172, mean is not defined. In this case, it returns infinity.
bluemath_tk.distributions.poisson module
bluemath_tk.distributions.pot module
Module contents
Project: BlueMath_tk Sub-Module: distributions Author: GeoOcean Research Group, Universidad de Cantabria Repository: https://github.com/GeoOcean/BlueMath_tk.git Status: Under development (Working)
- class bluemath_tk.distributions.GEV[source]
Bases:
BaseDistribution
Generalized Extreme Value (GEV) distribution class.
This class contains all the methods assocaited to the GEV distribution.
Notes
This class is designed to obtain all the properties associated to the GEV distribution.
Examples
>>> from bluemath_tk.distributions.gev import GEV >>> gev_pdf = GEV.pdf(x, loc=0, scale=1, shape=0.1) >>> gev_cdf = GEV.cdf(x, loc=0, scale=1, shape=0.1) >>> gev_qf = GEV.qf(p, loc=0, scale=1, shape=0.1)
- static cdf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Cumulative distribution function
- Parameters:
x (np.ndarray) – Values to compute their probability
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
p – Probability
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static fit(data: ndarray, **kwargs) FitResult [source]
Fit GEV distribution
- Parameters:
data (np.ndarray) – Data to fit the GEV distribution
**kwargs (dict, optional) – Additional keyword arguments for the fitting function. These can include options like method, bounds, etc. See fit_dist for more details. If not provided, default fitting options will be used.
- Returns:
Result of the fit containing the parameters loc, scale, shape, success status, and negative log-likelihood value.
- Return type:
FitResult
- static mean(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Mean
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
mean – Mean value of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static median(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Median
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
median – Median value of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static nll(data: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Negative Log-Likelihood function
- Parameters:
data (np.ndarray) – Data to compute the Negative Log-Likelihood value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
nll – Negative Log-Likelihood value
- Return type:
float
- static pdf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Probability density function
- Parameters:
x (np.ndarray) – Values to compute the probability density value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
pdf – Probability density function values
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static qf(p: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Quantile function (Inverse of Cumulative Distribution Function)
- Parameters:
p (np.ndarray) – Probabilities to compute their quantile
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
q – Quantile value
- Return type:
np.ndarray
- Raises:
ValueError – If probabilities are not in the range (0, 1).
ValueError – If scale is not greater than 0.
- static random(size: int, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0, random_state: int = None) ndarray [source]
Generates random values from GEV distribution
- Parameters:
size (int) – Number of random values to generate
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
random_state (np.random.RandomState, optional) – Random state for reproducibility. If None, do not use random stat.
- Returns:
x – Random values from GEV distribution
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static sf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Survival function (1-Cumulative Distribution Function)
- Parameters:
x (np.ndarray) – Values to compute their survival function value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
sp – Survival function value
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static stats(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) Dict[str, float] [source]
Summary statistics
Return summary statistics including mean, std, variance, etc.
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
stats – Summary statistics of GEV distribution with the given parameters
- Return type:
dict
- Raises:
ValueError – If scale is not greater than 0.
- static std(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Standard deviation
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
std – Standard Deviation of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static variance(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Variance
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
var – Variance of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- class bluemath_tk.distributions.GPD[source]
Bases:
BaseDistribution
Generalized Pareto Distribution (GPD) class.
This class contains all the methods assocaited to the GPD distribution.
Notes
This class is designed to obtain all the properties associated to the GPD distribution.
Examples
>>> from bluemath_tk.distributions.gpd import GPD >>> gpd_pdf = GPD.pdf(x, loc=0, scale=1, shape=0.1) >>> gpd_cdf = GPD.cdf(x, loc=0, scale=1, shape=0.1) >>> gpd_qf = GPD.qf(p, loc=0, scale=1, shape=0.1)
- static cdf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Cumulative distribution function
- Parameters:
x (np.ndarray) – Values to compute their probability
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
p – Probability
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static fit(data: ndarray, **kwargs) FitResult [source]
Fit GEV distribution
- Parameters:
data (np.ndarray) – Data to fit the GEV distribution
**kwargs (dict, optional) – Additional keyword arguments for the fitting function. These can include options like method, bounds, etc. See fit_dist for more details. If not provided, default fitting options will be used.
- Returns:
Result of the fit containing the parameters loc, scale, shape, success status, and negative log-likelihood value.
- Return type:
FitResult
- static mean(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Mean
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
mean – Mean value of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
Warning – If shape is greater than or equal to 1, mean is not defined. In this case, it returns infinity.
- static median(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Median
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
median – Median value of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static nll(data: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Negative Log-Likelihood function
- Parameters:
data (np.ndarray) – Data to compute the Negative Log-Likelihood value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
nll – Negative Log-Likelihood value
- Return type:
float
- static pdf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Probability density function
- Parameters:
x (np.ndarray) – Values to compute the probability density value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
pdf – Probability density function values
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static qf(p: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Quantile function (Inverse of Cumulative Distribution Function)
- Parameters:
p (np.ndarray) – Probabilities to compute their quantile
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
q – Quantile value
- Return type:
np.ndarray
- Raises:
ValueError – If probabilities are not in the range (0, 1).
ValueError – If scale is not greater than 0.
- static random(size: int, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0, random_state: int = None) ndarray [source]
Generates random values from GPD distribution
- Parameters:
size (int) – Number of random values to generate
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
random_state (np.random.RandomState, optional) – Random state for reproducibility. If None, do not use random stat.
- Returns:
x – Random values from GEV distribution
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static sf(x: ndarray, loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) ndarray [source]
Survival function (1-Cumulative Distribution Function)
- Parameters:
x (np.ndarray) – Values to compute their survival function value
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
sp – Survival function value
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static stats(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) Dict[str, float] [source]
Summary statistics
Return summary statistics including mean, std, variance, etc.
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
stats – Summary statistics of GEV distribution with the given parameters
- Return type:
dict
- Raises:
ValueError – If scale is not greater than 0.
- static std(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Standard deviation
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
std – Standard Deviation of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
- static variance(loc: float = 0.0, scale: float = 1.0, shape: float = 0.0) float [source]
Variance
- Parameters:
loc (float, default=0.0) – Location parameter
scale (float, default = 1.0) – Scale parameter. Must be greater than 0.
shape (float, default = 0.0) – Shape parameter.
- Returns:
var – Variance of GEV with the given parameters
- Return type:
np.ndarray
- Raises:
ValueError – If scale is not greater than 0.
Warning – If shape is greater than or equal to 172, mean is not defined. In this case, it returns infinity.