docstr: This is a wrapper around
  `tbats
  <https://github.com/intive-DataScience/tbats>`_.
  
  This implementation also provides naive frequency inference (when "freq"
  is provided for ``seasonal_periods``),
  as well as Darts-compatible sampling of the resulting normal distribution.
  
  For convenience, the tbats documentation of the parameters is reported here.
  
  Parameters
  ----------
  use_box_cox
      If Box-Cox transformation of original series should be applied.
      When ``None`` both cases shall be considered and better is selected by AIC.
  box_cox_bounds
      Minimal and maximal Box-Cox parameter values.
  use_trend
      Indicates whether to include a trend or not.
      When ``None``, both cases shall be considered and the better one is selected by AIC.
  use_damped_trend
      Indicates whether to include a damping parameter in the trend or not.
      Applies only when trend is used.
      When ``None``, both cases shall be considered and the better one is selected by AIC.
  seasonal_periods
      Length of each of the periods (amount of observations in each period).
      TBATS accepts int and float values here.
      BATS accepts only int values.
      When ``None`` or empty array, non-seasonal model shall be fitted.
      If set to ``"freq"``, a single "naive" seasonality
      based on the series frequency will be used (e.g. [12] for monthly series).
      In this latter case, the seasonality will be recomputed every time the model is fit.
  use_arma_errors
      When True BATS will try to improve the model by modelling residuals with ARMA.
      Best model will be selected by AIC.
      If ``False``, ARMA residuals modeling will not be considered.
  show_warnings
      If warnings should be shown or not.
  n_jobs
      How many jobs to run in parallel when fitting BATS model.
      When not provided BATS shall try to utilize all available cpu cores.
  multiprocessing_start_method
      How threads should be started.
      See https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods
  random_state
      Sets the underlying random seed at model initialization time.
  
  Examples
  --------
  >>> from darts.datasets import AirPassengersDataset
  >>> from darts.models import TBATS # or BATS
  >>> series = AirPassengersDataset().load()
  >>> # based on preliminary analysis, the series contains a trend
  >>> model = TBATS(use_trend=True)
  >>> model.fit(series)
  >>> pred = model.predict(6)
  >>> pred.values()
  array([[448.29856017],
         [439.42215052],
         [507.73465028],
         [493.03751671],
         [498.85885374],
         [564.64871897]])
