class_docstr: Conditional multivariate kernel density estimator.
  
  Calculates ``P(Y_1,Y_2,...Y_n | X_1,X_2...X_m) =
  P(X_1, X_2,...X_n, Y_1, Y_2,..., Y_m)/P(X_1, X_2,..., X_m)``.
  The conditional density is by definition the ratio of the two densities,
  see [1]_.
  
  Parameters
  ----------
  endog : list of ndarrays or 2-D ndarray
      The training data for the dependent variables, used to determine
      the bandwidth(s).  If a 2-D array, should be of shape
      (num_observations, num_variables).  If a list, each list element is a
      separate observation.
  exog : list of ndarrays or 2-D ndarray
      The training data for the independent variable; same shape as `endog`.
  dep_type : str
      The type of the dependent variables:
  
          c : Continuous
          u : Unordered (Discrete)
          o : Ordered (Discrete)
  
      The string should contain a type specifier for each variable, so for
      example ``dep_type='ccuo'``.
  indep_type : str
      The type of the independent variables; specified like `dep_type`.
  bw : array_like or str, optional
      If an array, it is a fixed user-specified bandwidth.  If a string,
      should be one of:
  
          - normal_reference: normal reference rule of thumb (default)
          - cv_ml: cross validation maximum likelihood
          - cv_ls: cross validation least squares
  
  defaults : Instance of class EstimatorSettings
      The default values for the efficient bandwidth estimation
  
  Attributes
  ----------
  bw : array_like
      The bandwidth parameters
  
  See Also
  --------
  KDEMultivariate
  
  References
  ----------
  .. [1] https://en.wikipedia.org/wiki/Conditional_probability_distribution
  
  Examples
  --------
  >>> import statsmodels.api as sm
  >>> nobs = 300
  >>> c1 = np.random.normal(size=(nobs,1))
  >>> c2 = np.random.normal(2,1,size=(nobs,1))
  
  >>> dens_c = sm.nonparametric.KDEMultivariateConditional(endog=[c1],
  ...     exog=[c2], dep_type='c', indep_type='c', bw='normal_reference')
  >>> dens_c.bw   # show computed bandwidth
  array([ 0.41223484,  0.40976931])
class_docstr_tok: ["Conditional","multivariate","kernel","density","estimator",".","Calculates","``","P","(","Y_1",",","Y_2",",","...","Y_n","|","X_1",",","X_2","...","X_m",")","=","P","(","X_1",",","X_2",",","...","X_n",",","Y_1",",","Y_2",",","...",",","Y_m",")","\/P","(","X_1",",","X_2",",","...",",","X_m",")","``",".","The","conditional","density","is","by","definition","the","ratio","of","the","two","densities",",","see","[","1","]","_.","Parameters","--","--","--","--","--","endog",":","list","of","ndarrays","or","2-D","ndarray","The","training","data","for","the","dependent","variables",",","used","to","determine","the","bandwidth","(","s",")",".","If","a","2-D","array",",","should","be","of","shape","(","num_observations",",","num_variables",")",".","If","a","list",",","each","list","element","is","a","separate","observation",".","exog",":","list","of","ndarrays","or","2-D","ndarray","The","training","data","for","the","independent","variable",";","same","shape","as","`","endog","`",".","dep_type",":","str","The","type","of","the","dependent","variables",":","c",":","Continuous","u",":","Unordered","(","Discrete",")","o",":","Ordered","(","Discrete",")","The","string","should","contain","a","type","specifier","for","each","variable",",","so","for","example","``","dep_type='ccuo","'","``",".","indep_type",":","str","The","type","of","the","independent","variables",";","specified","like","`","dep_type","`",".","bw",":","array_like","or","str",",","optional","If","an","array",",","it","is","a","fixed","user-specified","bandwidth",".","If","a","string",",","should","be","one","of",":","-","normal_reference",":","normal","reference","rule","of","thumb","(","default",")","-","cv_ml",":","cross","validation","maximum","likelihood","-","cv_ls",":","cross","validation","least","squares","defaults",":","Instance","of","class","EstimatorSettings","The","default","values","for","the","efficient","bandwidth","estimation","Attributes","--","--","--","--","--","bw",":","array_like","The","bandwidth","parameters","See","Also","--","--","--","--","KDEMultivariate","References","--","--","--","--","--","..","[","1","]","https",":","\/\/en.wikipedia.org\/wiki\/Conditional_probability_distribution","Examples","--","--","--","--",">",">",">","import","statsmodels.api","as","sm",">",">",">","nobs","=","300",">",">",">","c1","=","np.random.normal","(","size=","(","nobs,1",")",")",">",">",">","c2","=","np.random.normal","(","2,1",",","size=","(","nobs,1",")",")",">",">",">","dens_c","=","sm.nonparametric.KDEMultivariateConditional","(","endog=","[","c1","]",",","...","exog=","[","c2","]",",","dep_type=","'","c","'",",","indep_type=","'","c","'",",","bw='normal_reference","'",")",">",">",">","dens_c.bw","#","show","computed","bandwidth","array","(","[","0.41223484",",","0.40976931","]",")"]
docstr: Cumulative distribution function for the conditional density.
  
  Parameters
  ----------
  endog_predict : array_like, optional
      The evaluation dependent variables at which the cdf is estimated.
      If not specified the training dependent variables are used.
  exog_predict : array_like, optional
      The evaluation independent variables at which the cdf is estimated.
      If not specified the training independent variables are used.
  
  Returns
  -------
  cdf_est : array_like
      The estimate of the cdf.
  
  Notes
  -----
  For more details on the estimation see [2]_, and p.181 in [1]_.
  
  The multivariate conditional CDF for mixed data (continuous and
  ordered/unordered discrete) is estimated by:
  
  .. math::
  
      F(y|x)=\frac{n^{-1}\sum_{i=1}^{n}G(\frac{y-Y_{i}}{h_{0}}) W_{h}(X_{i},x)}{\widehat{\mu}(x)}
  
  where G() is the product kernel CDF estimator for the dependent (y)
  variable(s) and W() is the product kernel CDF estimator for the
  independent variable(s).
  
  References
  ----------
  .. [1] Racine, J., Li, Q. Nonparametric econometrics: theory and
          practice. Princeton University Press. (2007)
  .. [2] Liu, R., Yang, L. "Kernel estimation of multivariate cumulative
              distribution function." Journal of Nonparametric
              Statistics (2008)
