pyesmda.distances_to_weights_beta_cumulative¶
- pyesmda.distances_to_weights_beta_cumulative(distances: numpy.ndarray[Any, numpy.dtype[numpy.float64]], beta: float = 3, scaling_factor: float = 1.0) numpy.ndarray[Any, numpy.dtype[numpy.float64]] [source]¶
Transform the distances into weights between 0 and 1 with a beta function.
\[1 - \dfrac{1}{1 + \left(\dfrac{d}{s - d}\right)^{-\beta}}\]- Parameters
distances (NDArrayFloat) – Input array of distances.
beta (float, optional) – Shape factor. The smalest beta, the slower the variation, the higher beta the sharpest the transition (tends to a dirac function). Must be strictly positive. The default is 3.
scaling_factor (float, optional) – The scaling factor. At 0, the function equals 1.0, at half the scaling factor, it equals 0.5, and at the scaling factor, is equals zero. The default is 1.0.
- Returns
Array of same dimension as input array.
- Return type
NDArrayFloat.