/*
* Compute Hessian matrix of the negative log-likelihood, ie. for each term in logL:
*
- * M_ij = D_i D_j (- logL) = -1 / sigma² for i != j
- * 1 / sigma² for i == j
+ * M_ij = D_i D_j (- logL) = -w / sigma² for i != j
+ * w / sigma² for i == j
*
* Note that this does not depend on mu or the margin at all.
*/
double sigma2 = sigma[j];
double sigma_sq = sigma1 * sigma1 + sigma2 * sigma2;
- hessian[i][j] -= 1.0f / sigma_sq;
- hessian[i][i] += 1.0f / sigma_sq;
+ float w = matches_for_player[i][k].weight;
+
+ hessian[i][j] -= w / sigma_sq;
+ hessian[i][i] += w / sigma_sq;
}
}