From 2a36ea11f407c56da2323d4b235b60dfcafc7110 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 18 Mar 2012 22:20:37 +0100 Subject: [PATCH] Fix update_prior_sigma(); it should not have anything to do with the matches. --- bayeswf.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) 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); -- 2.39.2