:py:mod:`mathdistops.pexp` ========================== .. py:module:: mathdistops.pexp Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: mathdistops.pexp.pexp .. py:function:: pexp(q, rate=1, graph=True) Calculates the cumulative probability of the exponential distribution at this quantile and plots corresponding PDF and CDF. This function computes the cumulative probability at a specified quantile `q` for an exponential distribution with a given rate parameter `lambda`. Optionally, it can generate and return a visualization corresponding PDF and CDF. :param q: The quantile at which to evaluate the CDF. :type q: float :param rate: The rate parameter (lambda) of the exponential distribution. Default is 1. :type rate: float :param graph: Whether to plot the PDF and CDF graph. Default is True. :type graph: bool :returns: **result** -- If `graph` is True (default), returns a tuple consisting of a pandas DataFrame and a layered altair Chart consisting of two graphs, CDF and PDF. If `graph` is False, returns a pandas DataFrame. :rtype: pandas.DataFrame or tuple :raises ValueError:: If 'q' is None, indicating that the quantile parameter is missing. If 'rate' is zero or negative, indicating an invalid rate parameter. :raises TypeError:: If either 'q' or 'rate' is not a numerical value. .. rubric:: Examples >>> pexp(0.5, rate=1, graph=False) Quantile Cumulative probability 0 0.5 0.393469