docstr_tok: ["Cumulative","distribution","function","for","the","conditional","density",".","Parameters","--","--","--","--","--","endog_predict",":","array_like",",","optional","The","evaluation","dependent","variables","at","which","the","cdf","is","estimated",".","If","not","specified","the","training","dependent","variables","are","used",".","exog_predict",":","array_like",",","optional","The","evaluation","independent","variables","at","which","the","cdf","is","estimated",".","If","not","specified","the","training","independent","variables","are","used",".","Returns","--","--","--","-","cdf_est",":","array_like","The","estimate","of","the","cdf",".","Notes","--","--","-","For","more","details","on","the","estimation","see","[","2","]","_",",","and","p.181","in","[","1","]","_",".","The","multivariate","conditional","CDF","for","mixed","data","(","continuous","and","ordered\/unordered","discrete",")","is","estimated","by",":","..","math",":",":","F","(","y|x",")","=\\frac","{","n^","{","-1","}","\\sum_","{","i=1","}","^","{","n","}","G","(","\\frac","{","y-Y_","{","i","}","}","{","h_","{","0","}","}",")","W_","{","h","}","(","X_","{","i","}",",","x",")","}","{","\\widehat","{","\\mu","}","(","x",")","}","where","G","(",")","is","the","product","kernel","CDF","estimator","for","the","dependent","(","y",")","variable","(","s",")","and","W","(",")","is","the","product","kernel","CDF","estimator","for","the","independent","variable","(","s",")",".","References","--","--","--","--","--","..","[","1","]","Racine",",","J.",",","Li",",","Q.","Nonparametric","econometrics",":","theory","and","practice",".","Princeton","University","Press",".","(","2007",")","..","[","2","]","Liu",",","R.",",","Yang",",","L.","``","Kernel","estimation","of","multivariate","cumulative","distribution","function",".","''","Journal","of","Nonparametric","Statistics","(","2008",")"]
code: def cdf(self, endog_predict=None, exog_predict=None):
      r"""
      Cumulative distribution function for the conditional density.
  
      Parameters
      ----------
      endog_predict : array_like, optional
          The evaluation dependent variables at which the cdf is estimated.
          If not specified the training dependent variables are used.
      exog_predict : array_like, optional
          The evaluation independent variables at which the cdf is estimated.
          If not specified the training independent variables are used.
  
      Returns
      -------
      cdf_est : array_like
          The estimate of the cdf.
  
      Notes
      -----
      For more details on the estimation see [2]_, and p.181 in [1]_.
  
      The multivariate conditional CDF for mixed data (continuous and
      ordered/unordered discrete) is estimated by:
  
      .. math::
  
          F(y|x)=\frac{n^{-1}\sum_{i=1}^{n}G(\frac{y-Y_{i}}{h_{0}}) W_{h}(X_{i},x)}{\widehat{\mu}(x)}
  
      where G() is the product kernel CDF estimator for the dependent (y)
      variable(s) and W() is the product kernel CDF estimator for the
      independent variable(s).
  
      References
      ----------
      .. [1] Racine, J., Li, Q. Nonparametric econometrics: theory and
              practice. Princeton University Press. (2007)
      .. [2] Liu, R., Yang, L. "Kernel estimation of multivariate cumulative
                  distribution function." Journal of Nonparametric
                  Statistics (2008)
      """
      if endog_predict is None:
          endog_predict = self.endog
      else:
          endog_predict = _adjust_shape(endog_predict, self.k_dep)
      if exog_predict is None:
          exog_predict = self.exog
      else:
          exog_predict = _adjust_shape(exog_predict, self.k_indep)
  
      N_data_predict = np.shape(exog_predict)[0]
      cdf_est = np.empty(N_data_predict)
      for i in range(N_data_predict):
          mu_x = (
              gpke(
                  self.bw[self.k_dep :],
                  data=self.exog,
                  data_predict=exog_predict[i, :],
                  var_type=self.indep_type,
              )
              / self.nobs
          )
          mu_x = np.squeeze(mu_x)
          cdf_endog = gpke(
              self.bw[0 : self.k_dep],
              data=self.endog,
              data_predict=endog_predict[i, :],
              var_type=self.dep_type,
              ckertype="gaussian_cdf",
              ukertype="aitchisonaitken_cdf",
              okertype="wangryzin_cdf",
              tosum=False,
          )
  
          cdf_exog = gpke(
              self.bw[self.k_dep :],
              data=self.exog,
              data_predict=exog_predict[i, :],
              var_type=self.indep_type,
              tosum=False,
          )
          S = (cdf_endog * cdf_exog).sum(axis=0)
          cdf_est[i] = S / (self.nobs * mu_x)
  
      return cdf_est
  
imports: import numpy
  from .None import kernels
  from ._kernel_base import GenericKDE, EstimatorSettings, gpke, LeaveOneOut, _adjust_shape
label_desc: Use image node_id 5 for calling the KDEMultivariateConditional obj's underlying member method code with example usage: obj.cdf(endog_predict, exog_predict) and returns: cdf_est