class_docstr: Cox Proportional Hazards Regression Model
  
  The Cox PH Model is for right censored data.
  
  Parameters
  ----------
  endog : array_like
      The observed times (event or censoring)
  exog : 2D array_like
      The covariates or exogeneous variables
  status : array_like
      The censoring status values; status=1 indicates that an
      event occurred (e.g. failure or death), status=0 indicates
      that the observation was right censored. If None, defaults
      to status=1 for all cases.
  entry : array_like
      The entry times, if left truncation occurs
  strata : array_like
      Stratum labels.  If None, all observations are taken to be
      in a single stratum.
  ties : str
      The method used to handle tied times, must be either 'breslow'
      or 'efron'.
  offset : array_like
      Array of offset values
  missing : str
      The method used to handle missing data
  
  Notes
  -----
  Proportional hazards regression models should not include an
  explicit or implicit intercept.  The effect of an intercept is
  not identified using the partial likelihood approach.
  
  `endog`, `event`, `strata`, `entry`, and the first dimension
  of `exog` all must have the same length
class_docstr_tok: ["Cox","Proportional","Hazards","Regression","Model","The","Cox","PH","Model","is","for","right","censored","data",".","Parameters","--","--","--","--","--","endog",":","array_like","The","observed","times","(","event","or","censoring",")","exog",":","2D","array_like","The","covariates","or","exogeneous","variables","status",":","array_like","The","censoring","status","values",";","status=1","indicates","that","an","event","occurred","(","e.g",".","failure","or","death",")",",","status=0","indicates","that","the","observation","was","right","censored",".","If","None",",","defaults","to","status=1","for","all","cases",".","entry",":","array_like","The","entry","times",",","if","left","truncation","occurs","strata",":","array_like","Stratum","labels",".","If","None",",","all","observations","are","taken","to","be","in","a","single","stratum",".","ties",":","str","The","method","used","to","handle","tied","times",",","must","be","either","'breslow'","or","'efron","'",".","offset",":","array_like","Array","of","offset","values","missing",":","str","The","method","used","to","handle","missing","data","Notes","--","--","-","Proportional","hazards","regression","models","should","not","include","an","explicit","or","implicit","intercept",".","The","effect","of","an","intercept","is","not","identified","using","the","partial","likelihood","approach",".","`","endog","`",",","`","event","`",",","`","strata","`",",","`","entry","`",",","and","the","first","dimension","of","`","exog","`","all","must","have","the","same","length"]
docstr: Returns a scipy distribution object corresponding to the
  distribution of uncensored endog (duration) values for each
  case.
  
  Parameters
  ----------
  params : array_like
      The proportional hazards model parameters.
  scale : float
      Present for compatibility, not used.
  exog : array_like
      A design matrix, defaults to model.exog.
  
  Returns
  -------
  A list of objects of type scipy.stats.distributions.rv_discrete
  
  Notes
  -----
  The distributions are obtained from a simple discrete estimate
  of the survivor function that puts all mass on the observed
  failure times within a stratum.
docstr_tok: ["Returns","a","scipy","distribution","object","corresponding","to","the","distribution","of","uncensored","endog","(","duration",")","values","for","each","case",".","Parameters","--","--","--","--","--","params",":","array_like","The","proportional","hazards","model","parameters",".","scale",":","float","Present","for","compatibility",",","not","used",".","exog",":","array_like","A","design","matrix",",","defaults","to","model.exog",".","Returns","--","--","--","-","A","list","of","objects","of","type","scipy.stats.distributions.rv_discrete","Notes","--","--","-","The","distributions","are","obtained","from","a","simple","discrete","estimate","of","the","survivor","function","that","puts","all","mass","on","the","observed","failure","times","within","a","stratum","."]
code: def get_distribution(self, params, scale=1.0, exog=None):
      """
      Returns a scipy distribution object corresponding to the
      distribution of uncensored endog (duration) values for each
      case.
  
      Parameters
      ----------
      params : array_like
          The proportional hazards model parameters.
      scale : float
          Present for compatibility, not used.
      exog : array_like
          A design matrix, defaults to model.exog.
  
      Returns
      -------
      A list of objects of type scipy.stats.distributions.rv_discrete
  
      Notes
      -----
      The distributions are obtained from a simple discrete estimate
      of the survivor function that puts all mass on the observed
      failure times within a stratum.
      """
  
      surv = self.surv
      bhaz = self.baseline_cumulative_hazard(params)
  
      # The arguments to rv_discrete_float, first obtained by
      # stratum
      pk, xk = [], []
  
      if exog is None:
          exog_split = surv.exog_s
      else:
          exog_split = self.surv._split(exog)
  
      for stx in range(self.surv.nstrat):
          exog_s = exog_split[stx]
  
          linpred = np.dot(exog_s, params)
          if surv.offset_s is not None:
              linpred += surv.offset_s[stx]
          e_linpred = np.exp(linpred)
  
          # The unique failure times for this stratum (the support
          # of the distribution).
          pts = bhaz[stx][0]
  
          # The individual cumulative hazards for everyone in this
          # stratum.
          ichaz = np.outer(e_linpred, bhaz[stx][1])
  
          # The individual survival functions.
          usurv = np.exp(-ichaz)
          z = np.zeros((usurv.shape[0], 1))
          usurv = np.concatenate((usurv, z), axis=1)
  
          # The individual survival probability masses.
          probs = -np.diff(usurv, 1)
  
          pk.append(probs)
          xk.append(np.outer(np.ones(probs.shape[0]), pts))
  
      # Pad to make all strata have the same shape
      mxc = max([x.shape[1] for x in xk])
      for k in range(self.surv.nstrat):
          if xk[k].shape[1] < mxc:
              xk1 = np.zeros((xk[k].shape[0], mxc))
              pk1 = np.zeros((pk[k].shape[0], mxc))
              xk1[:, 0 : xk[k].shape[1]] = xk[k]
              pk1[:, 0 : pk[k].shape[1]] = pk[k]
              xk[k], pk[k] = xk1, pk1
  
      # Put the support points and probabilities into single matrices
      xka = np.nan * np.ones((len(self.endog), mxc))
      pka = np.ones((len(self.endog), mxc), dtype=np.float64) / mxc
      for stx in range(self.surv.nstrat):
          ix = self.surv.stratum_rows[stx]
          xka[ix, :] = xk[stx]
          pka[ix, :] = pk[stx]
  
      dist = rv_discrete_float(xka, pka)
  
      return dist
  
imports: import numpy
  from statsmodels.base import model
  import statsmodels.base.model
  from statsmodels.tools.decorators import cache_readonly
  from statsmodels.compat.pandas import Appender
label_desc: Use image node_id 20 for calling the PHReg obj's underlying member method code with example usage: obj.get_distribution(params, scale, exog) and returns: dist