From: Steinar H. Gunderson Date: Sun, 18 Mar 2012 21:20:37 +0000 (+0100) Subject: Fix update_prior_sigma(); it should not have anything to do with the matches. X-Git-Url: https://git.sesse.net/?p=wloh;a=commitdiff_plain;h=2a36ea11f407c56da2323d4b235b60dfcafc7110 Fix update_prior_sigma(); it should not have anything to do with the matches. --- diff --git a/bayeswf.cpp b/bayeswf.cpp index f2047bb..62fc9c8 100644 --- a/bayeswf.cpp +++ b/bayeswf.cpp @@ -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);