log_normal#
- caf.distribute.cost_functions.log_normal(base_cost, sigma, mu, min_return_val=1e-150)#
Apply of the log normal cost function.
- Parameters:
base_cost (np.ndarray) – Array of the base costs.
sigma (float) – Parameters of the log normal cost function, see Notes.
mu (float) – Parameters of the log normal cost function, see Notes.
min_return_val (float)
- Return type:
ndarray
- min_return_val: float
The minimum value allowed in the return. Avoid return arrays with values such as 1e-300 which lead to overflow errors when divisions are made.
- Returns:
Output from the log normal equation, same shape as base_cost.
- Return type:
log_normal_costs
- Parameters:
base_cost (ndarray)
sigma (float)
mu (float)
min_return_val (float)
Notes
Formula used for this function is:
\[f(C_{ij}) = \frac{1}{C_{ij} \cdot \sigma \cdot \sqrt{2\pi}} \cdot \exp\left(-\frac{(\ln C_{ij}-\mu)^2}{2\sigma^2}\right)\]where:
\(C_{ij}\): cost from i to j.
\(\sigma, \mu\): calibration parameters.