def get_sampler(self, xs): kv = {l: p for l, p in zip(self.Labels, self.expectation(xs))} return parse_distribution('cat(kv)', {'kv': kv})
def get_sampler(self, xs): return parse_distribution('pois(lam)', {'lam': self.expectation(xs)})
def get_distribution(self, pas=None): loc = {pa: pas[pa] for pa in self.Parents} try: return parse_distribution(self.Func, loc=loc) except KeyError: return find_data_sampler(self.Func.Function, loc=loc)
def get_sampler(self, xs): return parse_distribution('binom(1, p)', {'p': self.expectation(xs)})
def get_sampler(self, xs): return parse_distribution('norm(mu, err)', { 'mu': self.expectation(xs), 'err': self.Error })