flownet.parameters.probability_distributions module
Defines the different probability distributions. These are used by the parameter class definitions.
- class flownet.parameters.probability_distributions.Constant(const)
Bases:
flownet.parameters.probability_distributions.ProbabilityDistribution
- _abc_impl = <_abc_data object>
- property ert_gen_kw: str
string representing an ERT “CONST CONSTANT” distribution keyword for use in GEN_KW
- update_distribution(minimum: Optional[float] = None, maximum: Optional[float] = None, mean: Optional[float] = None, mode: Optional[float] = None, stddev: Optional[float] = None)
Function that updates the parameters that defines the probability distribution
Providing a value for either the mean, the mode, the minimum or the maximum will change the constant value, but ONLY one value can be provided.
- Parameters
minimum – The minimum values of the updated distribution
mean – The mean value of the updated distribution
mode – The mode of the updated distribution
maximum – The maximum value of the updated distribution
stddev – The standard deviation of the updated distribution
- Returns
Nothing
- class flownet.parameters.probability_distributions.LogNormalDistribution(mean, stddev)
Bases:
flownet.parameters.probability_distributions.ProbabilityDistribution
- _abc_impl = <_abc_data object>
- property ert_gen_kw: str
string representing an ERT “LOGNORMAL MEAN STDDEV” distribution keyword for use in GEN_KW
- update_distribution(minimum: Optional[float] = None, maximum: Optional[float] = None, mean: Optional[float] = None, mode: Optional[float] = None, stddev: Optional[float] = None)
Function that updates the parameters that defines the probability distribution
In the lognormal distribution one or both of the mean and the standard deviation can be changed. Providing any other value as input here (mode, minimum, maximum) will have no effect.
- Parameters
minimum – The minimum values of the updated distribution
mean – The mean value of the updated distribution
mode – The mode of the updated distribution
maximum – The maximum value of the updated distribution
stddev – The standard deviation of the updated distribution
- Returns
Nothing
- class flownet.parameters.probability_distributions.LogUniformDistribution(minimum: Optional[float] = None, maximum: Optional[float] = None, mean: Optional[float] = None)
Bases:
flownet.parameters.probability_distributions.ProbabilityDistribution
- _abc_impl = <_abc_data object>
- _find_dist_minmax(mean_val: float, min_val: Optional[float] = None, max_val: Optional[float] = None) float
Find the distribution min or max for a loguniform distribution, assuming only one of these and the mean are given
- Parameters
min_val – minimum value for the distribution
max_val – maximum value for the distribution
mean_val – mean value for the distribution
- Returns
missing value (minimum if maximum is provided as input, maximum if minimum is provided)
- property ert_gen_kw: str
string representing an ERT “LOGUNIF MIN MAX” distribution keyword for use in GEN_KW
- update_distribution(minimum: Optional[float] = None, maximum: Optional[float] = None, mean: Optional[float] = None, mode: Optional[float] = None, stddev: Optional[float] = None)
Function that updates the parameters that defines the probability distribution
- The following input combinations will make changes to the distribution:
Giving a new minimum value as input will trigger a calculation of a new mean and stddev
Giving a new maximum value as input will trigger a calculation of a new mean and stddev
- Giving a new mean value as input requires a new minimum OR maximum value to be defined also
A new mean value and a new minimum value will trigger an update of the maximum value and the stddev
A new mean value and a new maximum value will trigger an update of the minimum value and the stddev
Providing values for stddev or mode has no effect here, since in the loguniform distribution the mode is equal to the minimum value, and the stddev is caluculated from the minimum and maximum values
Providing a new mean, a new minimum and a new maximum value (all three of them) will trigger an error
- Parameters
minimum – The minimum values of the updated distribution
mean – The mean value of the updated distribution
mode – The mode of the updated distribution
maximum – The maximum value of the updated distribution
stddev – The standard deviation of the updated distribution
- Returns
Nothing
- class flownet.parameters.probability_distributions.NormalDistribution(mean, stddev)
Bases:
flownet.parameters.probability_distributions.ProbabilityDistribution
- _abc_impl = <_abc_data object>
- property ert_gen_kw: str
string representing an ERT “NORMAL MEAN STDDEV” distribution keyword for use in GEN_KW
- update_distribution(minimum: Optional[float] = None, maximum: Optional[float] = None, mean: Optional[float] = None, mode: Optional[float] = None, stddev: Optional[float] = None)
Function that updates the parameters that defines the probability distribution.
In the normal distribution one or both of the mean and the standard deviation can be changed. Providing any other value as input here (mode, minimum, maximum) will have no effect.
- Parameters
minimum – The minimum values of the updated distribution
mean – The mean value of the updated distribution
mode – The mode of the updated distribution
maximum – The maximum value of the updated distribution
stddev – The standard deviation of the updated distribution
- Returns
Nothing
- class flownet.parameters.probability_distributions.ProbabilityDistribution(name)
Bases:
abc.ABC
- _abc_impl = <_abc_data object>
- abstract property ert_gen_kw
A string representing what ERT needs in GEN_KW
- abstract update_distribution(minimum: Optional[float], maximum: Optional[float], mean: Optional[float], mode: Optional[float], stddev: Optional[float])
Function to update parameters for the various distributions
- class flownet.parameters.probability_distributions.TriangularDistribution(minimum: Optional[float] = None, maximum: Optional[float] = None, mean: Optional[float] = None, mode: Optional[float] = None)
Bases:
flownet.parameters.probability_distributions.ProbabilityDistribution
- _abc_impl = <_abc_data object>
- defined: bool
- property ert_gen_kw: str
string representing an ERT “TRIANGULAR MIN MODE MAX” distribution keyword for use in GEN_KW
- maximum: float
- mean: float
- minimum: float
- mode: float
- name: str
- stddev: float
- update_distribution(minimum: Optional[float] = None, maximum: Optional[float] = None, mean: Optional[float] = None, mode: Optional[float] = None, stddev: Optional[float] = None)
Function that updates the parameters that defines the probability distribution
- The following input combinations will make changes to the distribution:
Giving a new minimum value as input will trigger a calculation of a new mean and stddev
Giving a new maximum value as input will trigger a calculation of a new mean and stddev
Giving a new mode as input will trigger a calculation of a new mean and stddev
Giving a new mean value as input requires a new minimum/maximum OR mode/maximum OR minimum/mode values
- to be defined also:
A new mean, minimum and mode will trigger an update of the maximum value and the stddev
A new mean, mode and maximum value will trigger an update of the minimum value and the stddev
A new mean, minimum and maximum value will trigger an update of the mode and the stddev
Providing values for stddev has no effect here.
Providing a new mean, minimum, maximum and mode (all four of them) will trigger an error
- Parameters
minimum – The minimum values of the updated distribution
mean – The mean value of the updated distribution
mode – The mode of the updated distribution
maximum – The maximum value of the updated distribution
stddev – The standard deviation of the updated distribution
- Returns
Nothing
- class flownet.parameters.probability_distributions.TruncatedNormalDistribution(mean: float, stddev, minimum, maximum)
Bases:
flownet.parameters.probability_distributions.ProbabilityDistribution
- _abc_impl = <_abc_data object>
- defined: bool
- property ert_gen_kw: str
string representing an ERT “TRUNCATED_NORMAL MEAN STDDEV” distribution keyword for use in GEN_KW
- maximum: float
- mean: float
- minimum: float
- mode: float
- name: str
- stddev: float
- update_distribution(minimum: Optional[float] = None, maximum: Optional[float] = None, mean: Optional[float] = None, mode: Optional[float] = None, stddev: Optional[float] = None)
Function that updates the parameters that defines the probability distribution
- In the truncated normal distribution one or more of the following can be changed:
*The mean *The standard deviation *The minimum value *The maximum value
Providing a value for the mode has no effect here
- Parameters
minimum – The minimum values of the updated distribution
mean – The mean value of the updated distribution
mode – The mode of the updated distribution
maximum – The maximum value of the updated distribution
stddev – The standard deviation of the updated distribution
- Returns
Nothing
- class flownet.parameters.probability_distributions.UniformDistribution(minimum: Optional[float] = None, maximum: Optional[float] = None, mean: Optional[float] = None)
Bases:
flownet.parameters.probability_distributions.ProbabilityDistribution
The UniformDistribution class
- The class is initialized by providing ONLY two of the following inputs different from None:
The minimum value of the uniform distribution
The mean value of the uniform distribution
The maximum value of the uniform distribution
- Parameters
minimum (float) – The minimum value of the distribution
mean (float) – The mean value of the distribution
maximum (float) – The maximum value of the distribution
- _abc_impl = <_abc_data object>
- defined: bool
- property ert_gen_kw: str
string representing an ERT “UNIFORM MIN MAX” distribution keyword for use in GEN_KW
- maximum: float
- mean: float
- minimum: float
- mode: float
- name: str
- stddev: float
- update_distribution(minimum: Optional[float] = None, maximum: Optional[float] = None, mean: Optional[float] = None, mode: Optional[float] = None, stddev: Optional[float] = None)
Function that updates the parameters that defines the probability distribution.
- The following input combinations will make changes to the distribution:
Giving a new minimum value as input will trigger calculation of a new mean and standard deviation
Giving a new maximum value as input will trigger calculation of a new mean and standard deviation
- Giving a new mean value as input requires a new minimum OR maximum value to be defined also
A new mean value and a new minimum value will trigged an update of the maximum value and the stddev
A new mean value and a new maximum value will trigged an update of the minimum value and the stddev
Providing values for stddev or mode has no effect here, since the uniform distribution has no mode, and the stddev is calculated from the minimum and maximum values
Providing a new mean, a new minimum and a new maximum value (all three of them) will trigger an error
- Parameters
minimum – The minimum values of the updated distribution
mean – The mean value of the updated distribution
mode – The mode of the updated distribution
maximum – The maximum value of the updated distribution
stddev – The standard deviation of the updated distribution
- Returns
Nothing