X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bayeswf.cpp;fp=bayeswf.cpp;h=62fc9c8b2895b42c7df81ea2dd31cf1936e7c2ea;hb=2a36ea11f407c56da2323d4b235b60dfcafc7110;hp=f2047bbf69549d510522bb316b33cf9788db3b5b;hpb=f9e3c647cd9594de83d46f5bf7be5c9b7cf9dc9b;p=wloh 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);