class_docstr: Theta method for forecasting.
  
  The theta method as defined in [1]_ is equivalent to simple exponential
  smoothing (SES) with drift (as demonstrated in [2]_).
  
  The series is tested for seasonality using the test outlined in A&N. If
  deemed seasonal, the series is seasonally adjusted using a classical
  multiplicative decomposition before applying the theta method. The
  resulting forecasts are then reseasonalised.
  
  In cases where SES results in a constant forecast, the theta forecaster
  will revert to predicting the SES constant plus a linear trend derived
  from the training data.
  
  Prediction intervals are computed using the underlying state space model.
  
  Parameters
  ----------
  initial_level : float, optional
      The alpha value of the simple exponential smoothing, if the value is
      set then this will be used, otherwise it will be estimated from the data.
  deseasonalize : bool, optional (default=True)
      If True, data is seasonally adjusted.
  sp : int, optional (default=1)
      The number of observations that constitute a seasonal period for a
      multiplicative deseasonaliser, which is used if seasonality is detected in the
      training data. Ignored if a deseasonaliser transformer is provided.
      Default is 1 (no seasonality).
  
  Attributes
  ----------
  initial_level_ : float
      The estimated alpha value of the SES fit.
  drift_ : float
      The estimated drift of the fitted model.
  se_ : float
      The standard error of the predictions. Used to calculate prediction
      intervals.
  
  References
  ----------
  .. [1] Assimakopoulos, V. and Nikolopoulos, K. The theta model: a
     decomposition approach to forecasting. International Journal of
     Forecasting 16, 521-530, 2000.
     https://www.sciencedirect.com/science/article/pii/S0169207000000662
  
  .. [2] `Hyndman, Rob J., and Billah, Baki. Unmasking the Theta method.
     International J. Forecasting, 19, 287-290, 2003.
     https://www.sciencedirect.com/science/article/pii/S0169207001001431
  
  See Also
  --------
  StatsForecastAutoTheta
  
  Examples
  --------
  >>> from sktime.datasets import load_airline
  >>> from sktime.forecasting.theta import ThetaForecaster
  >>> y = load_airline()
  >>> forecaster = ThetaForecaster(sp=12)  # doctest: +SKIP
  >>> forecaster.fit(y)  # doctest: +SKIP
  ThetaForecaster(...)
  >>> y_pred = forecaster.predict(fh=[1,2,3])  # doctest: +SKIP
class_docstr_tok: ["Theta","method","for","forecasting",".","The","theta","method","as","defined","in","[","1","]","_","is","equivalent","to","simple","exponential","smoothing","(","SES",")","with","drift","(","as","demonstrated","in","[","2","]","_",")",".","The","series","is","tested","for","seasonality","using","the","test","outlined","in","A","&","N",".","If","deemed","seasonal",",","the","series","is","seasonally","adjusted","using","a","classical","multiplicative","decomposition","before","applying","the","theta","method",".","The","resulting","forecasts","are","then","reseasonalised",".","In","cases","where","SES","results","in","a","constant","forecast",",","the","theta","forecaster","will","revert","to","predicting","the","SES","constant","plus","a","linear","trend","derived","from","the","training","data",".","Prediction","intervals","are","computed","using","the","underlying","state","space","model",".","Parameters","--","--","--","--","--","initial_level",":","float",",","optional","The","alpha","value","of","the","simple","exponential","smoothing",",","if","the","value","is","set","then","this","will","be","used",",","otherwise","it","will","be","estimated","from","the","data",".","deseasonalize",":","bool",",","optional","(","default=True",")","If","True",",","data","is","seasonally","adjusted",".","sp",":","int",",","optional","(","default=1",")","The","number","of","observations","that","constitute","a","seasonal","period","for","a","multiplicative","deseasonaliser",",","which","is","used","if","seasonality","is","detected","in","the","training","data",".","Ignored","if","a","deseasonaliser","transformer","is","provided",".","Default","is","1","(","no","seasonality",")",".","Attributes","--","--","--","--","--","initial_level_",":","float","The","estimated","alpha","value","of","the","SES","fit",".","drift_",":","float","The","estimated","drift","of","the","fitted","model",".","se_",":","float","The","standard","error","of","the","predictions",".","Used","to","calculate","prediction","intervals",".","References","--","--","--","--","--","..","[","1","]","Assimakopoulos",",","V.","and","Nikolopoulos",",","K.","The","theta","model",":","a","decomposition","approach","to","forecasting",".","International","Journal","of","Forecasting","16",",","521-530",",","2000.","https",":","\/\/www.sciencedirect.com\/science\/article\/pii\/S0169207000000662","..","[","2","]","`","Hyndman",",","Rob","J.",",","and","Billah",",","Baki",".","Unmasking","the","Theta","method",".","International","J",".","Forecasting",",","19",",","287-290",",","2003.","https",":","\/\/www.sciencedirect.com\/science\/article\/pii\/S0169207001001431","See","Also","--","--","--","--","StatsForecastAutoTheta","Examples","--","--","--","--",">",">",">","from","sktime.datasets","import","load_airline",">",">",">","from","sktime.forecasting.theta","import","ThetaForecaster",">",">",">","y","=","load_airline","(",")",">",">",">","forecaster","=","ThetaForecaster","(","sp=12",")","#","doctest",":","+SKIP",">",">",">","forecaster.fit","(","y",")","#","doctest",":","+SKIP","ThetaForecaster","(","...",")",">",">",">","y_pred","=","forecaster.predict","(","fh=","[","1,2,3","]",")","#","doctest",":","+SKIP"]
docstr: Compute/return prediction quantiles for a forecast.
  
  private _predict_interval containing the core logic,
      called from predict_interval and possibly predict_quantiles
  
  State required:
      Requires state to be "fitted".
  
  Accesses in self:
      Fitted model attributes ending in "_"
      self.cutoff
  
  Parameters
  ----------
  fh : guaranteed to be ForecastingHorizon
      The forecasting horizon with the steps ahead to to predict.
  X :  sktime time series object, optional (default=None)
      guaranteed to be of an mtype in self.get_tag("X_inner_mtype")
      Exogeneous time series for the forecast
  coverage : list of float (guaranteed not None and floats in [0,1] interval)
     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","quantiles","for","a","forecast",".","private","_predict_interval","containing","the","core","logic",",","called","from","predict_interval","and","possibly","predict_quantiles","State","required",":","Requires","state","to","be","``","fitted","''",".","Accesses","in","self",":","Fitted","model","attributes","ending","in","``","_","''","self.cutoff","Parameters","--","--","--","--","--","fh",":","guaranteed","to","be","ForecastingHorizon","The","forecasting","horizon","with","the","steps","ahead","to","to","predict",".","X",":","sktime","time","series","object",",","optional","(","default=None",")","guaranteed","to","be","of","an","mtype","in","self.get_tag","(","``","X_inner_mtype","''",")","Exogeneous","time","series","for","the","forecast","coverage",":","list","of","float","(","guaranteed","not","None","and","floats","in","[","0,1","]","interval",")","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 quantiles for a forecast.
  
      private _predict_interval containing the core logic,
          called from predict_interval and possibly predict_quantiles
  
      State required:
          Requires state to be "fitted".
  
      Accesses in self:
          Fitted model attributes ending in "_"
          self.cutoff
  
      Parameters
      ----------
      fh : guaranteed to be ForecastingHorizon
          The forecasting horizon with the steps ahead to to predict.
      X :  sktime time series object, optional (default=None)
          guaranteed to be of an mtype in self.get_tag("X_inner_mtype")
          Exogeneous time series for the forecast
      coverage : list of float (guaranteed not None and floats in [0,1] interval)
         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.
      """
      pred_int = BaseForecaster._predict_interval(self, fh, X, coverage)
      return pred_int
  
imports: import numpy
  import pandas
  from scipy.stats import norm
  from sktime.forecasting.base import BaseForecaster
  from sktime.forecasting.compose import ColumnEnsembleForecaster
  from sktime.forecasting.compose._ensemble import _aggregate
  from sktime.forecasting.compose._pipeline import TransformedTargetForecaster
  from sktime.forecasting.exp_smoothing import ExponentialSmoothing
  from sktime.forecasting.trend import PolynomialTrendForecaster
  from sktime.transformations.series.detrend import Deseasonalizer
  from sktime.transformations.series.theta import ThetaLinesTransformer
  from sktime.utils.slope_and_trend import _fit_trend
  from sktime.utils.validation._dependencies import _check_estimator_deps
  from sktime.utils.validation.forecasting import check_sp
  from sktime.utils.warnings import warn
label_desc: Use image node_id 6 for calling the ThetaForecaster obj's underlying member method code with example usage: obj._predict_interval(fh, X, coverage) and returns: pred_int