if (hidden.contains(var)) {
factors = sumOut(var, factors, bn);
}
}
// return NORMALIZE(POINTWISE-PRODUCT(factors))
Factor product = pointwiseProduct(factors);
// Note: Want to ensure the order of the product matches the
// query variables
return ((ProbabilityTable) product.pointwiseProductPOS(_identity, X))
.normalize();
}