using namespace std;
using namespace Eigen;
-#define PRIOR_MU 1500
+#define PRIOR_MU 500
#define PRIOR_WEIGHT 1.0
#define MAX_PLAYERS 4096
#define DUMP_RAW 0
// Compute uncertainty (stddev) of mu estimates, which is sqrt((H^-1)_ii),
// where H is the Hessian (see construct_hessian()).
-void compute_mu_uncertainty(const float *mu, int num_players)
+void compute_mu_uncertainty(const float *mu, const vector<string> &players)
{
// FIXME: Use pseudoinverse if applicable.
Matrix<float, Dynamic, Dynamic> ih = hessian.inverse();
- for (int i = 0; i < num_players; ++i) {
+ for (unsigned i = 0; i < players.size(); ++i) {
mu_stddev[i] = sqrt(ih(i, i));
}
+
+ for (unsigned i = 0; i < players.size(); ++i) {
+ for (unsigned j = 0; j < players.size(); ++j) {
+ printf("covariance %s %s %f\n",
+ players[i].c_str(),
+ players[j].c_str(),
+ ih(i, j));
+ }
+ }
}
int main(int argc, char **argv)
dump_raw(mu, num_players);
#else
construct_hessian(mu, num_players);
- compute_mu_uncertainty(mu, num_players);
+ compute_mu_uncertainty(mu, players);
dump_scores(players, mu, mu_stddev, num_players);
//fprintf(stderr, "Optimal sigma: %f (two-player: %f)\n", sigma[0], sigma[0] * sqrt(2.0f));
printf("%f 0 -2\n", global_sigma / sqrt(2.0f));