code: def test_predict(self):
      res1 = self.res1
      res2 = self.res2
  
      # mean of untruncated distribution
      rdf = res2.margins_means.table
      pred = res1.get_prediction(which="mean-main", average=True)
      assert_allclose(pred.predicted, rdf[0], rtol=5e-5)
      assert_allclose(pred.se, rdf[1], rtol=5e-4, atol=1e-10)
      ci = pred.conf_int()[0]
      assert_allclose(ci[0], rdf[4], rtol=1e-5, atol=1e-10)
      assert_allclose(ci[1], rdf[5], rtol=1e-5, atol=1e-10)
  
      # mean of untruncated distribution, evaluated and exog.mean()
      ex = res1.model.exog.mean(0)
      rdf = res2.margins_atmeans.table
      pred = res1.get_prediction(ex, which="mean-main")
      assert_allclose(pred.predicted, rdf[0], rtol=5e-5)
      assert_allclose(pred.se, rdf[1], rtol=5e-4, atol=1e-10)
      ci = pred.conf_int()[0]
      assert_allclose(ci[0], rdf[4], rtol=5e-5, atol=1e-10)
      assert_allclose(ci[1], rdf[5], rtol=5e-5, atol=1e-10)
  
      # mean of truncated distribution, E(y | y > trunc)
      rdf = res2.margins_cm.table
      try:
          pred = res1.get_prediction(average=True)
      except NotImplementedError:
          # not yet implemented for truncation > 0
          pred = None
      if pred is not None:
          assert_allclose(pred.predicted, rdf[0], rtol=5e-5)
          assert_allclose(pred.se, rdf[1], rtol=1e-5, atol=1e-10)
          ci = pred.conf_int()[0]
          assert_allclose(ci[0], rdf[4], rtol=1e-5, atol=1e-10)
          assert_allclose(ci[1], rdf[5], rtol=1e-5, atol=1e-10)
  
      # predicted probabilites, only subset is common to reference
      ex = res1.model.exog.mean(0)
      rdf = res2.margins_cpr.table
      start_idx = res1.model.truncation + 1
      k = rdf.shape[0] + res1.model.truncation
      pred = res1.get_prediction(which="prob", average=True)
      assert_allclose(
          pred.predicted[start_idx:k], rdf[:-1, 0], rtol=5e-5
      )
      assert_allclose(
          pred.se[start_idx:k], rdf[:-1, 1], rtol=5e-4, atol=1e-10
      )
      ci = pred.conf_int()[start_idx:k]
      assert_allclose(ci[:, 0], rdf[:-1, 4], rtol=5e-5, atol=1e-10)
      assert_allclose(ci[:, 1], rdf[:-1, 5], rtol=5e-5, atol=1e-10)
  
      # untruncated predicted probabilites, subset is common to reference
      ex = res1.model.exog.mean(0)
      rdf = res2.margins_pr.table
      k = rdf.shape[0] - 1
      pred = res1.get_prediction(which="prob-base", average=True)
      assert_allclose(pred.predicted[:k], rdf[:-1, 0], rtol=5e-5)
      assert_allclose(pred.se[:k], rdf[:-1, 1], rtol=8e-4, atol=1e-10)
      ci = pred.conf_int()[:k]
      assert_allclose(ci[:, 0], rdf[:-1, 4], rtol=5e-4, atol=1e-10)
      assert_allclose(ci[:, 1], rdf[:-1, 5], rtol=5e-4, atol=1e-10)
  
imports: import warnings
  import numpy
  from numpy.testing import assert_allclose, assert_equal
  from statsmodels import datasets
  from statsmodels.tools.tools import add_constant
  from statsmodels.tools.testing import Holder
  from statsmodels.tools.sm_exceptions import ConvergenceWarning
  from statsmodels.distributions.discrete import truncatedpoisson, truncatednegbin
  from statsmodels.discrete.truncated_model import TruncatedLFPoisson, TruncatedLFNegativeBinomialP, HurdleCountModel
  from statsmodels.sandbox.regression.tests.test_gmm_poisson import DATA
  from .results.results_discrete import RandHIE
  from .results import results_truncated
  from .results import results_truncated_st
label_desc: Use image node_id 2 for calling the CheckTruncatedST obj's underlying member method code with example usage: obj.test_predict() without return types