class_docstr: Results class from estimated Theta Models.
  
  Parameters
  ----------
  b0 : float
      The estimated trend slope.
  alpha : float
      The estimated SES parameter.
  sigma2 : float
      The estimated residual variance from the SES/IMA model.
  one_step : float
      The one-step forecast from the SES.
  seasonal : ndarray
      An array of estimated seasonal terms.
  use_mle : bool
      A flag indicating that the parameters were estimated using MLE.
  model : ThetaModel
      The model used to produce the results.
class_docstr_tok: ["Results","class","from","estimated","Theta","Models",".","Parameters","--","--","--","--","--","b0",":","float","The","estimated","trend","slope",".","alpha",":","float","The","estimated","SES","parameter",".","sigma2",":","float","The","estimated","residual","variance","from","the","SES\/IMA","model",".","one_step",":","float","The","one-step","forecast","from","the","SES",".","seasonal",":","ndarray","An","array","of","estimated","seasonal","terms",".","use_mle",":","bool","A","flag","indicating","that","the","parameters","were","estimated","using","MLE",".","model",":","ThetaModel","The","model","used","to","produce","the","results","."]
docstr: Forecast the model for a given theta
  
  Parameters
  ----------
  steps : int
      The number of steps ahead to compute the forecast components.
  theta : float
      The theta value to use when computing the weight to combine
      the trend and the SES forecasts.
  
  Returns
  -------
  Series
      A Series containing the forecasts
  
  Notes
  -----
  The forecast is computed as
  
  .. math::
  
     \hat{X}_{T+h|T} = \frac{\theta-1}{\theta} b_0
                       \left[h - 1 + \frac{1}{\alpha}
                       - \frac{(1-\alpha)^T}{\alpha} \right]
                       + \tilde{X}_{T+h|T}
  
  where :math:`\tilde{X}_{T+h|T}` is the SES forecast of the endogenous
  variable using the parameter :math:`\alpha`. :math:`b_0` is the
  slope of a time trend line fitted to X using the terms 0, 1, ..., T-1.
  
  This expression follows from [1]_ and [2]_ when the combination
  weights are restricted to be (theta-1)/theta and 1/theta. This nests
  the original implementation when theta=2 and the two weights are both
  1/2.
  
  References
  ----------
  .. [1] Hyndman, R. J., & Billah, B. (2003). Unmasking the Theta method.
     International Journal of Forecasting, 19(2), 287-290.
  .. [2] Fioruci, J. A., Pellegrini, T. R., Louzada, F., & Petropoulos,
     F. (2015). The optimized theta method. arXiv preprint
     arXiv:1503.03529.
