How to use the chaospy.distributions.approximation.approximate_moment 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 / arccosh.py View on Github external
def _mom(self, x, dist, cache):
        return approximation.approximate_moment(self, x)
github jonathf / chaospy / chaospy / distributions / operators / arctan.py View on Github external
def _mom(self, x, dist, cache):
        return approximation.approximate_moment(self, x)
github jonathf / chaospy / chaospy / distributions / evaluation / moment.py View on Github external
if cache_key(distribution) in cache:
            return cache[cache_key(distribution)]

    from .. import baseclass
    try:
        parameters = load_parameters(
            distribution, "_mom", parameters, cache, cache_key)
        out = distribution._mom(k_data, **parameters)

    except baseclass.StochasticallyDependentError:

        logger.info(
            "Distribution %s has stochastic dependencies; "
            "Approximating moments with quadrature.", distribution)
        from .. import approximation
        out = approximation.approximate_moment(distribution, k_data)

    if isinstance(out, numpy.ndarray):
        out = out.item()

    cache[cache_key(distribution)] = out

    return out
github jonathf / chaospy / chaospy / distributions / operators / cosh.py View on Github external
def _mom(self, x, dist, cache):
        return approximation.approximate_moment(self, x)
github jonathf / chaospy / chaospy / distributions / operators / arcsin.py View on Github external
def _mom(self, x, dist, cache):
        return approximation.approximate_moment(self, x)
github jonathf / chaospy / chaospy / distributions / operators / tan.py View on Github external
def _mom(self, x, dist, cache):
        return approximation.approximate_moment(self, x)
github jonathf / chaospy / chaospy / distributions / operators / arccos.py View on Github external
def _mom(self, x, dist, cache):
        return approximation.approximate_moment(self, x)