{
memset(hessian, 0, sizeof(hessian));
+ for (int i = 0; i < num_players; ++i) {
+ hessian[i][i] += 1.0f / (prior_sigma * prior_sigma);
+ }
for (unsigned i = 0; i < all_matches.size(); ++i) {
const match &m = all_matches[i];
{
memset(mu_stddev, 0, sizeof(mu_stddev));
+ // Temporarily use mu_stddev to store the diagonal of the Hessian.
+
+ // Prior.
+ for (int i = 0; i < num_players; ++i) {
+ mu_stddev[i] += 1.0f / (prior_sigma * prior_sigma);
+ }
+
+ // Matches.
for (unsigned i = 0; i < all_matches.size(); ++i) {
const match &m = all_matches[i];
double sigma_sq = global_sigma * global_sigma;
float w = m.weight;
- // Temporarily use mu_stddev to store the diagonal of the Hessian.
mu_stddev[p1] += w / sigma_sq;
mu_stddev[p2] += w / sigma_sq;
}
+
+ // Now convert to standard deviation.
for (int i = 0; i < num_players; ++i) {
mu_stddev[i] = 1.0f / sqrt(mu_stddev[i]);
}