How to use the chaospy.distributions.evaluation.evaluate_inverse function in chaospy

To help you get started, we’ve selected a few chaospy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jonathf / chaospy / chaospy / distributions / operators / arctan.py View on Github external
def _ppf(self, q, dist, cache):
        return numpy.arctan(evaluation.evaluate_inverse(dist, q, cache=cache))
github jonathf / chaospy / chaospy / distributions / copulas / baseclass.py View on Github external
def _ppf(self, qloc, dist, trans, cache):
        qloc = evaluation.evaluate_inverse(trans, qloc, cache=cache)
        xloc = evaluation.evaluate_inverse(dist, qloc, cache=cache)
        return xloc
github jonathf / chaospy / chaospy / distributions / baseclass.py View on Github external
If approximation is used, this sets the maximum number of
                allowed iterations in the Newton-Raphson algorithm.
            tollerance (float):
                If approximation is used, this set the error tolerance level
                required to define a sample as converged.

        Returns:
            (numpy.ndarray):
                Inverted probability values where
                ``out.shape == q_data.shape``.
        """
        q_data = numpy.asfarray(q_data)
        assert numpy.all((q_data >= 0) & (q_data <= 1)), "sanitize your inputs!"
        shape = q_data.shape
        q_data = q_data.reshape(len(self), -1)
        x_data = evaluation.evaluate_inverse(self, q_data)
        x_data = numpy.clip(x_data.T, self.lower, self.upper).T
        x_data = x_data.reshape(shape)
        return x_data
github jonathf / chaospy / chaospy / distributions / operators / multiply.py View on Github external
if isinstance(left, Dist):
            if isinstance(right, Dist):
                raise evaluation.DependencyError(
                    "under-defined distribution {} or {}".format(left, right))

            uloc = numpy.where(numpy.asfarray(right).T > 0, uloc.T, 1-uloc.T).T
            xloc = evaluation.evaluate_inverse(left, uloc, cache=cache)
            xloc = (xloc.T*right.T).T
            assert uloc.shape == xloc.shape

        elif not isinstance(right, Dist):
            xloc = left*right

        else:
            uloc = numpy.where(numpy.asfarray(left).T > 0, uloc.T, 1-uloc.T).T
            xloc = evaluation.evaluate_inverse(right, uloc, cache=cache)
            xloc = (xloc.T*left.T).T

        return xloc
github jonathf / chaospy / chaospy / distributions / operators / tan.py View on Github external
def _ppf(self, q, dist, cache):
        return numpy.tan(evaluation.evaluate_inverse(
            dist, q, cache=cache))
github jonathf / chaospy / chaospy / distributions / operators / cos.py View on Github external
def _ppf(self, q, dist, cache):
        return numpy.cos(evaluation.evaluate_inverse(dist, 1-q, cache=cache))
github jonathf / chaospy / chaospy / distributions / operators / arccos.py View on Github external
def _ppf(self, q, dist, cache):
        return numpy.arccos(evaluation.evaluate_inverse(dist, 1-q, cache=cache))
github jonathf / chaospy / chaospy / distributions / operators / power.py View on Github external
if isinstance(left, Dist):
            if isinstance(right, Dist):
                raise StochasticallyDependentError(
                    "under-defined distribution {} or {}".format(left, right))
        elif not isinstance(right, Dist):
            return left**right

        else:
            out = evaluation.evaluate_inverse(right, q, cache=cache)
            out = numpy.where(left < 0, 1-out, out)
            out = left**out
            return out

        right = right + numpy.zeros(q.shape)
        q = numpy.where(right < 0, 1-q, q)
        out = evaluation.evaluate_inverse(left, q, cache=cache)**right
        return out
github jonathf / chaospy / chaospy / distributions / operators / logarithm10.py View on Github external
def _ppf(self, q, dist, cache):
        """Point percentile function."""
        return numpy.log10(evaluation.evaluate_inverse(dist, q, cache=cache))