cdf(data, n_samples=50, sampling='linear', log_base=10, decimals=None)[source]

Get a number of x-values that define a CDF for the input data.

  • data (np.ndarray) – 1D array of data to make a CDF for

  • n_samples (int) – Number of points to fit the CDF

  • sampling (str) – Option for quantile sampling (see sampling functions in rex.utilities.bc_utils), e.g., how to sample the y-axis of the distribution. “linear” will do even spacing, “log” will concentrate samples near quantile=0, and “invlog” will concentrate samples near quantile=1

  • log_base (int | float) – Log base value if sampling is “log” or “invlog”. A higher value will concentrate more samples at the extreme sides of the distribution.

  • decimals (int | None) – Precision to round output to (see docstring for np.round). None will not round outputs (default).


x_values (np.ndarray) – 1D array of values with shape (n_samples,). Each value is in the same units as the input data argument. The x_values[0] is the minimum value of data (0th percentile) and x_values[-1] is the maximum (100th percentile). The values are spaced in quantile space (y-axis of the CDF) according to the sampling option (e.g., evenly spaced if sampling=’linear’).