pitci.helpers.check_interval_width

pitci.helpers.check_interval_width(lower_interval=None, upper_interval=None, intervals_with_predictions=None, quantiles=[0, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 1])[source]

Function to check the distribution of prediction intervals.

Either both lower_interval and upper_interval or intervals_with_predictions must be specified.

The specified quantiles of the interval distribution, the mean, std and iqr are returned in a dict. A histogram of the distribution is also printed.

Parameters
  • lower_interval (np.ndarray, pd.Series or None, default = None) – Lower intervals, if None then lower interval will be taken from the first column in intervals_with_predictions.

  • upper_interval (np.ndarray, pd.Series or None, default = None) – Upper intervals, if None then upper interval will be taken from the first column in intervals_with_predictions.

  • intervals_with_predictions (np.ndarry or None, default = None) – Lower intervals and upper intervals combined in a single np array. The array must have 3 columns. The lower interval is assumed to be the first column and the upper column is assumed to be the third column.

  • quantiles (list) – List of quantiles to report on the distribution of the interval widths.