fmcs  v3.0.0
NormalFormGame Struct Reference

A two-player normal form game with QRE equilibrium selection. More...

#include "game_distributions.hpp"

Inheritance diagram for NormalFormGame:
Distribution< NormalFormGame, nfg_profile_t >

Public Member Functions

template<typename... Vs>
 NormalFormGame (std::variant< Vs... > u_row, std::variant< Vs... > u_col, std::variant< Vs... > lambda)
 
 NormalFormGame (std::vector< std::vector< double >> u_row_, std::vector< std::vector< double >> u_col_, double lambda_=1.0, double damping_=0.5, double tolerance_=1e-2, size_t max_iter_=50000)
 
const std::vector< double > & action_probs (size_t player) const
 The solved QRE mixed strategy for the requested player.
 
double expected_payoff (size_t player) const
 Ex ante expected QRE payoff for the requested player.
 
double logprob (nfg_profile_t value) const
 
size_t n_actions (size_t player) const
 Number of actions for player 0 (row) or 1 (column)
 
template<typename RNG >
nfg_profile_t sample (RNG &rng)
 
void solve ()
 Solve the QRE fixed point. Uses lambda-continuation: starts at lam = min(lambda, 1) where the softmax response map is close to a contraction, then doubles lam up to the target, warm-starting each rung. This traces the principal QRE branch toward the NE as lambda grows, and markedly improves convergence at high precision.
 
std::string string () const
 
- Public Member Functions inherited from Distribution< NormalFormGame, nfg_profile_t >
double logprob (nfg_profile_t value)
 
nfg_profile_t sample (RNG &rng)
 
std::string string () const
 

Public Attributes

bool converged
 false if the fixed-point iteration hit max_iter
 
double damping
 fixed-point iteration damping factor in (0, 1]
 
double lambda
 QRE precision (1/temperature)
 
size_t max_iter
 
std::vector< double > sigma_col
 
std::vector< double > sigma_row
 solved QRE mixed strategies
 
double tolerance
 
std::vector< std::vector< double > > u_col
 u_col[a][b]: column player's payoff from joint action (a, b)
 
std::vector< std::vector< double > > u_row
 u_row[a][b]: row player's payoff from joint action (a, b)
 

Detailed Description

A two-player normal form game with QRE equilibrium selection.

Solves the logit-QRE fixed point on construction:

sigma_row(a) prop exp(lambda * E_{b ~ sigma_col}[ u_row(a, b) ]) sigma_col(b) prop exp(lambda * E_{a ~ sigma_row}[ u_col(a, b) ])

The node value is a joint pure action profile drawn from p(a, b) = sigma_row(a) * sigma_col(b), so:

logprob((a, b)) = log sigma_row(a) + log sigma_col(b)

Special cases of the selection rule:

  • lambda = 0 : uniform over joint actions (maximum entropy)
  • lambda -> infty : Nash equilibrium selection (the QRE branch traced from the uniform distribution converges to a selected NE – for generic games, the risk-dominant one)

Unlike exact-NE selection, the QRE map is a smooth function of the payoff matrices, so likelihood-weighting and Metropolis inference over upstream payoff nodes behaves well (no piecewise-constant likelihoods).


The documentation for this struct was generated from the following file: