>>> print(dist.pdf([[0.5, 0.6, 1.5], [0.5, 0.6, 1.5]]))
[0.5 0.5 0. ]
if isinstance(left, Dist) and left in cache:
left = cache[left]
if isinstance(right, Dist) and right in cache:
right = cache[right]
if isinstance(left, Dist):
if isinstance(right, Dist):
raise evaluation.DependencyError(
"under-defined distribution {} or {}".format(left, right))
elif not isinstance(right, Dist):
return numpy.inf
else:
if self.matrix:
Ci = numpy.linalg.inv(left)
xloc = numpy.dot(Ci, xloc)
else:
left = (numpy.asfarray(left).T+numpy.zeros(xloc.shape).T).T
valids = left != 0
xloc.T[valids.T] = xloc.T[valids.T]/left.T[valids.T]
pdf = evaluation.evaluate_density(right, xloc, cache)
if self.matrix:
After Change
>>> print(dist.pdf([[0.5, 0.6, 1.5], [0.5, 0.6, 1.5]]))
[0.5 0.5 0. ]
left = evaluation.get_forward_cache(left, cache)right = evaluation.get_forward_cache(right, cache)
if isinstance(left, Dist):
if isinstance(right, Dist):
raise evaluation.DependencyError(
"under-defined distribution {} or {}".format(left, right))
elif not isinstance(right, Dist):
return numpy.inf
else:
if self.matrix:
Ci = numpy.linalg.inv(left)
xloc = numpy.dot(Ci, xloc)
else:
left = (numpy.asfarray(left).T+numpy.zeros(xloc.shape).T).T
valids = left != 0
xloc.T[valids.T] = xloc.T[valids.T]/left.T[valids.T]
pdf = evaluation.evaluate_density(right, xloc, cache)
if self.matrix: