Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _mom(self, x, dist, cache):
return approximation.approximate_moment(self, x)
def _mom(self, x, dist, cache):
return approximation.approximate_moment(self, x)
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
def _mom(self, x, dist, cache):
return approximation.approximate_moment(self, x)
def _mom(self, x, dist, cache):
return approximation.approximate_moment(self, x)
def _mom(self, x, dist, cache):
return approximation.approximate_moment(self, x)
def _mom(self, x, dist, cache):
return approximation.approximate_moment(self, x)