mathdistops.qnorm

Module Contents

Functions

qnorm(p[, mean, std_dev, graph])

Quantile (Inverse Cumulative Distribution Function) of the normal distribution.

mathdistops.qnorm.qnorm(p, mean=0, std_dev=1, graph=True)[source]

Quantile (Inverse Cumulative Distribution Function) of the normal distribution.

Parameters:
  • p (float) – The probability for which to find the quantile.

  • mean (float, optional) – The mean (average) of the normal distribution. Default is 0.

  • std_dev (float, optional) – The standard deviation of the normal distribution. Default is 1.

  • graph (bool, optional) – Whether to plot the PDF and CDF graphs. Default is True.

Returns:

result

If graph is True (default), returns a tuple consisting a pandas DataFrame and a

layered altair Chart consisting of two graphs, CDF and PDF.

If graph is False, returns a pandas DataFrame.

Return type:

pandas.DataFrame or tuple

Raises:
  • TypeError: – If any of the input parameters (‘p’, ‘mean’, ‘std_dev’) are not numerical.

  • ValueError: – If ‘p’ is not within the range [0, 1]. If ‘std_dev’ is zero or negative, as standard deviation must be positive.

Example

>>> qnorm(0.8413447460685429, mean=0, std_dev=1, graph=False)
    Quantile
0   1.0