src/graphnet/plots/utils.py
def calculate_width_error(diff):
    """Calculate the uncertainty on the estimated width from the 68-interpercentile range."""
    N = len(diff)
    x_16 = abs(
        diff - np.percentile(diff, 16, interpolation="nearest")
    ).argmin()
    x_84 = abs(
        diff - np.percentile(diff, 84, interpolation="nearest")
    ).argmin()
    if len(diff) > 0:
        error_width = np.sqrt(
            (1 / empirical_pdf(x_84, diff) ** 2) * (0.84 * (1 - 0.84) / N)
            + (1 / empirical_pdf(x_16, diff) ** 2) * (0.16 * (1 - 0.16) / N)
        ) * (1 / 2)
    else:
        error_width = np.nan
    return error_width
Calculate the uncertainty on the estimated width from the 68-interpercentile range.
Calculate the uncertainty on the estimated width from the 68-interpercentile range.
Calculate the uncertainty on the estimated width from the 68 - interpercentile range .
def calculate_width_error(diff):
    N = len(diff)
    x_16 = abs(
        diff - np.percentile(diff, 16, interpolation="nearest")
    ).argmin()
    x_84 = abs(
        diff - np.percentile(diff, 84, interpolation="nearest")
    ).argmin()
    if len(diff) > 0:
        error_width = np.sqrt(
            (1 / empirical_pdf(x_84, diff) ** 2) * (0.84 * (1 - 0.84) / N)
            + (1 / empirical_pdf(x_16, diff) ** 2) * (0.16 * (1 - 0.16) / N)
        ) * (1 / 2)
    else:
        error_width = np.nan
    return error_width
def calculate_width_error ( diff ) : N = len ( diff ) x_16 = abs ( diff - np . percentile ( diff , 16 , interpolation = "nearest" ) ) . argmin ( ) x_84 = abs ( diff - np . percentile ( diff , 84 , interpolation = "nearest" ) ) . argmin ( ) if len ( diff ) > 0 : error_width = np . sqrt ( ( 1 / empirical_pdf ( x_84 , diff ) ** 2 ) * ( 0.84 * ( 1 - 0.84 ) / N ) + ( 1 / empirical_pdf ( x_16 , diff ) ** 2 ) * ( 0.16 * ( 1 - 0.16 ) / N ) ) * ( 1 / 2 ) else : error_width = np . nan return error_width
Calculate the uncertainty on the estimated width from the 68-interpercentile range.
Calculate the uncertainty on the estimated width from the 68 - interpercentile range .
"""Calculate the uncertainty on the estimated width from the 68-interpercentile range."""
diff