class_docstr: Sliced Average Variance Estimation (SAVE)
  
  Parameters
  ----------
  endog : array_like (1d)
      The dependent variable
  exog : array_like (2d)
      The covariates
  bc : bool, optional
      If True, use the bias-corrected CSAVE method of Li and Zhu.
  
  References
  ----------
  RD Cook.  SAVE: A method for dimension reduction and graphics
  in regression.
  http://www.stat.umn.edu/RegGraph/RecentDev/save.pdf
  
  Y Li, L-X Zhu (2007). Asymptotics for sliced average
  variance estimation.  The Annals of Statistics.
  https://arxiv.org/pdf/0708.0462.pdf
class_docstr_tok: ["Sliced","Average","Variance","Estimation","(","SAVE",")","Parameters","--","--","--","--","--","endog",":","array_like","(","1d",")","The","dependent","variable","exog",":","array_like","(","2d",")","The","covariates","bc",":","bool",",","optional","If","True",",","use","the","bias-corrected","CSAVE","method","of","Li","and","Zhu",".","References","--","--","--","--","--","RD","Cook",".","SAVE",":","A","method","for","dimension","reduction","and","graphics","in","regression",".","http",":","\/\/www.stat.umn.edu\/RegGraph\/RecentDev\/save.pdf","Y","Li",",","L-X","Zhu","(","2007",")",".","Asymptotics","for","sliced","average","variance","estimation",".","The","Annals","of","Statistics",".","https",":","\/\/arxiv.org\/pdf\/0708.0462.pdf"]
docstr: Estimate the EDR space.
  
  Parameters
  ----------
  slice_n : int
      Number of observations per slice
docstr_tok: ["Estimate","the","EDR","space",".","Parameters","--","--","--","--","--","slice_n",":","int","Number","of","observations","per","slice"]
code: def fit(self, **kwargs):
      """
      Estimate the EDR space.
  
      Parameters
      ----------
      slice_n : int
          Number of observations per slice
      """
  
      # Sample size per slice
      slice_n = kwargs.get("slice_n", 50)
  
      # Number of slices
      n_slice = self.exog.shape[0] // slice_n
  
      self._prep(n_slice)
  
      cv = [np.cov(z.T) for z in self._split_wexog]
      ns = [z.shape[0] for z in self._split_wexog]
  
      p = self.wexog.shape[1]
  
      if not self.bc:
          # Cook's original approach
          vm = 0
          for w, cvx in zip(ns, cv):
              icv = np.eye(p) - cvx
              vm += w * np.dot(icv, icv)
          vm /= len(cv)
      else:
          # The bias-corrected approach of Li and Zhu
  
          # \Lambda_n in Li, Zhu
          av = 0
          for c in cv:
              av += np.dot(c, c)
          av /= len(cv)
  
          # V_n in Li, Zhu
          vn = 0
          for x in self._split_wexog:
              r = x - x.mean(0)
              for i in range(r.shape[0]):
                  u = r[i, :]
                  m = np.outer(u, u)
                  vn += np.dot(m, m)
          vn /= self.exog.shape[0]
  
          c = np.mean(ns)
          k1 = c * (c - 1) / ((c - 1) ** 2 + 1)
          k2 = (c - 1) / ((c - 1) ** 2 + 1)
          av2 = k1 * av - k2 * vn
  
          vm = np.eye(p) - 2 * sum(cv) / len(cv) + av2
  
      a, b = np.linalg.eigh(vm)
      jj = np.argsort(-a)
      a = a[jj]
      b = b[:, jj]
      params = np.linalg.solve(self._covxr.T, b)
  
      results = DimReductionResults(self, params, eigs=a)
      return DimReductionResultsWrapper(results)
  
imports: import warnings
  import numpy
  import pandas
  from statsmodels.base import model
  import statsmodels.base.wrapper
  from statsmodels.tools.sm_exceptions import ConvergenceWarning
label_desc: Use image node_id 2 for calling the SlicedAverageVarianceEstimation obj's underlying member method code with example usage: obj.fit() and returns: DimReductionResultsWrapper