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_quantiles containing the core logic,
      called from predict_quantiles and predict_interval
  
  Parameters
  ----------
  fh : int, list, np.array or ForecastingHorizon
      Forecasting horizon
  X : pd.DataFrame, optional (default=None)
      Exogenous time series
  alpha : list of float, optional (default=[0.5])
      A list of probabilities at which quantile forecasts are computed.
  
  Returns
  -------
  quantiles : pd.DataFrame
      Column has multi-index: first level is variable name from y in fit,
          second level being the values of alpha passed to the function.
      Row index is fh. Entries are quantile forecasts, for var in col index,
          at quantile probability in second col index, for the row index.
docstr_tok: ["Compute\/return","prediction","quantiles","for","a","forecast",".","private","_predict_quantiles","containing","the","core","logic",",","called","from","predict_quantiles","and","predict_interval","Parameters","--","--","--","--","--","fh",":","int",",","list",",","np.array","or","ForecastingHorizon","Forecasting","horizon","X",":","pd.DataFrame",",","optional","(","default=None",")","Exogenous","time","series","alpha",":","list","of","float",",","optional","(","default=","[","0.5","]",")","A","list","of","probabilities","at","which","quantile","forecasts","are","computed",".","Returns","--","--","--","-","quantiles",":","pd.DataFrame","Column","has","multi-index",":","first","level","is","variable","name","from","y","in","fit",",","second","level","being","the","values","of","alpha","passed","to","the","function",".","Row","index","is","fh",".","Entries","are","quantile","forecasts",",","for","var","in","col","index",",","at","quantile","probability","in","second","col","index",",","for","the","row","index","."]
code: def _predict_quantiles(self, fh, X, alpha):
      """Compute/return prediction quantiles for a forecast.
  
      private _predict_quantiles containing the core logic,
          called from predict_quantiles and predict_interval
  
      Parameters
      ----------
      fh : int, list, np.array or ForecastingHorizon
          Forecasting horizon
      X : pd.DataFrame, optional (default=None)
          Exogenous time series
      alpha : list of float, optional (default=[0.5])
          A list of probabilities at which quantile forecasts are computed.
  
      Returns
      -------
      quantiles : pd.DataFrame
          Column has multi-index: first level is variable name from y in fit,
              second level being the values of alpha passed to the function.
          Row index is fh. Entries are quantile forecasts, for var in col index,
              at quantile probability in second col index, for the row index.
      """
      # prepare return data frame
      var_names = self._get_varnames()
      var_name = var_names[0]
      index = pd.MultiIndex.from_product([var_names, alpha])
      pred_quantiles = pd.DataFrame(columns=index)
  
      sem = self.sigma_ * np.sqrt(
          self.fh.to_relative(self.cutoff) * self.initial_level_**2
          + 1
      )
  
      y_pred = self._predict(fh, X)
  
      # we assume normal additive noise with sem variance
      for a in alpha:
          pred_quantiles[(var_name, a)] = y_pred + norm.ppf(a) * sem
      # todo: should this not increase with the horizon?
      # i.e., sth like norm.ppf(a) * sem * fh.to_absolute(cutoff) ?
      # I've just refactored this so will leave it for now
  
      return pred_quantiles
  
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 7 for calling the ThetaForecaster obj's underlying member method code with example usage: obj._predict_quantiles(fh, X, alpha) and returns: pred_quantiles