def distribution_of(model): """Returns a normalised factor representing the joint instantiation of the model. """ dist = Factor(data=[1], domain=model) for f in model.factors(): dist *= f dist.broadcast(frozenset(model.variables())) dist /= dist.z() return dist
def distribution_of(model): """Returns a normalised factor representing the joint instantiation of the model. """ dist = Factor(data=[1],domain=model) for f in model.factors(): dist *= f dist.broadcast(frozenset(model.variables())) dist /= dist.z() return dist