Ejemplo n.º 1
0
 @Override
 public void map(Chunk response, Chunk weight, Chunk offset) {
   for (int i = 0; i < response._len; ++i) {
     if (response.isNA(i)) continue;
     double w = weight.atd(i);
     if (w == 0) continue;
     double y = response.atd(i);
     double o = offset.atd(i);
     _num += _dist.initFNum(w, o, y);
     _denom += _dist.initFDenom(w, o);
   }
 }
Ejemplo n.º 2
0
 public double initialValue() {
   if (_dist.distribution == Distribution.Family.multinomial)
     return -0.5 * new Distribution(Distribution.Family.bernoulli).link(_num / _denom);
   else return _dist.link(_num / _denom);
 }