parameters: (game, point)
return_statement: return matrix
docstring: Compute the Jacobian for the set of equations for a symmetric logit QRE
      of a symmetric game.
docstring_summary: Compute the Jacobian for the set of equations for a symmetric logit QRE
      of a symmetric game.
docstring_tokens: Compute the Jacobian for the set of equations for a symmetric logit QRE of a symmetric game .
function: def sym_compute_jac(game, point):
      """
      Compute the Jacobian for the set of equations for a symmetric logit QRE
      of a symmetric game.
      """
      profile = game.mixed_strategy_profile(
          point=[math.exp(x) for x in point[:-1]]
      )
      lam = point[-1]
  
      matrix = numpy.zeros((len(point), len(profile)))
  
      for (st, cont) in enumerate(game.choices):
          if st == 0:
              # sum-to-one equation
              for (sto, conto) in enumerate(game.choices):
                  matrix[sto, st] = profile[sto]
  
              # derivative wrt lambda is zero, so don't need to fill last col
          else:
              # this is a ratio equation
              for (sto, conto) in enumerate(game.choices):
                  matrix[sto, st] = \
                             -(game.N-1) * lam * profile[sto] * \
                             (profile.strategy_value_deriv(st, sto) -
                              profile.strategy_value_deriv(0, sto))
                  if sto == 0:
                      matrix[sto, st] -= 1.0
                  elif sto == st:
                      matrix[sto, st] += 1.0
  
              # column wrt lambda
              matrix[-1][st] = (
                  profile.strategy_value(0) - profile.strategy_value(st)
              )
  
      return matrix
function_tokens: def sym_compute_jac ( game , point ) : profile = game . mixed_strategy_profile ( point = [ math . exp ( x ) for x in point [ : - 1 ] ] ) lam = point [ - 1 ] matrix = numpy . zeros ( ( len ( point ) , len ( profile ) ) ) for ( st , cont ) in enumerate ( game . choices ) : if st == 0 : # sum-to-one equation for ( sto , conto ) in enumerate ( game . choices ) : matrix [ sto , st ] = profile [ sto ] # derivative wrt lambda is zero, so don't need to fill last col else : # this is a ratio equation for ( sto , conto ) in enumerate ( game . choices ) : matrix [ sto , st ] = - ( game . N - 1 ) * lam * profile [ sto ] * ( profile . strategy_value_deriv ( st , sto ) - profile . strategy_value_deriv ( 0 , sto ) ) if sto == 0 : matrix [ sto , st ] -= 1.0 elif sto == st : matrix [ sto , st ] += 1.0 # column wrt lambda matrix [ - 1 ] [ st ] = ( profile . strategy_value ( 0 ) - profile . strategy_value ( st ) ) return matrix