code: def _accumulate_sufficient_statistics(self, stats, X, framelogprob,
                                            posteriors, fwdlattice, bwdlattice):
          
          stats['nobs'] += 1
          if 's' in self.params:
              stats['start'] += posteriors[0]
          if 't' in self.params:
              n_samples, n_components = framelogprob.shape
              # when the sample is of length 1, it contains no transitions
              # so there is no reason to update our trans. matrix estimate
              if n_samples <= 1:
                  return
  
              log_xi_sum = np.full((n_components, n_components), -np.inf)
              _hmmc._compute_log_xi_sum(n_samples, n_components, fwdlattice,
                                        log_mask_zero(self.transmat_),
                                        bwdlattice, framelogprob,
                                        log_xi_sum)
              with np.errstate(under="ignore"):
                  stats['trans'] += np.exp(log_xi_sum)
docs: Updates sufficient statistics from a given sample.
  
          Parameters
          ----------
          stats : dict
              Sufficient statistics as returned by
              :meth:`~base._BaseHMM._initialize_sufficient_statistics`.
  
          X : array, shape (n_samples, n_features)
              Sample sequence.
  
          framelogprob : array, shape (n_samples, n_components)
              Log-probabilities of each sample under each of the model states.
  
          posteriors : array, shape (n_samples, n_components)
              Posterior probabilities of each sample being generated by each
              of the model states.
  
          fwdlattice, bwdlattice : array, shape (n_samples, n_components)
              Log-forward and log-backward probabilities.