parameters: (self, game, data, callback=None)
docstring: Find lambda parameter for which QRE best fits the data
          using the sum of squares of distances in the histogram of
          the data.
docstring_summary: Find lambda parameter for which QRE best fits the data
          using the sum of squares of distances in the histogram of
          the data.
docstring_tokens: Find lambda parameter for which QRE best fits the data using the sum of squares of distances in the histogram of the data .
function: def compute_fit_sshist(self, game, data, callback=None):
          """
          Find lambda parameter for which QRE best fits the data
          using the sum of squares of distances in the histogram of
          the data.
          """
          def diff_dist(data, point, tangent):
              return 2.0 * sum((math.exp(p)-d) * t * math.exp(p)
                               for (p, t, d) in zip(point, tangent, data))
  
          if game.is_symmetric:
              p = game.mixed_strategy_profile()
              point = pctrace.trace_path([math.log(x) for x in p.profile],
                                         0.0, 1000000.0,
                                         lambda x: sym_compute_lhs(game, x),
                                         lambda x: sym_compute_jac(game, x),
                                         hStart=1.0,
                                         crit=lambda x, t: diff_dist(data, x, t),
                                         maxIter=100,
                                         callback=callback)
  
              qre = LogitQRE(
                  point[-1],
                  game.mixed_strategy_profile(
                      point=[math.exp(x) for x in point[:-1]]
                  )
              )
              return qre
          else:
              raise NotImplementedError
function_tokens: def compute_fit_sshist ( self , game , data , callback = None ) : def diff_dist ( data , point , tangent ) : return 2.0 * sum ( ( math . exp ( p ) - d ) * t * math . exp ( p ) for ( p , t , d ) in zip ( point , tangent , data ) ) if game . is_symmetric : p = game . mixed_strategy_profile ( ) point = pctrace . trace_path ( [ math . log ( x ) for x in p . profile ] , 0.0 , 1000000.0 , lambda x : sym_compute_lhs ( game , x ) , lambda x : sym_compute_jac ( game , x ) , hStart = 1.0 , crit = lambda x , t : diff_dist ( data , x , t ) , maxIter = 100 , callback = callback ) qre = LogitQRE ( point [ - 1 ] , game . mixed_strategy_profile ( point = [ math . exp ( x ) for x in point [ : - 1 ] ] ) ) return qre else : raise NotImplementedError