class_docstr: TSM PARENT CLASS
  
  Contains general time series methods to be inherited by models.
  
  Parameters
  ----------
  model_type : str
      The type of model (e.g. 'ARIMA', 'GARCH')
class_docstr_tok: ["TSM","PARENT","CLASS","Contains","general","time","series","methods","to","be","inherited","by","models",".","Parameters","--","--","--","--","--","model_type",":","str","The","type","of","model","(","e.g",".","'ARIMA","'",",","'GARCH","'",")"]
docstr: Fits a model
  
  Parameters
  ----------
  method : str
      A fitting method (e.g 'MLE'). Defaults to model specific default method.
  
  Returns
  ----------
  None (stores fit information)
docstr_tok: ["Fits","a","model","Parameters","--","--","--","--","--","method",":","str","A","fitting","method","(","e.g","'MLE","'",")",".","Defaults","to","model","specific","default","method",".","Returns","--","--","--","--","--","None","(","stores","fit","information",")"]
code: def fit(self, method=None, **kwargs):
      """Fits a model
  
      Parameters
      ----------
      method : str
          A fitting method (e.g 'MLE'). Defaults to model specific default method.
  
      Returns
      ----------
      None (stores fit information)
      """
  
      cov_matrix = kwargs.get("cov_matrix", None)
      iterations = kwargs.get("iterations", 1000)
      nsims = kwargs.get("nsims", 10000)
      optimizer = kwargs.get("optimizer", "RMSProp")
      batch_size = kwargs.get("batch_size", 12)
      mini_batch = kwargs.get("mini_batch", None)
      map_start = kwargs.get("map_start", True)
      learning_rate = kwargs.get("learning_rate", 0.001)
      record_elbo = kwargs.get("record_elbo", None)
      quiet_progress = kwargs.get("quiet_progress", False)
  
      if method is None:
          method = self.default_method
      elif method not in self.supported_methods:
          raise ValueError("Method not supported!")
  
      if method == "MLE":
          return self._optimize_fit(self.neg_loglik, **kwargs)
      elif method == "PML":
          return self._optimize_fit(self.neg_logposterior, **kwargs)
      elif method == "M-H":
          return self._mcmc_fit(
              nsims=nsims,
              method=method,
              cov_matrix=cov_matrix,
              map_start=map_start,
              quiet_progress=quiet_progress,
          )
      elif method == "Laplace":
          return self._laplace_fit(self.neg_logposterior)
      elif method == "BBVI":
          if mini_batch is None:
              posterior = self.neg_logposterior
          else:
              posterior = self.mb_neg_logposterior
          return self._bbvi_fit(
              posterior,
              optimizer=optimizer,
              iterations=iterations,
              batch_size=batch_size,
              mini_batch=mini_batch,
              map_start=map_start,
              learning_rate=learning_rate,
              record_elbo=record_elbo,
              quiet_progress=quiet_progress,
          )
      elif method == "OLS":
          return self._ols_fit()
  
imports: from math import exp, sqrt, log, tanh
  import copy
  import sys
  import warnings
  import numpy
  from scipy import optimize
  import numdifftools
  import pandas
  from .covariances import acf
  from .families import Normal
  from .inference import BBVI, BBVIM, MetropolisHastings, norm_post_sim
  from .output import TablePrinter
  from .tests import find_p_value
  from .latent_variables import LatentVariable, LatentVariables
  from .results import BBVIResults, MLEResults, LaplaceResults, MCMCResults
label_desc: Use image node_id 8 for calling the TSM obj's underlying member method code with example usage: obj.fit(method) and returns: self, self, self, self, self, self