]> git.sesse.net Git - wloh/commitdiff
Fix update_prior_sigma(); it should not have anything to do with the matches.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 18 Mar 2012 21:20:37 +0000 (22:20 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 18 Mar 2012 21:20:37 +0000 (22:20 +0100)
bayeswf.cpp

index f2047bbf69549d510522bb316b33cf9788db3b5b..62fc9c8b2895b42c7df81ea2dd31cf1936e7c2ea 100644 (file)
@@ -196,20 +196,10 @@ void update_prior_sigma(float *mu, float *sigma, int num_players)
 {
        float nom = 0.0f, denom = 0.0f;
        for (int i = 0; i < num_players; ++i) {
-               for (unsigned j = 0; j < matches_for_player[i].size(); ++j) {
-                       const match& m = matches_for_player[i][j];
+               float mu1 = mu[i];
 
-                       // Only count each match once.
-                       if (m.other_player <= i) {
-                               continue;
-                       }
-
-                       float mu1 = mu[i];
-
-                       float w = m.weight;
-                       nom += w * ((mu1 - PRIOR_MU) * (mu1 - PRIOR_MU));
-                       denom += w * 1.0f;
-               }
+               nom += ((mu1 - PRIOR_MU) * (mu1 - PRIOR_MU));
+               denom += 1.0f;
        }
 
        prior_sigma = sqrt(nom / denom);