code: def _preoptimize_model(self):
          
          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
docs: Preoptimizes the model by estimating a Gaussian state space models
          
          Returns
          ----------
          - Gaussian model latent variable object