:py:mod:`mathdistops.qexp` ========================== .. py:module:: mathdistops.qexp Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: mathdistops.qexp.qexp .. py:function:: qexp(p, rate=1, graph=True) Calculates the quantile corresponding to given cumulative probability in an exponential distribution and plots the corresponding distribution. This function computes the quantile corresponding to a specified cumulative probability `p` for an exponential distribution characterized by a given rate parameter `lambda`. Optionally, it can also generate and return a visualization of the distribution. :param p: The cumulative probability for which to find the quantile. Must be between 0 and 1, inclusive of 1. :type p: float, optional :param rate: The rate parameter (`lambda`) of the exponential distribution. Must be a positive number. Default is 1 :type rate: float :param graph: If True, generates and returns a plot of the exponential distribution with the quantile highlighted for the given cumulative probability. Default is True. :type graph: bool, optional :returns: **result** -- If `graph` is True (default), returns a tuple consisting of a pandas DataFrame giving you the cumulative probability and the quantile as well as 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 the cumulative probability 'p' is not between 0 and 1, exclusive of 1. If the rate parameter 'rate' is not a positive number. .. rubric:: Examples >>> qexp(0.5, rate=1, graph=False) Probability Quantile 0 0.5 0.6931471805599453