class_docstr: Compute the prediction variance based on a separate forecaster.
  
  Wraps a `forecaster` with another `residual_forecaster` object that
  allows for quantile and interval estimation by fitting the
  `residual_forecaster` to the rolling residuals.
  
  Fitting proceeds as follows:
  Let :math:`t_1, \dots, t_N` be the train set.
  Let `steps_ahead` be a positive integer indicating the steps ahead
  we want to forecast the residuals. Let `initial_window` be
  the minimal number of observations to which the forecaster is fitted.
  
  1. For :math:`i = initial\_window, \dots, N - steps\_ahead`
      a. Train/Update forecaster A on :math:`y(t_1), \dots, y(t_i)`
      b. Make point prediction for :math:`t_{i+steps\_ahead}` to get
         :math:`\hat{y}(t_{i+steps\_ahead})`
      c. Compute the residual for :math:`t_{i+steps\_ahead}` as
         :math:`r(t_{i+steps\_ahead}) := y(t_{i+steps\_ahead})
         - \hat{y}(t_{i+steps\_ahead})`
      d. Compute :math:`e(t_{i+steps\_ahead}) := h(r(t_{i+steps\_ahead}))`
         where :math:`h(x)` is given by :math:`strategy`
  2. Train `residual_forecaster` on
     :math:`e(t_{initial\_window+steps\_ahead}), \dots, e(t_{N})`
  
  Prediction for :math:`t_{N+steps\_ahead}` is done as follows:
  
  1. Use `forecaster` to predict location param :math:`\hat{y}(t_{N+steps\_ahead})`
  2. Use `residual_forecaster` to predict scale param :math:`e(t_{N+steps\_ahead})`
  3. Calculate prediction intervals based on e.g. normal assumption
     :math:`N(\hat{y}(t_{N+steps\_ahead}),  e(t_{N+steps\_ahead}))`
  
  Parameters
  ----------
  forecaster : sktime forecaster, BaseForecaster descendant, optional
      Estimator to which probabilistic forecasts are being added
  residual_forecaster : sktime forecaster, BaseForecaster descendant, optional
      Estimator which is fitted to the residuals of forecaster
  initial_window : int, optional, default=2
      Size of initial_window to which forecaster is fitted
  steps_ahead : int, optional, default=1
      Steps ahead for which we predict the residuals
  strategy : str, optional, default='square'
      Function applied to the residuals
  distr : str, optional, default='norm'
      Distributional assumption (["norm", "laplace", "t", "cauchy"])
  distr_kwargs : dict, optional
      Additional arguments required by the distribution
  
  Examples
  --------
  >>> from sktime.datasets import load_macroeconomic
  >>> from sktime.forecasting.base import ForecastingHorizon
  >>> from sktime.forecasting.naive import NaiveForecaster
  >>> from sktime.forecasting.theta import ThetaForecaster
  >>> from sktime.forecasting.squaring_residuals import SquaringResiduals
  >>> fc = NaiveForecaster()
  >>> var_fc = ThetaForecaster()  # doctest: +SKIP
  >>> y = load_macroeconomic().realgdp  # doctest: +SKIP
  >>> sqr = SquaringResiduals(forecaster=fc, residual_forecaster=var_fc)
  ... # doctest: +SKIP
  >>> fh = ForecastingHorizon(values=[1, 2, 3])  # doctest: +SKIP
  >>> sqr = sqr.fit(y, fh=fh)  # doctest: +SKIP
  >>> pred_interval = sqr.predict_interval(coverage=0.95)  # doctest: +SKIP
