class_docstr: Inherits time series methods from TSM class.
  
  **** NON-GAUSSIAN DYNAMIC REGRESSION MODELS ****
  
  Parameters
  ----------
  
  formula : string
      patsy string describing the regression
  
  data : pd.DataFrame
      Field to specify the data that will be used
  
  family : 
      e.g. pf.Normal(0,1)
docstr: Preoptimizes the model by estimating a Gaussian state space models
  
  Returns
  ----------
  - Gaussian model latent variable object
docstr_tok: ["Preoptimizes","the","model","by","estimating","a","Gaussian","state","space","models","Returns","--","--","--","--","--","-","Gaussian","model","latent","variable","object"]
code: def _preoptimize_model(self):
      """Preoptimizes the model by estimating a Gaussian state space models
  
      Returns
      ----------
      - Gaussian model latent variable object
      """
      gaussian_model = DynReg(
          formula=self.formula, data=self.data_original
      )
      gaussian_model.fit()
  
      for i in range(self.z_no - self.family_z_no):
          self.latent_variables.z_list[
              i
          ].start = gaussian_model.latent_variables.get_z_values()[
              i + 1
          ]
  
      if self.model_name2 == "t":
  
          def temp_function(params):
              return -np.sum(
                  ss.t.logpdf(
                      x=self.data,
                      df=np.exp(params[0]),
                      loc=np.ones(self.data.shape[0]) * params[1],
                      scale=np.exp(params[2]),
                  )
              )
  
          p = optimize.minimize(
              temp_function,
              np.array([2.0, 0.0, -1.0]),
              method="L-BFGS-B",
          )
          self.latent_variables.z_list[-2].start = p.x[2]
          self.latent_variables.z_list[-1].start = p.x[0]
  
      elif self.model_name2 == "Skewt":
  
          def temp_function(params):
              return -np.sum(
                  fam.Skewt.logpdf_internal(
                      x=self.data,
                      df=np.exp(params[0]),
                      loc=np.ones(self.data.shape[0]) * params[1],
                      scale=np.exp(params[2]),
                      gamma=np.exp(params[3]),
                  )
              )
  
          p = optimize.minimize(
              temp_function,
              np.array([2.0, 0.0, -1.0, 0.0]),
              method="L-BFGS-B",
          )
          self.latent_variables.z_list[-3].start = p.x[3]
          self.latent_variables.z_list[-2].start = p.x[2]
          self.latent_variables.z_list[-1].start = p.x[0]
  
      return gaussian_model.latent_variables
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  from scipy import optimize
  from ..None import inference
  from ..None import families
  from ..None import output
  from ..None import tsm
  from ..None import data_check
  from ..None import covariances
  from ..None import results
  from ..None import gas
  from .kalman import *
  from .dynlin import *
label_desc: Use image node_id 13 for calling the NDynReg obj's underlying member method code with example usage: obj._preoptimize_model() and returns: gaussian_model, unknown, unknown