class_docstr: Inherits time series methods from TSM class.
  
  **** GENERALIZED AUTOREGRESSIVE SCORE (GAS) REGRESSION MODELS ****
  
  Parameters
  ----------
  
  formula : string
      patsy string describing the regression
  
  data : pd.DataFrame or np.array
      Field to specify the data that will be used
  
  family : GAS family object
      Which distribution to use, e.g. GASNormal()
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","class",".","*","*","*","*","GENERALIZED","AUTOREGRESSIVE","SCORE","(","GAS",")","REGRESSION","MODELS","*","*","*","*","Parameters","--","--","--","--","--","formula",":","string","patsy","string","describing","the","regression","data",":","pd.DataFrame","or","np.array","Field","to","specify","the","data","that","will","be","used","family",":","GAS","family","object","Which","distribution","to","use",",","e.g",".","GASNormal","(",")"]
docstr: Preoptimizes the model by estimating a static model, then a quick search of good dynamic 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","dynamic","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 dynamic 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
      """
  
      # Random search for good starting values
      start_values = []
      start_values.append(np.ones(len(self.X_names)) * -2.0)
      start_values.append(np.ones(len(self.X_names)) * -3.0)
      start_values.append(np.ones(len(self.X_names)) * -4.0)
      start_values.append(np.ones(len(self.X_names)) * -5.0)
  
      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 start_values:
          proposal_start[: len(self.X_names)] = 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
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  import scipy.special
  from patsy import dmatrices, dmatrix, demo_data
  from ..None import families
  from ..None import tsm
  from ..None import data_check
  from .gas_core_recursions import gas_reg_recursion
label_desc: Use image node_id 10 for calling the GASReg obj's underlying member method code with example usage: obj._preoptimize_model(initials, method) and returns: best_start