class_docstr: Base forecaster template class.
  
  The base forecaster specifies the methods and method signatures that all forecasters
  have to implement.
  
  Specific implementations of these methods is deferred to concrete forecasters.
class_docstr_tok: ["Base","forecaster","template","class",".","The","base","forecaster","specifies","the","methods","and","method","signatures","that","all","forecasters","have","to","implement",".","Specific","implementations","of","these","methods","is","deferred","to","concrete","forecasters","."]
docstr: Compute/return prediction interval forecasts.
  
  private _predict_interval containing the core logic,
      called from predict_interval and default _predict_quantiles
  
  Parameters
  ----------
  fh : guaranteed to be ForecastingHorizon
      The forecasting horizon with the steps ahead to to predict.
  X : optional (default=None)
      guaranteed to be of a type in self.get_tag("X_inner_mtype")
      Exogeneous time series to predict from.
  coverage : float or list, optional (default=0.95)
     nominal coverage(s) of predictive interval(s)
  
  Returns
  -------
  pred_int : pd.DataFrame
      Column has multi-index: first level is variable name from y in fit,
          second level coverage fractions for which intervals were computed.
              in the same order as in input `coverage`.
          Third level is string "lower" or "upper", for lower/upper interval end.
      Row index is fh, with additional (upper) levels equal to instance levels,
          from y seen in fit, if y_inner_mtype is Panel or Hierarchical.
      Entries are forecasts of lower/upper interval end,
          for var in col index, at nominal coverage in second col index,
          lower/upper depending on third col index, for the row index.
          Upper/lower interval end forecasts are equivalent to
          quantile forecasts at alpha = 0.5 - c/2, 0.5 + c/2 for c in coverage.
docstr_tok: ["Compute\/return","prediction","interval","forecasts",".","private","_predict_interval","containing","the","core","logic",",","called","from","predict_interval","and","default","_predict_quantiles","Parameters","--","--","--","--","--","fh",":","guaranteed","to","be","ForecastingHorizon","The","forecasting","horizon","with","the","steps","ahead","to","to","predict",".","X",":","optional","(","default=None",")","guaranteed","to","be","of","a","type","in","self.get_tag","(","``","X_inner_mtype","''",")","Exogeneous","time","series","to","predict","from",".","coverage",":","float","or","list",",","optional","(","default=0.95",")","nominal","coverage","(","s",")","of","predictive","interval","(","s",")","Returns","--","--","--","-","pred_int",":","pd.DataFrame","Column","has","multi-index",":","first","level","is","variable","name","from","y","in","fit",",","second","level","coverage","fractions","for","which","intervals","were","computed",".","in","the","same","order","as","in","input","`","coverage","`",".","Third","level","is","string","``","lower","''","or","``","upper","''",",","for","lower\/upper","interval","end",".","Row","index","is","fh",",","with","additional","(","upper",")","levels","equal","to","instance","levels",",","from","y","seen","in","fit",",","if","y_inner_mtype","is","Panel","or","Hierarchical",".","Entries","are","forecasts","of","lower\/upper","interval","end",",","for","var","in","col","index",",","at","nominal","coverage","in","second","col","index",",","lower\/upper","depending","on","third","col","index",",","for","the","row","index",".","Upper\/lower","interval","end","forecasts","are","equivalent","to","quantile","forecasts","at","alpha","=","0.5","-","c\/2",",","0.5","+","c\/2","for","c","in","coverage","."]
code: def _predict_interval(self, fh, X, coverage):
      """Compute/return prediction interval forecasts.
  
      private _predict_interval containing the core logic,
          called from predict_interval and default _predict_quantiles
  
      Parameters
      ----------
      fh : guaranteed to be ForecastingHorizon
          The forecasting horizon with the steps ahead to to predict.
      X : optional (default=None)
          guaranteed to be of a type in self.get_tag("X_inner_mtype")
          Exogeneous time series to predict from.
      coverage : float or list, optional (default=0.95)
         nominal coverage(s) of predictive interval(s)
  
      Returns
      -------
      pred_int : pd.DataFrame
          Column has multi-index: first level is variable name from y in fit,
              second level coverage fractions for which intervals were computed.
                  in the same order as in input `coverage`.
              Third level is string "lower" or "upper", for lower/upper interval end.
          Row index is fh, with additional (upper) levels equal to instance levels,
              from y seen in fit, if y_inner_mtype is Panel or Hierarchical.
          Entries are forecasts of lower/upper interval end,
              for var in col index, at nominal coverage in second col index,
              lower/upper depending on third col index, for the row index.
              Upper/lower interval end forecasts are equivalent to
              quantile forecasts at alpha = 0.5 - c/2, 0.5 + c/2 for c in coverage.
      """
      implements_quantiles = self._has_implementation_of(
          "_predict_quantiles"
      )
      implements_proba = self._has_implementation_of("_predict_proba")
      can_do_proba = implements_quantiles or implements_proba
  
      if not can_do_proba:
          raise RuntimeError(
              f"{self.__class__.__name__} does not implement "
              "probabilistic forecasting, "
              'but "capability:pred_int" flag has been set to True incorrectly. '
              "This is likely a bug, please report, and/or set the flag to False."
          )
  
      # we default to _predict_quantiles if that is implemented or _predict_proba
      # since _predict_quantiles will default to _predict_proba if it is not
      alphas = []
      for c in coverage:
          # compute quantiles corresponding to prediction interval coverage
          #  this uses symmetric predictive intervals
          alphas.extend([0.5 - 0.5 * float(c), 0.5 + 0.5 * float(c)])
  
      # compute quantile forecasts corresponding to upper/lower
      pred_int = self._predict_quantiles(fh=fh, X=X, alpha=alphas)
  
      # change the column labels (multiindex) to the format for intervals
      # idx returned by _predict_quantiles is
      #   2-level MultiIndex with variable names, alpha
      # idx returned by _predict_interval should be
      #   3-level MultiIndex with variable names, coverage, lower/upper
      int_idx = self._get_columns(
          method="predict_interval", coverage=coverage
      )
      pred_int.columns = int_idx
  
      return pred_int
  
imports: from copy import deepcopy
  from itertools import product
  import numpy
  import pandas
  from sktime.base import BaseEstimator
  from sktime.datatypes import VectorizedDF, check_is_scitype, convert_to, get_cutoff, mtype_to_scitype, scitype_to_mtype, update_data
  from sktime.forecasting.base._fh import ForecastingHorizon
  from sktime.utils.datetime import _shift
  from sktime.utils.validation._dependencies import _check_estimator_deps
  from sktime.utils.validation.forecasting import check_alpha, check_cv, check_fh, check_X
  from sktime.utils.validation.series import check_equal_time_index
  from sktime.utils.warnings import warn
label_desc: Use image node_id 34 for calling the BaseForecaster obj's underlying member method code with example usage: obj._predict_interval(fh, X, coverage) and returns: pred_int