class_docstr_tok: ["Compute","the","prediction","variance","based","on","a","separate","forecaster",".","Wraps","a","`","forecaster","`","with","another","`","residual_forecaster","`","object","that","allows","for","quantile","and","interval","estimation","by","fitting","the","`","residual_forecaster","`","to","the","rolling","residuals",".","Fitting","proceeds","as","follows",":","Let",":","math",":","`","t_1",",","\\dots",",","t_N","`","be","the","train","set",".","Let","`","steps_ahead","`","be","a","positive","integer","indicating","the","steps","ahead","we","want","to","forecast","the","residuals",".","Let","`","initial_window","`","be","the","minimal","number","of","observations","to","which","the","forecaster","is","fitted",".","1",".","For",":","math",":","`","i","=","initial\\_window",",","\\dots",",","N","-","steps\\_ahead","`","a.","Train\/Update","forecaster","A","on",":","math",":","`","y","(","t_1",")",",","\\dots",",","y","(","t_i",")","`","b",".","Make","point","prediction","for",":","math",":","`","t_","{","i+steps\\_ahead","}","`","to","get",":","math",":","`","\\hat","{","y","}","(","t_","{","i+steps\\_ahead","}",")","`","c.","Compute","the","residual","for",":","math",":","`","t_","{","i+steps\\_ahead","}","`","as",":","math",":","`","r","(","t_","{","i+steps\\_ahead","}",")",":","=","y","(","t_","{","i+steps\\_ahead","}",")","-","\\hat","{","y","}","(","t_","{","i+steps\\_ahead","}",")","`","d.","Compute",":","math",":","`","e","(","t_","{","i+steps\\_ahead","}",")",":","=","h","(","r","(","t_","{","i+steps\\_ahead","}",")",")","`","where",":","math",":","`","h","(","x",")","`","is","given","by",":","math",":","`","strategy","`","2",".","Train","`","residual_forecaster","`","on",":","math",":","`","e","(","t_","{","initial\\_window+steps\\_ahead","}",")",",","\\dots",",","e","(","t_","{","N","}",")","`","Prediction","for",":","math",":","`","t_","{","N+steps\\_ahead","}","`","is","done","as","follows",":","1",".","Use","`","forecaster","`","to","predict","location","param",":","math",":","`","\\hat","{","y","}","(","t_","{","N+steps\\_ahead","}",")","`","2",".","Use","`","residual_forecaster","`","to","predict","scale","param",":","math",":","`","e","(","t_","{","N+steps\\_ahead","}",")","`","3",".","Calculate","prediction","intervals","based","on","e.g",".","normal","assumption",":","math",":","`","N","(","\\hat","{","y","}","(","t_","{","N+steps\\_ahead","}",")",",","e","(","t_","{","N+steps\\_ahead","}",")",")","`","Parameters","--","--","--","--","--","forecaster",":","sktime","forecaster",",","BaseForecaster","descendant",",","optional","Estimator","to","which","probabilistic","forecasts","are","being","added","residual_forecaster",":","sktime","forecaster",",","BaseForecaster","descendant",",","optional","Estimator","which","is","fitted","to","the","residuals","of","forecaster","initial_window",":","int",",","optional",",","default=2","Size","of","initial_window","to","which","forecaster","is","fitted","steps_ahead",":","int",",","optional",",","default=1","Steps","ahead","for","which","we","predict","the","residuals","strategy",":","str",",","optional",",","default='square'","Function","applied","to","the","residuals","distr",":","str",",","optional",",","default='norm'","Distributional","assumption","(","[","``","norm","''",",","``","laplace","''",",","``","t","''",",","``","cauchy","''","]",")","distr_kwargs",":","dict",",","optional","Additional","arguments","required","by","the","distribution","Examples","--","--","--","--",">",">",">","from","sktime.datasets","import","load_macroeconomic",">",">",">","from","sktime.forecasting.base","import","ForecastingHorizon",">",">",">","from","sktime.forecasting.naive","import","NaiveForecaster",">",">",">","from","sktime.forecasting.theta","import","ThetaForecaster",">",">",">","from","sktime.forecasting.squaring_residuals","import","SquaringResiduals",">",">",">","fc","=","NaiveForecaster","(",")",">",">",">","var_fc","=","ThetaForecaster","(",")","#","doctest",":","+SKIP",">",">",">","y","=","load_macroeconomic","(",")",".realgdp","#","doctest",":","+SKIP",">",">",">","sqr","=","SquaringResiduals","(","forecaster=fc",",","residual_forecaster=var_fc",")","...","#","doctest",":","+SKIP",">",">",">","fh","=","ForecastingHorizon","(","values=","[","1",",","2",",","3","]",")","#","doctest",":","+SKIP",">",">",">","sqr","=","sqr.fit","(","y",",","fh=fh",")","#","doctest",":","+SKIP",">",">",">","pred_interval","=","sqr.predict_interval","(","coverage=0.95",")","#","doctest",":","+SKIP"]
docstr: Forecast time series at future horizon.
  
  private _predict containing the core logic, called from predict
  
  State required:
      Requires state to be "fitted".
  
  Accesses in self:
      Fitted model attributes ending in "_"
      self.cutoff
  
  Parameters
  ----------
  fh : guaranteed to be ForecastingHorizon or None, optional (default=None)
      The forecasting horizon with the steps ahead to to predict.
      If not passed in _fit, guaranteed to be passed here
  X : optional (default=None)
      guaranteed to be of a type in self.get_tag("X_inner_mtype")
      Exogeneous time series for the forecast
  
  Returns
  -------
  y_pred : pd.Series
      Point predictions
docstr_tok: ["Forecast","time","series","at","future","horizon",".","private","_predict","containing","the","core","logic",",","called","from","predict","State","required",":","Requires","state","to","be","``","fitted","''",".","Accesses","in","self",":","Fitted","model","attributes","ending","in","``","_","''","self.cutoff","Parameters","--","--","--","--","--","fh",":","guaranteed","to","be","ForecastingHorizon","or","None",",","optional","(","default=None",")","The","forecasting","horizon","with","the","steps","ahead","to","to","predict",".","If","not","passed","in","_fit",",","guaranteed","to","be","passed","here","X",":","optional","(","default=None",")","guaranteed","to","be","of","a","type","in","self.get_tag","(","``","X_inner_mtype","''",")","Exogeneous","time","series","for","the","forecast","Returns","--","--","--","-","y_pred",":","pd.Series","Point","predictions"]
code: def _predict(self, fh, X):
      """Forecast time series at future horizon.
  
      private _predict containing the core logic, called from predict
  
      State required:
          Requires state to be "fitted".
  
      Accesses in self:
          Fitted model attributes ending in "_"
          self.cutoff
  
      Parameters
      ----------
      fh : guaranteed to be ForecastingHorizon or None, optional (default=None)
          The forecasting horizon with the steps ahead to to predict.
          If not passed in _fit, guaranteed to be passed here
      X : optional (default=None)
          guaranteed to be of a type in self.get_tag("X_inner_mtype")
          Exogeneous time series for the forecast
  
      Returns
      -------
      y_pred : pd.Series
          Point predictions
      """
      fh_abs = fh.to_absolute(self.cutoff)
      y_pred = self._forecaster_.predict(X=X, fh=fh_abs)
      y_pred.name = self._y.name
      return y_pred
  
file_path: sktime/sktime/forecasting/squaring_residuals.py
imports: import pandas
  from sktime.datatypes._convert import convert_to
  from sktime.forecasting.base import BaseForecaster, ForecastingHorizon
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.split import ExpandingWindowSplitter
  from sktime.utils.warnings import warn
label_desc: Use image node_id 3 for calling the SquaringResiduals obj's underlying member method code with example usage: obj._predict(fh, X) and returns: y_pred