Пример #1
0
 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})
Пример #2
0
 def get_sampler(self, xs):
     return parse_distribution('pois(lam)', {'lam': self.expectation(xs)})
Пример #3
0
 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)
Пример #4
0
 def get_sampler(self, xs):
     return parse_distribution('binom(1, p)', {'p': self.expectation(xs)})
Пример #5
0
 def get_sampler(self, xs):
     return parse_distribution('norm(mu, err)', {
         'mu': self.expectation(xs),
         'err': self.Error
     })