class_docstr: Nonparametric test for functional form.
  
  Parameters
  ----------
  endog : list
      Dependent variable (training set)
  exog : list of array_like objects
      The independent (right-hand-side) variables
  bw : array_like, str
      Bandwidths for exog or specify method for bandwidth selection
  fform : function
      The functional form ``y = g(b, x)`` to be tested. Takes as inputs
      the RHS variables `exog` and the coefficients ``b`` (betas)
      and returns a fitted ``y_hat``.
  var_type : str
      The type of the independent `exog` variables:
  
          - c: continuous
          - o: ordered
          - u: unordered
  
  estimator : function
      Must return the estimated coefficients b (betas). Takes as inputs
      ``(endog, exog)``.  E.g. least square estimator::
  
          lambda (x,y): np.dot(np.pinv(np.dot(x.T, x)), np.dot(x.T, y))
  
  References
  ----------
  See Racine, J.: "Consistent Significance Testing for Nonparametric
  Regression" Journal of Business & Economics Statistics.
  
  See chapter 12 in [1]  pp. 355-357.
code: def _compute_test_stat(self, u):
      n = np.shape(u)[0]
      XLOO = LeaveOneOut(self.exog)
      uLOO = LeaveOneOut(u[:, None]).__iter__()
      ival = 0
      S2 = 0
      for i, X_not_i in enumerate(XLOO):
          u_j = next(uLOO)
          u_j = np.squeeze(u_j)
          # See Bootstrapping procedure on p. 357 in [1]
          K = gpke(
              self.bw,
              data=-X_not_i,
              data_predict=-self.exog[i, :],
              var_type=self.var_type,
              tosum=False,
          )
          f_i = u[i] * u_j * K
          assert u_j.shape == K.shape
          ival += f_i.sum()  # See eq. 12.7 on p. 355 in [1]
          S2 += (f_i**2).sum()  # See Theorem 12.1 on p.356 in [1]
          assert np.size(ival) == 1
          assert np.size(S2) == 1
  
      ival *= 1.0 / (n * (n - 1))
      ix_cont = _get_type_pos(self.var_type)[0]
      hp = self.bw[ix_cont].prod()
      S2 *= 2 * hp / (n * (n - 1))
      T = n * ival * np.sqrt(hp / S2)
      return T
  
imports: import numpy
  from scipy import optimize
  from scipy.stats.mstats import mquantiles
  from statsmodels.nonparametric.api import KDEMultivariate, KernelReg
  from statsmodels.nonparametric._kernel_base import gpke, LeaveOneOut, _get_type_pos, _adjust_shape
label_desc: Use image node_id 3 for calling the TestFForm obj's underlying member method code with example usage: obj._compute_test_stat(u) and returns: T