class_docstr: The Theta forecasting model of Assimakopoulos and Nikolopoulos (2000)
  
  Parameters
  ----------
  endog : array_like, 1d
      The data to forecast.
  period : int, default None
      The period of the data that is used in the seasonality test and
      adjustment. If None then the period is determined from y's index,
      if available.
  deseasonalize : bool, default True
      A flag indicating whether the deseasonalize the data. If True and
      use_test is True, the data is only deseasonalized if the null of no
      seasonal component is rejected.
  use_test : bool, default True
      A flag indicating whether test the period-th autocorrelation. If this
      test rejects using a size of 10%, then decomposition is used. Set to
      False to skip the test.
  method : {"auto", "additive", "multiplicative"}, default "auto"
      The model used for the seasonal decomposition. "auto" uses a
      multiplicative if y is non-negative and all estimated seasonal
      components are positive. If either of these conditions is False,
      then it uses an additive decomposition.
  difference : bool, default False
      A flag indicating to difference the data before testing for
      seasonality.
  
  See Also
  --------
  statsmodels.tsa.statespace.exponential_smoothing.ExponentialSmoothing
      Exponential smoothing parameter estimation and forecasting
  statsmodels.tsa.statespace.sarimax.SARIMAX
      Seasonal ARIMA parameter estimation and forecasting
  
  Notes
  -----
  The Theta model forecasts the future as a weighted combination of two
  Theta lines.  This class supports combinations of models with two
  thetas: 0 and a user-specified choice (default 2). The forecasts are
  then
  
  .. 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.
  
  The model is estimated in steps:
  
  1. Test for seasonality
  2. Deseasonalize if seasonality detected
  3. Estimate :math:`\alpha` by fitting a SES model to the data and
     :math:`b_0` by OLS.
  4. Forecast the series
  5. Reseasonalize if the data was deseasonalized.
  
  The seasonality test examines where the autocorrelation at the
  seasonal period is different from zero. The seasonality is then
  removed using a seasonal decomposition with a multiplicative trend.
  If the seasonality estimate is non-positive then an additive trend
  is used instead. The default deseasonalizing method can be changed
  using the options.
  
  References
  ----------
  .. [1] Assimakopoulos, V., & Nikolopoulos, K. (2000). The theta model: a
     decomposition approach to forecasting. International Journal of
     Forecasting, 16(4), 521-530.
  .. [2] Hyndman, R. J., & Billah, B. (2003). Unmasking the Theta method.
     International Journal of Forecasting, 19(2), 287-290.
  .. [3] Fioruci, J. A., Pellegrini, T. R., Louzada, F., & Petropoulos, F.
     (2015). The optimized theta method. arXiv preprint arXiv:1503.03529.
class_docstr_tok: ["The","Theta","forecasting","model","of","Assimakopoulos","and","Nikolopoulos","(","2000",")","Parameters","--","--","--","--","--","endog",":","array_like",",","1d","The","data","to","forecast",".","period",":","int",",","default","None","The","period","of","the","data","that","is","used","in","the","seasonality","test","and","adjustment",".","If","None","then","the","period","is","determined","from","y","'s","index",",","if","available",".","deseasonalize",":","bool",",","default","True","A","flag","indicating","whether","the","deseasonalize","the","data",".","If","True","and","use_test","is","True",",","the","data","is","only","deseasonalized","if","the","null","of","no","seasonal","component","is","rejected",".","use_test",":","bool",",","default","True","A","flag","indicating","whether","test","the","period-th","autocorrelation",".","If","this","test","rejects","using","a","size","of","10","%",",","then","decomposition","is","used",".","Set","to","False","to","skip","the","test",".","method",":","{","``","auto","''",",","``","additive","''",",","``","multiplicative","''","}",",","default","``","auto","''","The","model","used","for","the","seasonal","decomposition",".","``","auto","''","uses","a","multiplicative","if","y","is","non-negative","and","all","estimated","seasonal","components","are","positive",".","If","either","of","these","conditions","is","False",",","then","it","uses","an","additive","decomposition",".","difference",":","bool",",","default","False","A","flag","indicating","to","difference","the","data","before","testing","for","seasonality",".","See","Also","--","--","--","--","statsmodels.tsa.statespace.exponential_smoothing.ExponentialSmoothing","Exponential","smoothing","parameter","estimation","and","forecasting","statsmodels.tsa.statespace.sarimax.SARIMAX","Seasonal","ARIMA","parameter","estimation","and","forecasting","Notes","--","--","-","The","Theta","model","forecasts","the","future","as","a","weighted","combination","of","two","Theta","lines",".","This","class","supports","combinations","of","models","with","two","thetas",":","0","and","a","user-specified","choice","(","default","2",")",".","The","forecasts","are","then","..","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",".","The","model","is","estimated","in","steps",":","1",".","Test","for","seasonality","2",".","Deseasonalize","if","seasonality","detected","3",".","Estimate",":","math",":","`","\\alpha","`","by","fitting","a","SES","model","to","the","data","and",":","math",":","`","b_0","`","by","OLS",".","4",".","Forecast","the","series","5",".","Reseasonalize","if","the","data","was","deseasonalized",".","The","seasonality","test","examines","where","the","autocorrelation","at","the","seasonal","period","is","different","from","zero",".","The","seasonality","is","then","removed","using","a","seasonal","decomposition","with","a","multiplicative","trend",".","If","the","seasonality","estimate","is","non-positive","then","an","additive","trend","is","used","instead",".","The","default","deseasonalizing","method","can","be","changed","using","the","options",".","References","--","--","--","--","--","..","[","1","]","Assimakopoulos",",","V.",",","&","Nikolopoulos",",","K.","(","2000",")",".","The","theta","model",":","a","decomposition","approach","to","forecasting",".","International","Journal","of","Forecasting",",","16","(","4",")",",","521-530",".","..","[","2","]","Hyndman",",","R.","J.",",","&","Billah",",","B",".","(","2003",")",".","Unmasking","the","Theta","method",".","International","Journal","of","Forecasting",",","19","(","2",")",",","287-290",".","..","[","3","]","Fioruci",",","J",".","A.",",","Pellegrini",",","T.","R.",",","Louzada",",","F.",",","&","Petropoulos",",","F.","(","2015",")",".","The","optimized","theta","method",".","arXiv","preprint","arXiv:1503.03529","."]
docstr: Whether the data is differenced in the seasonality test
docstr_tok: ["Whether","the","data","is","differenced","in","the","seasonality","test"]
code: def difference(self) -> bool:
      """Whether the data is differenced in the seasonality test"""
      return self._diff
  
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 8 for calling the ThetaModel obj's underlying member method code with example usage: obj.difference() and returns: self