class_docstr: Modular theta method for forecasting.
  
  Modularized implementation of Theta method as defined in [1]_.
  Also see auto-theta method as described in [2]_ *not contained in this estimator).
  
  Overview: Input :term:`univariate series <Univariate time series>` of length
  "n" and decompose with :class:`ThetaLinesTransformer
  <sktime.transformations.series.theta>` by modifying the local curvature of
  the time series using Theta-coefficient values - `theta_values` parameter.
  Thansformation gives a pd.DataFrame of shape `len(input series) * len(theta)`.
  
  The resulting transformed series (Theta-lines) are extrapolated separately.
  The forecasts are then aggregated into one prediction - aunivariate series,
  of `len(fh)`.
  
  Parameters
  ----------
  forecasters: list of tuples (str, estimator, int or pd.index), default=None
      Forecasters to apply to each Theta-line based on the third element
      (the index). Indices must correspond to the theta_values, see Examples.
      If None, will apply PolynomialTrendForecaster (linear regression) to the
      Theta-lines where theta_value equals 0, and ExponentialSmoothing - where
      theta_value is different from 0.
  theta_values: sequence of float, default=(0,2)
      Theta-coefficients to use in transformation. If `forecasters` parameter
      is passed, must be the same length as `forecasters`.
  aggfunc: str, default="mean"
      Must be one of ["mean", "median", "min", "max", "gmean"].
      Calls :func:`_aggregate` of
      :class:`EnsembleForecaster<sktime.forecasting.compose._ensemble>` to
      apply to results of multivariate theta-lines predictions (pd.DataFrame)
      in order to get resulting univariate prediction (pd.Series).
      The aggregation takes place across different theta-lines (row-wise), for
      given time stamps and hierarchy indices, if present.
  weights: list of floats, default=None
      Weights to apply in aggregation. Weights are passed as a parameter to
      the aggregation function, must correspond to each theta-line. None will
      result in non-weighted aggregation.
  
  References
  ----------
  .. [1] V.Assimakopoulos et al., "The theta model: a decomposition approach
     to forecasting", International Journal of Forecasting, vol. 16, pp. 521-530,
     2000.
  .. [2] E.Spiliotis et al., "Generalizing the Theta method for
     automatic forecasting ", European Journal of Operational
     Research, vol. 284, pp. 550-558, 2020.
  
  See Also
  --------
  ThetaForecaster, ThetaLinesTransformer
  
  Examples
  --------
  >>> from sktime.datasets import load_airline
  >>> from sktime.forecasting.theta import ThetaModularForecaster
  >>> from sktime.forecasting.naive import NaiveForecaster
  >>> from sktime.forecasting.trend import PolynomialTrendForecaster
  >>> y = load_airline()
  >>> forecaster = ThetaModularForecaster(
  ...     forecasters=[
  ...         ("trend", PolynomialTrendForecaster(), 0),
  ...         ("arima", NaiveForecaster(), 3),
  ...     ],
  ...     theta_values=(0, 3),
  ... )
  >>> forecaster.fit(y)
  ThetaModularForecaster(...)
  >>> y_pred = forecaster.predict(fh=[1,2,3])
class_docstr_tok: ["Modular","theta","method","for","forecasting",".","Modularized","implementation","of","Theta","method","as","defined","in","[","1","]","_",".","Also","see","auto-theta","method","as","described","in","[","2","]","_","*","not","contained","in","this","estimator",")",".","Overview",":","Input",":","term",":","`","univariate","series","<","Univariate","time","series",">","`","of","length","''","n","''","and","decompose","with",":","class",":","`","ThetaLinesTransformer","<","sktime.transformations.series.theta",">","`","by","modifying","the","local","curvature","of","the","time","series","using","Theta-coefficient","values","-","`","theta_values","`","parameter",".","Thansformation","gives","a","pd.DataFrame","of","shape","`","len","(","input","series",")","*","len","(","theta",")","`",".","The","resulting","transformed","series","(","Theta-lines",")","are","extrapolated","separately",".","The","forecasts","are","then","aggregated","into","one","prediction","-","aunivariate","series",",","of","`","len","(","fh",")","`",".","Parameters","--","--","--","--","--","forecasters",":","list","of","tuples","(","str",",","estimator",",","int","or","pd.index",")",",","default=None","Forecasters","to","apply","to","each","Theta-line","based","on","the","third","element","(","the","index",")",".","Indices","must","correspond","to","the","theta_values",",","see","Examples",".","If","None",",","will","apply","PolynomialTrendForecaster","(","linear","regression",")","to","the","Theta-lines","where","theta_value","equals","0",",","and","ExponentialSmoothing","-","where","theta_value","is","different","from","0.","theta_values",":","sequence","of","float",",","default=","(","0,2",")","Theta-coefficients","to","use","in","transformation",".","If","`","forecasters","`","parameter","is","passed",",","must","be","the","same","length","as","`","forecasters","`",".","aggfunc",":","str",",","default=","''","mean","''","Must","be","one","of","[","``","mean","''",",","``","median","''",",","``","min","''",",","``","max","''",",","``","gmean","''","]",".","Calls",":","func",":","`","_aggregate","`","of",":","class",":","`","EnsembleForecaster","<","sktime.forecasting.compose._ensemble",">","`","to","apply","to","results","of","multivariate","theta-lines","predictions","(","pd.DataFrame",")","in","order","to","get","resulting","univariate","prediction","(","pd.Series",")",".","The","aggregation","takes","place","across","different","theta-lines","(","row-wise",")",",","for","given","time","stamps","and","hierarchy","indices",",","if","present",".","weights",":","list","of","floats",",","default=None","Weights","to","apply","in","aggregation",".","Weights","are","passed","as","a","parameter","to","the","aggregation","function",",","must","correspond","to","each","theta-line",".","None","will","result","in","non-weighted","aggregation",".","References","--","--","--","--","--","..","[","1","]","V.Assimakopoulos","et","al.",",","``","The","theta","model",":","a","decomposition","approach","to","forecasting","''",",","International","Journal","of","Forecasting",",","vol",".","16",",","pp",".","521-530",",","2000",".","..","[","2","]","E.Spiliotis","et","al.",",","``","Generalizing","the","Theta","method","for","automatic","forecasting","``",",","European","Journal","of","Operational","Research",",","vol",".","284",",","pp",".","550-558",",","2020",".","See","Also","--","--","--","--","ThetaForecaster",",","ThetaLinesTransformer","Examples","--","--","--","--",">",">",">","from","sktime.datasets","import","load_airline",">",">",">","from","sktime.forecasting.theta","import","ThetaModularForecaster",">",">",">","from","sktime.forecasting.naive","import","NaiveForecaster",">",">",">","from","sktime.forecasting.trend","import","PolynomialTrendForecaster",">",">",">","y","=","load_airline","(",")",">",">",">","forecaster","=","ThetaModularForecaster","(","...","forecasters=","[","...","(","``","trend","''",",","PolynomialTrendForecaster","(",")",",","0",")",",","...","(","``","arima","''",",","NaiveForecaster","(",")",",","3",")",",","...","]",",","...","theta_values=","(","0",",","3",")",",","...",")",">",">",">","forecaster.fit","(","y",")","ThetaModularForecaster","(","...",")",">",">",">","y_pred","=","forecaster.predict","(","fh=","[","1,2,3","]",")"]
code: def _fit(self, y, X, fh):
      self.pipe_.fit(y=y, X=X, fh=fh)
      return self
  
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 3 for calling the ThetaModularForecaster obj's underlying member method code with example usage: obj._fit(y, X, fh) and returns: self