Exemplo n.º 1
0
 //------------------------------------------------------------
 double MLB::logp(const ChoiceData & dp)const{
   // for right now...  assumes all choices are available to everyone
   //    uint n = dp->n_avail();
   wsp.resize(nch_);
   fill_eta(dp, wsp);
   uint y = dp.value();
   double ans = wsp[y] - lse(wsp);
   return ans;
 }
Exemplo n.º 2
0
 Vec & MLB::predict(Ptr<ChoiceData> dp, Vec &ans)const{
   fill_eta(*dp, ans);
   ans = exp(ans-lse(ans));
   return ans;
 }
Exemplo n.º 3
0
 double PCR::response_prob(uint r, const Vector & Theta, bool logsc)const{
   fill_eta(Theta);
   double lognc = lse(eta_);
   double ans = eta_[r] - lognc;
   return logsc ? ans : exp(ans);
 }