class_docstr: Class for fitting the Aalen-Johansen estimate for the cumulative incidence function in a competing risks framework.
  Treating competing risks as censoring can result in over-estimated cumulative density functions. Using the Kaplan
  Meier estimator with competing risks as censored is akin to estimating the cumulative density if all competing risks
  had been prevented.
  
  Aalen-Johansen cannot deal with tied times. We can get around this by randomly jittering the event times
  slightly. This will be done automatically and generates a warning.
  
  
  Parameters
  ----------
  alpha: float, option (default=0.05)
      The alpha value associated with the confidence intervals.
  
  jitter_level: float, option (default=0.00001)
      If tied event times are detected, event times are randomly changed by this factor.
  
  seed: int, option (default=None)
      To produce replicate results with tied event times, the numpy.random.seed can be specified in the function.
  
  calculate_variance: bool, option (default=True)
      By default, AalenJohansenFitter calculates the variance and corresponding confidence intervals. Due to how the
      variance is calculated, the variance must be calculated for each event time individually. This is
      computationally intensive. For some procedures, like bootstrapping, the variance is not necessary. To reduce
      computation time during these procedures, `calculate_variance` can be set to `False` to skip the variance
      calculation.
  
  Example
  -------
  
  .. code:: python
  
      from lifelines import AalenJohansenFitter
      from lifelines.datasets import load_waltons
      T, E = load_waltons()['T'], load_waltons()['E']
      ajf = AalenJohansenFitter(calculate_variance=True)
      ajf.fit(T, E, event_of_interest=1)
      ajf.cumulative_density_
      ajf.plot()
  
  
  References
  ----------
  If you are interested in learning more, we recommend the following open-access
  paper; Edwards JK, Hester LL, Gokhale M, Lesko CR. Methodologic Issues When Estimating Risks in
  Pharmacoepidemiology. Curr Epidemiol Rep. 2016;3(4):285-296.
docstr: Plots a pretty figure of the model
  
  Matplotlib plot arguments can be passed in inside the kwargs.
  
  Parameters
  -----------
  show_censors: bool
      place markers at censorship events. Default: False
  censor_styles: dict
      If show_censors, this dictionary will be passed into the plot call.
  ci_alpha: float
      the transparency level of the confidence interval. Default: 0.3
  ci_force_lines: bool
      force the confidence intervals to be line plots (versus default shaded areas). Default: False
  ci_show: bool
      show confidence intervals. Default: True
  ci_legend: bool
      if ci_force_lines is True, this is a boolean flag to add the lines' labels to the legend. Default: False
  at_risk_counts: bool
      show group sizes at time points. See function ``add_at_risk_counts`` for details. Default: False
  loc: slice
      specify a time-based subsection of the curves to plot, ex:
  
      >>> model.plot(loc=slice(0.,10.))
  
      will plot the time values between t=0. and t=10.
  iloc: slice
      specify a location-based subsection of the curves to plot, ex:
  
      >>> model.plot(iloc=slice(0,10))
  
      will plot the first 10 time points.
  
  Returns
  -------
  ax:
      a pyplot axis object
docstr_tok: ["Plots","a","pretty","figure","of","the","model","Matplotlib","plot","arguments","can","be","passed","in","inside","the","kwargs",".","Parameters","--","--","--","--","--","-","show_censors",":","bool","place","markers","at","censorship","events",".","Default",":","False","censor_styles",":","dict","If","show_censors",",","this","dictionary","will","be","passed","into","the","plot","call",".","ci_alpha",":","float","the","transparency","level","of","the","confidence","interval",".","Default",":","0.3","ci_force_lines",":","bool","force","the","confidence","intervals","to","be","line","plots","(","versus","default","shaded","areas",")",".","Default",":","False","ci_show",":","bool","show","confidence","intervals",".","Default",":","True","ci_legend",":","bool","if","ci_force_lines","is","True",",","this","is","a","boolean","flag","to","add","the","lines","'","labels","to","the","legend",".","Default",":","False","at_risk_counts",":","bool","show","group","sizes","at","time","points",".","See","function","``","add_at_risk_counts","``","for","details",".","Default",":","False","loc",":","slice","specify","a","time-based","subsection","of","the","curves","to","plot",",","ex",":",">",">",">","model.plot","(","loc=slice","(","0.,10",".",")",")","will","plot","the","time","values","between","t=0",".","and","t=10",".","iloc",":","slice","specify","a","location-based","subsection","of","the","curves","to","plot",",","ex",":",">",">",">","model.plot","(","iloc=slice","(","0,10",")",")","will","plot","the","first","10","time","points",".","Returns","--","--","--","-","ax",":","a","pyplot","axis","object"]
code: def plot_cumulative_density(self, **kwargs):
      """Plots a pretty figure of the model
  
      Matplotlib plot arguments can be passed in inside the kwargs.
  
      Parameters
      -----------
      show_censors: bool
          place markers at censorship events. Default: False
      censor_styles: dict
          If show_censors, this dictionary will be passed into the plot call.
      ci_alpha: float
          the transparency level of the confidence interval. Default: 0.3
      ci_force_lines: bool
          force the confidence intervals to be line plots (versus default shaded areas). Default: False
      ci_show: bool
          show confidence intervals. Default: True
      ci_legend: bool
          if ci_force_lines is True, this is a boolean flag to add the lines' labels to the legend. Default: False
      at_risk_counts: bool
          show group sizes at time points. See function ``add_at_risk_counts`` for details. Default: False
      loc: slice
          specify a time-based subsection of the curves to plot, ex:
  
          >>> model.plot(loc=slice(0.,10.))
  
          will plot the time values between t=0. and t=10.
      iloc: slice
          specify a location-based subsection of the curves to plot, ex:
  
          >>> model.plot(iloc=slice(0,10))
  
          will plot the first 10 time points.
  
      Returns
      -------
      ax:
          a pyplot axis object
      """
      if not self._calc_var:
          kwargs["ci_show"] = False
      _plot_estimate(self, estimate=self._estimate_name, **kwargs)
  
file_path: lifelines/lifelines/fitters/aalen_johansen_fitter.py
imports: from textwrap import dedent
  import numpy
  import pandas
  import warnings
  from lifelines.fitters import NonParametricUnivariateFitter
  from lifelines.utils import _preprocess_inputs, inv_normal_cdf, CensoringType, coalesce
  from lifelines import KaplanMeierFitter
  from lifelines.plotting import _plot_estimate
label_desc: Use image node_id 6 for calling the AalenJohansenFitter obj's underlying member method code with example usage: obj.plot_cumulative_density() without return types