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: Returns the leave-one-out conditional likelihood of the data.
  
  If `func` is not equal to the default, what's calculated is a function
  of the leave-one-out conditional likelihood.
  
  Parameters
  ----------
  bw : array_like
      The bandwidth parameter(s).
  func : callable, optional
      Function to transform the likelihood values (before summing); for
      the log likelihood, use ``func=np.log``.  Default is ``f(x) = x``.
  
  Returns
  -------
  L : float
      The value of the leave-one-out function for the data.
  
  Notes
  -----
  Similar to ``KDE.loo_likelihood`, but substitute ``f(y|x)=f(x,y)/f(x)``
  for ``f(x)``.
docstr_tok: ["Returns","the","leave-one-out","conditional","likelihood","of","the","data",".","If","`","func","`","is","not","equal","to","the","default",",","what","'s","calculated","is","a","function","of","the","leave-one-out","conditional","likelihood",".","Parameters","--","--","--","--","--","bw",":","array_like","The","bandwidth","parameter","(","s",")",".","func",":","callable",",","optional","Function","to","transform","the","likelihood","values","(","before","summing",")",";","for","the","log","likelihood",",","use","``","func=np.log","``",".","Default","is","``","f","(","x",")","=","x","``",".","Returns","--","--","--","-","L",":","float","The","value","of","the","leave-one-out","function","for","the","data",".","Notes","--","--","-","Similar","to","``","KDE.loo_likelihood","`",",","but","substitute","``","f","(","y|x",")","=f","(","x",",","y",")","\/f","(","x",")","``","for","``","f","(","x",")","``","."]
code: def loo_likelihood(self, bw, func=lambda x: x):
      """
      Returns the leave-one-out conditional likelihood of the data.
  
      If `func` is not equal to the default, what's calculated is a function
      of the leave-one-out conditional likelihood.
  
      Parameters
      ----------
      bw : array_like
          The bandwidth parameter(s).
      func : callable, optional
          Function to transform the likelihood values (before summing); for
          the log likelihood, use ``func=np.log``.  Default is ``f(x) = x``.
  
      Returns
      -------
      L : float
          The value of the leave-one-out function for the data.
  
      Notes
      -----
      Similar to ``KDE.loo_likelihood`, but substitute ``f(y|x)=f(x,y)/f(x)``
      for ``f(x)``.
      """
      yLOO = LeaveOneOut(self.data)
      xLOO = LeaveOneOut(self.exog).__iter__()
      L = 0
      for i, Y_j in enumerate(yLOO):
          X_not_i = next(xLOO)
          f_yx = gpke(
              bw,
              data=-Y_j,
              data_predict=-self.data[i, :],
              var_type=(self.dep_type + self.indep_type),
          )
          f_x = gpke(
              bw[self.k_dep :],
              data=-X_not_i,
              data_predict=-self.exog[i, :],
              var_type=self.indep_type,
          )
          f_i = f_yx / f_x
          L += func(f_i)
  
      return -L
  
imports: import numpy
  from .None import kernels
  from ._kernel_base import GenericKDE, EstimatorSettings, gpke, LeaveOneOut, _adjust_shape
label_desc: Use image node_id 3 for calling the KDEMultivariateConditional obj's underlying member method code with example usage: obj.loo_likelihood(bw, func) and returns: unknown