docstr_tok: ["This","is","a","wrapper","around","`","tbats","<","https",":","\/\/github.com\/intive-DataScience\/tbats",">","`","_",".","This","implementation","also","provides","naive","frequency","inference","(","when","``","freq","''","is","provided","for","``","seasonal_periods","``",")",",","as","well","as","Darts-compatible","sampling","of","the","resulting","normal","distribution",".","For","convenience",",","the","tbats","documentation","of","the","parameters","is","reported","here",".","Parameters","--","--","--","--","--","use_box_cox","If","Box-Cox","transformation","of","original","series","should","be","applied",".","When","``","None","``","both","cases","shall","be","considered","and","better","is","selected","by","AIC",".","box_cox_bounds","Minimal","and","maximal","Box-Cox","parameter","values",".","use_trend","Indicates","whether","to","include","a","trend","or","not",".","When","``","None","``",",","both","cases","shall","be","considered","and","the","better","one","is","selected","by","AIC",".","use_damped_trend","Indicates","whether","to","include","a","damping","parameter","in","the","trend","or","not",".","Applies","only","when","trend","is","used",".","When","``","None","``",",","both","cases","shall","be","considered","and","the","better","one","is","selected","by","AIC",".","seasonal_periods","Length","of","each","of","the","periods","(","amount","of","observations","in","each","period",")",".","TBATS","accepts","int","and","float","values","here",".","BATS","accepts","only","int","values",".","When","``","None","``","or","empty","array",",","non-seasonal","model","shall","be","fitted",".","If","set","to","``","``","freq","''","``",",","a","single","``","naive","''","seasonality","based","on","the","series","frequency","will","be","used","(","e.g",".","[","12","]","for","monthly","series",")",".","In","this","latter","case",",","the","seasonality","will","be","recomputed","every","time","the","model","is","fit",".","use_arma_errors","When","True","BATS","will","try","to","improve","the","model","by","modelling","residuals","with","ARMA",".","Best","model","will","be","selected","by","AIC",".","If","``","False","``",",","ARMA","residuals","modeling","will","not","be","considered",".","show_warnings","If","warnings","should","be","shown","or","not",".","n_jobs","How","many","jobs","to","run","in","parallel","when","fitting","BATS","model",".","When","not","provided","BATS","shall","try","to","utilize","all","available","cpu","cores",".","multiprocessing_start_method","How","threads","should","be","started",".","See","https",":","\/\/docs.python.org\/3\/library\/multiprocessing.html","#","contexts-and-start-methods","random_state","Sets","the","underlying","random","seed","at","model","initialization","time",".","Examples","--","--","--","--",">",">",">","from","darts.datasets","import","AirPassengersDataset",">",">",">","from","darts.models","import","TBATS","#","or","BATS",">",">",">","series","=","AirPassengersDataset","(",")",".load","(",")",">",">",">","#","based","on","preliminary","analysis",",","the","series","contains","a","trend",">",">",">","model","=","TBATS","(","use_trend=True",")",">",">",">","model.fit","(","series",")",">",">",">","pred","=","model.predict","(","6",")",">",">",">","pred.values","(",")","array","(","[","[","448.29856017","]",",","[","439.42215052","]",",","[","507.73465028","]",",","[","493.03751671","]",",","[","498.85885374","]",",","[","564.64871897","]","]",")"]
code: def __init__(
      self,
      use_box_cox: Optional[bool] = None,
      box_cox_bounds: Tuple = (0, 1),
      use_trend: Optional[bool] = None,
      use_damped_trend: Optional[bool] = None,
      seasonal_periods: Optional[Union[str, List]] = "freq",
      use_arma_errors: Optional[bool] = True,
      show_warnings: bool = False,
      n_jobs: Optional[int] = None,
      multiprocessing_start_method: Optional[str] = "spawn",
      random_state: int = 0,
  ):
      """
      This is a wrapper around
      `tbats
      <https://github.com/intive-DataScience/tbats>`_.
  
      This implementation also provides naive frequency inference (when "freq"
      is provided for ``seasonal_periods``),
      as well as Darts-compatible sampling of the resulting normal distribution.
  
      For convenience, the tbats documentation of the parameters is reported here.
  
      Parameters
      ----------
      use_box_cox
          If Box-Cox transformation of original series should be applied.
          When ``None`` both cases shall be considered and better is selected by AIC.
      box_cox_bounds
          Minimal and maximal Box-Cox parameter values.
      use_trend
          Indicates whether to include a trend or not.
          When ``None``, both cases shall be considered and the better one is selected by AIC.
      use_damped_trend
          Indicates whether to include a damping parameter in the trend or not.
          Applies only when trend is used.
          When ``None``, both cases shall be considered and the better one is selected by AIC.
      seasonal_periods
          Length of each of the periods (amount of observations in each period).
          TBATS accepts int and float values here.
          BATS accepts only int values.
          When ``None`` or empty array, non-seasonal model shall be fitted.
          If set to ``"freq"``, a single "naive" seasonality
          based on the series frequency will be used (e.g. [12] for monthly series).
          In this latter case, the seasonality will be recomputed every time the model is fit.
      use_arma_errors
          When True BATS will try to improve the model by modelling residuals with ARMA.
          Best model will be selected by AIC.
          If ``False``, ARMA residuals modeling will not be considered.
      show_warnings
          If warnings should be shown or not.
      n_jobs
          How many jobs to run in parallel when fitting BATS model.
          When not provided BATS shall try to utilize all available cpu cores.
      multiprocessing_start_method
          How threads should be started.
          See https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods
      random_state
          Sets the underlying random seed at model initialization time.
  
      Examples
      --------
      >>> from darts.datasets import AirPassengersDataset
      >>> from darts.models import TBATS # or BATS
      >>> series = AirPassengersDataset().load()
      >>> # based on preliminary analysis, the series contains a trend
      >>> model = TBATS(use_trend=True)
      >>> model.fit(series)
      >>> pred = model.predict(6)
      >>> pred.values()
      array([[448.29856017],
             [439.42215052],
             [507.73465028],
             [493.03751671],
             [498.85885374],
             [564.64871897]])
      """
      super().__init__()
  
      self.kwargs = {
          "use_box_cox": use_box_cox,
          "box_cox_bounds": box_cox_bounds,
          "use_trend": use_trend,
          "use_damped_trend": use_damped_trend,
          "seasonal_periods": seasonal_periods,
          "use_arma_errors": use_arma_errors,
          "show_warnings": show_warnings,
          "n_jobs": n_jobs,
          "multiprocessing_start_method": multiprocessing_start_method,
      }
  
      self.seasonal_periods = seasonal_periods
      self.infer_seasonal_periods = seasonal_periods == "freq"
      self.model = None
      np.random.seed(random_state)
  
imports: from abc import ABC, abstractmethod
  from typing import List, Optional, Tuple, Union
  import numpy
  from scipy.special import inv_boxcox
  from tbats import BATS
  from tbats import TBATS
  from darts.logging import get_logger
  from darts.models.forecasting.forecasting_model import LocalForecastingModel
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 1 to create a new _BaseBatsTbatsModel object from inherited base classes: LocalForecastingModel, ABC with example: obj = _BaseBatsTbatsModel(use_box_cox, box_cox_bounds, use_trend, use_damped_trend, seasonal_periods, use_arma_errors, show_warnings, n_jobs, multiprocessing_start_method, random_state)