code: def sparse_hessian_log_joint(self, x):
          
          T, D = self.T, self.D_latent
          assert x.shape == (T, D)
  
          # Collect the Gaussian LDS prior terms
          J_diag, J_upper_diag = self.sparse_J_prior
          H_diag, H_upper_diag = -J_diag, -J_upper_diag
  
          # Collect the likelihood terms
          H_diag += self.hessian_local_log_likelihood(x)
  
          # Subtract a little bit to ensure negative definiteness
          H_diag -= 1e-8 * np.eye(D)
  
          return H_diag, H_upper_diag
docs: The Hessian includes the quadratic terms of the Gaussian LDS prior
          as well as the Hessian of the local log likelihood.