Repository: scipy/scipy
File: scipy/stats/_continuous_distns.py (Python)

Code before:
    .. math::

        f(x, b, c) = \frac{b}{1 - c^{-b}} \frac{1}{x^{b+1}}

    for :math:`b \neq 0`, :math:`c > 1` and :math:`1 \le x \le c`.

    `truncpareto` takes `b` and `c` as shape parameters for :math:`b` and
    :math:`c`.

    Notice that the upper truncation value :math:`c` is defined in
    standardized form so that random values of an unscaled, unshifted variable
    are within the range ``[1, c]``.
    If ``u_r`` is the upper bound to a scaled and/or shifted variable,
    then ``c = (u_r - loc) / scale``. In other words, the support of the
    distribution becomes ``(scale + loc) <= x <= (c*scale + loc)`` when
    `scale` and/or `loc` are provided.

    The ``fit`` method assumes that :math:`b` is positive; it does not produce
    good results when the data is more consistent with negative :math:`b`.

   `truncpareto` can also be used to model a general power law distribution
    with PDF:

    .. math::

        f(x, a, l, h) = \frac{a}{h^a - l^a} x^{a-1}

    for :math:`a \neq 0` and :math:`0 < l < x < h`. Suppose :math:`a`,
    :math:`l`, and :math:`h` are represented in code as ``a``, ``l``, and
    ``h``, respectively. In this case, use `truncpareto` with parameters
    ``b = -a``, ``c = h / l``, ``scale = l``, and ``loc = 0``.

    %(after_notes)s

    References
    ----------
    .. [1] Burroughs, S. M., and Tebbens S. F.
        "Upper-truncated power laws in natural systems."
        Pure and Applied Geophysics 158.4 (2001): 741-757.

    %(example)s

    """

    def _shape_info(self):
        ib = _ShapeInfo("b", False, (-np.inf, np.inf), (False, False))
        ic = _ShapeInfo("c", False, (1.0, np.inf), (False, False))
        return [ib, ic]

    def _argcheck(self, b, c):
        return (b != 0.) & (c > 1.)

Review comment (suggestion):
```suggestion
        f(x; a, l, h) = \frac{a}{h^a - l^a} x^{a-1}
```

Code after:
    --------
    pareto : Pareto distribution

    Notes
    -----
    The probability density function for `truncpareto` is:

    .. math::

        f(x, b, c) = \frac{b}{1 - c^{-b}} \frac{1}{x^{b+1}}

    for :math:`b \neq 0`, :math:`c > 1` and :math:`1 \le x \le c`.

    `truncpareto` takes `b` and `c` as shape parameters for :math:`b` and
    :math:`c`.

    Notice that the upper truncation value :math:`c` is defined in
    standardized form so that random values of an unscaled, unshifted variable
    are within the range ``[1, c]``.
    If ``u_r`` is the upper bound to a scaled and/or shifted variable,
    then ``c = (u_r - loc) / scale``. In other words, the support of the
    distribution becomes ``(scale + loc) <= x <= (c*scale + loc)`` when
    `scale` and/or `loc` are provided.

    The ``fit`` method assumes that :math:`b` is positive; it does not produce
    good results when the data is more consistent with negative :math:`b`.

    `truncpareto` can also be used to model a general power law distribution
    with PDF:

    .. math::

        f(x; a, l, h) = \frac{a}{h^a - l^a} x^{a-1}

    for :math:`a \neq 0` and :math:`0 < l < x < h`. Suppose :math:`a`,
    :math:`l`, and :math:`h` are represented in code as ``a``, ``l``, and
    ``h``, respectively. In this case, use `truncpareto` with parameters
    ``b = -a``, ``c = h / l``, ``scale = l``, and ``loc = 0``.

    %(after_notes)s

    References
    ----------
    .. [1] Burroughs, S. M., and Tebbens S. F.
        "Upper-truncated power laws in natural systems."
        Pure and Applied Geophysics 158.4 (2001): 741-757.

    %(example)s

    """