pyuncertainnumber.pba.core ========================== .. py:module:: pyuncertainnumber.pba.core Classes ------- .. autoapisummary:: pyuncertainnumber.pba.core.Joint Functions --------- .. autoapisummary:: pyuncertainnumber.pba.core.wasserstein_1d pyuncertainnumber.pba.core.area_metric_ecdf pyuncertainnumber.pba.core.endpoint_distance pyuncertainnumber.pba.core.area_metric_hint pyuncertainnumber.pba.core.distance_to_ecdf_bound pyuncertainnumber.pba.core.closer_bound pyuncertainnumber.pba.core.if_outside pyuncertainnumber.pba.core.if_right_in pyuncertainnumber.pba.core.directional pyuncertainnumber.pba.core.calibration_distance pyuncertainnumber.pba.core.slide_pbox_towards_scalar Module Contents --------------- .. py:class:: Joint(copula, marginals: list) Bases: :py:obj:`abc.ABC` Helper class that provides a standard way to create an ABC using inheritance. .. py:attribute:: copula .. py:attribute:: marginals .. py:function:: wasserstein_1d(q1: numpy.typing.ArrayLike, q2: numpy.typing.ArrayLike, p: numpy.typing.ArrayLike) -> float An intuitive of Wasserstein metric in 1D, aka. area between two quantile functions This is equivaluent to the Area Metric in 1D, which shall return same results as "scipy.stats.wasserstein_distance" :param q1: quantile vectors (same length, corresponding to probabilities p) :type q1: ArrayLike :param q2: quantile vectors (same length, corresponding to probabilities p) :type q2: ArrayLike :param p: probability vector (between 0 and 1, monotone increasing) :type p: ArrayLike .. py:function:: area_metric_ecdf(q1, q2, p) Wasserstein metric in 1D, aka. area between two quantile functions This is equivaluent to the Area Metric in 1D. :param q1: quantile vectors (same length, corresponding to probabilities p) :type q1: ArrayLike :param q2: quantile vectors (same length, corresponding to probabilities p) :type q2: ArrayLike :param p: probability vector (between 0 and 1, monotone increasing). Must be the same for q1 and q2 :type p: ArrayLike .. py:function:: endpoint_distance(A, B) Smallest endpoint distance elementwise between intervals. .. py:function:: area_metric_hint() .. py:function:: distance_to_ecdf_bound(x0, quantile) Min horizontal distance from x0 to the ECDF defined by quantile. .. py:function:: closer_bound(x0, left_edge, right_edge) Decide which ECDF bound is closer to x0. :param x0: a scalar point :param left_edge: samples from the left bound of the ECDF :param x_right_samples: samples from the right bound of the ECDF .. py:function:: if_outside(x0, left_edge, right_edge) Check if x0 is outside the ECDF defined by left_edge and right_edge. .. py:function:: if_right_in(x0, left_edge, right_edge) Check if x0 is inside the ECDF defined by left_edge and right_edge. .. py:function:: directional(x0, left_edge, right_edge) give instructions on which direction to move the Pbox towards the scalar :returns: output a message variable .. py:function:: calibration_distance(a: pyuncertainnumber.pba.pbox_abc.Pbox, b: numbers.Number) -> float Estimate the calibration distance to compensate area metric between a P-box aand a scalar .. py:function:: slide_pbox_towards_scalar(a, b) Slide the Pbox a towards the scalar b by one step. :param a: a Pbox :param b: a scalar :returns: a new Pbox that is slid towards b by one step