PARETO

Overview

The PARETO function evaluates the Pareto continuous distribution, a classic heavy-tail model used to represent extreme-value behavior such as large losses, high incomes, or outsized demand events. It can return density, cumulative probability, tail probability, inverse quantiles, and summary moments through a single interface. This makes it useful when analysts need both forward probability calculations and threshold estimation from probabilities.

In standardized form, the Pareto distribution with shape parameter b>0 has support x \ge 1 and density

f(x;b)=\frac{b}{x^{b+1}}.

Its cumulative distribution is

F(x;b)=1-x^{-b}, \quad x\ge 1,

and with location and scale, y=(x-\mathrm{loc})/\mathrm{scale} so probabilities are computed on the transformed variable y. Here, b controls tail heaviness, loc shifts the distribution, and scale stretches it.

This implementation wraps scipy.stats.pareto from SciPy. Key parameters are the shape b (must be positive), loc (default 0), and scale (must be positive, default 1), with method selection such as pdf, cdf, sf, icdf (ppf), isf, mean, var, and std.

Pareto modeling is common in risk management, reliability, operations, and economics when rare but high-impact outcomes matter more than average-case behavior. Teams use it to estimate exceedance probabilities, set service thresholds, and stress-test policies against tail risk. It is also widely used in actuarial and finance workflows where understanding the right tail is critical.

This example function is provided as-is without any representation of accuracy.

Excel Usage

=PARETO(value, b, loc, scale, pareto_method)
  • value (float, optional, default: null): Input value for the distribution method. For pdf, cdf, sf, the x value. For icdf, isf, the probability (0-1). Not required for mean, median, var, std.
  • b (float, optional, default: 1): Shape parameter of the Pareto distribution. Must be greater than 0.
  • loc (float, optional, default: 0): Location parameter of the distribution.
  • scale (float, optional, default: 1): Scale parameter of the distribution. Must be greater than 0.
  • pareto_method (str, optional, default: “pdf”): The distribution method to compute.

Returns (float): Distribution result (float), or error message string.

Example 1: PDF at x=2 with shape b=3

Inputs:

value b loc scale pareto_method
2 3 0 1 pdf

Excel formula:

=PARETO(2, 3, 0, 1, "pdf")

Expected output:

0.1875

Example 2: CDF at x=2 with shape b=3

Inputs:

value b loc scale pareto_method
2 3 0 1 cdf

Excel formula:

=PARETO(2, 3, 0, 1, "cdf")

Expected output:

0.875

Example 3: Inverse CDF (quantile) at probability 0.875

Inputs:

value b loc scale pareto_method
0.875 3 0 1 icdf

Excel formula:

=PARETO(0.875, 3, 0, 1, "icdf")

Expected output:

2

Example 4: Mean of Pareto distribution with shape b=3

Inputs:

b loc scale pareto_method
3 0 1 mean

Excel formula:

=PARETO(3, 0, 1, "mean")

Expected output:

1.5

Python Code

Show Code
from scipy.stats import pareto as scipy_pareto
import math

def pareto(value=None, b=1, loc=0, scale=1, pareto_method='pdf'):
    """
    Pareto distribution function supporting multiple methods.

    See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pareto.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        value (float, optional): Input value for the distribution method. For pdf, cdf, sf, the x value. For icdf, isf, the probability (0-1). Not required for mean, median, var, std. Default is None.
        b (float, optional): Shape parameter of the Pareto distribution. Must be greater than 0. Default is 1.
        loc (float, optional): Location parameter of the distribution. Default is 0.
        scale (float, optional): Scale parameter of the distribution. Must be greater than 0. Default is 1.
        pareto_method (str, optional): The distribution method to compute. Valid options: PDF, CDF, ICDF, SF, ISF, Mean, Median, Variance, Std Dev. Default is 'pdf'.

    Returns:
        float: Distribution result (float), or error message string.
    """
    try:
      valid_methods = {'pdf', 'cdf', 'icdf', 'sf', 'isf', 'mean', 'median', 'var', 'std'}

      if not isinstance(pareto_method, str):
        return "Error: pareto_method must be a string."

      method = pareto_method.lower()
      if method not in valid_methods:
        return f"Error: Invalid method: {pareto_method}. Must be one of {', '.join(sorted(valid_methods))}."

      try:
        b = float(b)
        loc = float(loc)
        scale = float(scale)
      except Exception:
        return "Error: b, loc, and scale must be numbers."
      if b <= 0:
        return "Error: b must be > 0."
      if scale <= 0:
        return "Error: scale must be > 0."

      dist = scipy_pareto(b, loc=loc, scale=scale)
      if method in ['pdf', 'cdf', 'icdf', 'sf', 'isf']:
        if value is None:
          return f"Error: missing required argument 'value' for method '{method}'."
        try:
          value = float(value)
        except Exception:
          return "Error: value must be a number."
        if method == 'pdf':
          result = dist.pdf(value)
        elif method == 'cdf':
          result = dist.cdf(value)
        elif method == 'sf':
          result = dist.sf(value)
        elif method == 'isf':
          if not (0 <= value <= 1):
            return "Error: value (probability) must be between 0 and 1 for isf."
          result = dist.isf(value)
        elif method == 'icdf':
          if not (0 <= value <= 1):
            return "Error: value (probability) must be between 0 and 1 for icdf."
          result = dist.ppf(value)
      else:
        if method == 'mean':
          result = dist.mean()
        elif method == 'median':
          result = dist.median()
        elif method == 'var':
          result = dist.var()
        elif method == 'std':
          result = dist.std()

      result = float(result)
      if math.isnan(result):
        return "Error: Result is NaN."
      if math.isinf(result):
        return "Error: Result is infinite."

      return result
    except Exception as e:
      return f"Error: {str(e)}"

Online Calculator

Input value for the distribution method. For pdf, cdf, sf, the x value. For icdf, isf, the probability (0-1). Not required for mean, median, var, std.
Shape parameter of the Pareto distribution. Must be greater than 0.
Location parameter of the distribution.
Scale parameter of the distribution. Must be greater than 0.
The distribution method to compute.