예제 #1
0
파일: MLogitBase.cpp 프로젝트: Hkey1/boom
 //------------------------------------------------------------
 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;
 }
예제 #2
0
파일: MLogitBase.cpp 프로젝트: Hkey1/boom
 Vec & MLB::predict(Ptr<ChoiceData> dp, Vec &ans)const{
   fill_eta(*dp, ans);
   ans = exp(ans-lse(ans));
   return ans;
 }
예제 #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);
 }