class_docstr: Inherits time series methods from TSM class.
  
  **** GENERALIZED AUTOREGRESSIVE SCORE (GAS) MODELS ****
  
  Parameters
  ----------
  data : pd.DataFrame or np.array
      Field to specify the univariate time series data that will be used.
  
  ar : int
      Field to specify how many AR lags the model will have.
  
  sc : int
      Field to specify how many score lags terms the model will have.
  
  family : GAS family object
      Which distribution to use, e.g. GASNormal()
  
  integ : int (default : 0)
      Specifies how many time to difference the time series.
  
  target : str (pd.DataFrame) or int (np.array)
      Specifies which column name or array index to use. By default, first
      column/array will be selected as the dependent variable.
docstr: Preoptimizes the model by estimating a static model, then a quick search of good AR/SC parameters
  
  Parameters
  ----------
  initials : np.array
      A vector of inital values
  
  method : str
      One of 'MLE' or 'PML' (the optimization options)
  
  Returns
  ----------
  Y_exp : np.array
      Vector of past values and predictions 
docstr_tok: ["Preoptimizes","the","model","by","estimating","a","static","model",",","then","a","quick","search","of","good","AR\/SC","parameters","Parameters","--","--","--","--","--","initials",":","np.array","A","vector","of","inital","values","method",":","str","One","of","'MLE","'","or","'PML","'","(","the","optimization","options",")","Returns","--","--","--","--","--","Y_exp",":","np.array","Vector","of","past","values","and","predictions"]
code: def _preoptimize_model(self, initials, method):
      """Preoptimizes the model by estimating a static model, then a quick search of good AR/SC parameters
  
      Parameters
      ----------
      initials : np.array
          A vector of inital values
  
      method : str
          One of 'MLE' or 'PML' (the optimization options)
  
      Returns
      ----------
      Y_exp : np.array
          Vector of past values and predictions
      """
      if not (self.ar == 0 and self.sc == 0):
          toy_model = GAS(
              ar=0,
              sc=0,
              integ=self.integ,
              family=self.family,
              data=self.data_original,
          )
          toy_model.fit(method)
          self.latent_variables.z_list[
              0
          ].start = toy_model.latent_variables.get_z_values(
              transformed=False
          )[
              0
          ]
  
          for extra_z in range(
              len(self.family.build_latent_variables())
          ):
              self.latent_variables.z_list[
                  1 + self.ar + self.sc + extra_z
              ].start = toy_model.latent_variables.get_z_values(
                  transformed=False
              )[
                  1 + extra_z
              ]
  
          # Random search for good AR/SC starting values
          random_starts = np.random.normal(
              0.3, 0.3, [self.ar + self.sc, 1000]
          )
  
          best_start = self.latent_variables.get_z_starting_values()
          best_lik = self.neg_loglik(
              self.latent_variables.get_z_starting_values()
          )
          proposal_start = best_start.copy()
  
          for start in range(random_starts.shape[1]):
              proposal_start[1 : 1 + self.ar + self.sc] = random_starts[
                  :, start
              ]
              proposal_start[0] = proposal_start[0] * (
                  1.0 - np.sum(random_starts[: self.ar, start])
              )
              proposal_likelihood = self.neg_loglik(proposal_start)
              if proposal_likelihood < best_lik:
                  best_lik = proposal_likelihood
                  best_start = proposal_start.copy()
          return best_start
      else:
          return initials
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  import scipy.special
  from ..None import families
  from ..None import tsm
  from ..None import data_check
  from .gas_core_recursions import gas_recursion
label_desc: Use image node_id 11 for calling the GAS obj's underlying member method code with example usage: obj._preoptimize_model(initials, method) and returns: best_start, initials