docstr_tok: ["Forecast","the","model","for","a","given","theta","Parameters","--","--","--","--","--","steps",":","int","The","number","of","steps","ahead","to","compute","the","forecast","components",".","theta",":","float","The","theta","value","to","use","when","computing","the","weight","to","combine","the","trend","and","the","SES","forecasts",".","Returns","--","--","--","-","Series","A","Series","containing","the","forecasts","Notes","--","--","-","The","forecast","is","computed","as","..","math",":",":","\\hat","{","X","}","_","{","T+h|T","}","=","\\frac","{","\\theta-1","}","{","\\theta","}","b_0","\\left","[","h","-","1","+","\\frac","{","1","}","{","\\alpha","}","-","\\frac","{","(","1-\\alpha",")","^T","}","{","\\alpha","}","\\right","]","+","\\tilde","{","X","}","_","{","T+h|T","}","where",":","math",":","`","\\tilde","{","X","}","_","{","T+h|T","}","`","is","the","SES","forecast","of","the","endogenous","variable","using","the","parameter",":","math",":","`","\\alpha","`",".",":","math",":","`","b_0","`","is","the","slope","of","a","time","trend","line","fitted","to","X","using","the","terms","0",",","1",",","...",",","T-1",".","This","expression","follows","from","[","1","]","_","and","[","2","]","_","when","the","combination","weights","are","restricted","to","be","(","theta-1",")","\/theta","and","1\/theta",".","This","nests","the","original","implementation","when","theta=2","and","the","two","weights","are","both","1\/2",".","References","--","--","--","--","--","..","[","1","]","Hyndman",",","R.","J.",",","&","Billah",",","B",".","(","2003",")",".","Unmasking","the","Theta","method",".","International","Journal","of","Forecasting",",","19","(","2",")",",","287-290",".","..","[","2","]","Fioruci",",","J",".","A.",",","Pellegrini",",","T.","R.",",","Louzada",",","F.",",","&","Petropoulos",",","F.","(","2015",")",".","The","optimized","theta","method",".","arXiv","preprint","arXiv:1503.03529","."]
code: def forecast(self, steps: int = 1, theta: float = 2) -> pd.Series:
      r"""
      Forecast the model for a given theta
  
      Parameters
      ----------
      steps : int
          The number of steps ahead to compute the forecast components.
      theta : float
          The theta value to use when computing the weight to combine
          the trend and the SES forecasts.
  
      Returns
      -------
      Series
          A Series containing the forecasts
  
      Notes
      -----
      The forecast is computed as
  
      .. math::
  
         \hat{X}_{T+h|T} = \frac{\theta-1}{\theta} b_0
                           \left[h - 1 + \frac{1}{\alpha}
                           - \frac{(1-\alpha)^T}{\alpha} \right]
                           + \tilde{X}_{T+h|T}
  
      where :math:`\tilde{X}_{T+h|T}` is the SES forecast of the endogenous
      variable using the parameter :math:`\alpha`. :math:`b_0` is the
      slope of a time trend line fitted to X using the terms 0, 1, ..., T-1.
  
      This expression follows from [1]_ and [2]_ when the combination
      weights are restricted to be (theta-1)/theta and 1/theta. This nests
      the original implementation when theta=2 and the two weights are both
      1/2.
  
      References
      ----------
      .. [1] Hyndman, R. J., & Billah, B. (2003). Unmasking the Theta method.
         International Journal of Forecasting, 19(2), 287-290.
      .. [2] Fioruci, J. A., Pellegrini, T. R., Louzada, F., & Petropoulos,
         F. (2015). The optimized theta method. arXiv preprint
         arXiv:1503.03529.
      """
  
      steps = int_like(steps, "steps")
      if steps < 1:
          raise ValueError("steps must be a positive integer")
      theta = float_like(theta, "theta")
      if theta < 1:
          raise ValueError("theta must be a float >= 1")
      thresh = 4.0 / np.finfo(np.double).eps
      trend_weight = (theta - 1) / theta if theta < thresh else 1.0
      comp = self.forecast_components(steps=steps)
      fcast = trend_weight * comp.trend + np.asarray(comp.ses)
      # Re-seasonalize if needed
      if self.model.deseasonalize:
          seasonal = np.asarray(comp.seasonal)
          if self.model.method.startswith("mul"):
              fcast *= seasonal
          else:
              fcast += seasonal
      fcast.name = "forecast"
  
      return fcast
  
imports: from typing import TYPE_CHECKING, Optional
  import numpy
  import pandas
  from scipy import stats
  from statsmodels.iolib.summary import Summary
  from statsmodels.iolib.table import SimpleTable
  from statsmodels.tools.validation import array_like, bool_like, float_like, int_like, string_like
  from statsmodels.tsa.deterministic import DeterministicTerm
  from statsmodels.tsa.seasonal import seasonal_decompose
  from statsmodels.tsa.statespace.exponential_smoothing import ExponentialSmoothing
  from statsmodels.tsa.statespace.sarimax import SARIMAX
  from statsmodels.tsa.stattools import acf
  from statsmodels.tsa.tsatools import add_trend, freq_to_period
label_desc: Use image node_id 5 for calling the ThetaModelResults obj's underlying member method code with example usage: obj.forecast(steps, theta) and returns: fcast