quantecon.compute_fp.compute_fixed_point(T, v, error_tol=0.001, max_iter=50, verbose=2, print_skip=5, method='iteration', *args, **kwargs)[source]

Computes and returns an approximate fixed point of the function T.

The default method ‘iteration’ simply iterates the function given an initial condition v and returns \(T^k v\) when the condition \(\lVert T^k v - T^{k-1} v\rVert \leq \mathrm{error\_tol}\) is satisfied or the number of iterations \(k\) reaches max_iter. Provided that T is a contraction mapping or similar, \(T^k v\) will be an approximation to the fixed point.

The method ‘imitation_game’ uses the “imitation game algorithm” developed by McLennan and Tourky [1], which internally constructs a sequence of two-player games called imitation games and utilizes their Nash equilibria, computed by the Lemke-Howson algorithm routine. It finds an approximate fixed point of T, a point \(v^*\) such that \(\lVert T(v) - v\rVert \leq \mathrm{error\_tol}\), provided T is a function that satisfies the assumptions of Brouwer’s fixed point theorem, i.e., a continuous function that maps a compact and convex set to itself.


A callable object (e.g., function) that acts on v


An object such that T(v) is defined; modified in place if method=’iteration’ and `v is an array

error_tolscalar(float), optional(default=1e-3)

Error tolerance

max_iterscalar(int), optional(default=50)

Maximum number of iterations

verbosescalar(int), optional(default=2)

Level of feedback (0 for no output, 1 for warnings only, 2 for warning and residual error reports during iteration)

print_skipscalar(int), optional(default=5)

How many iterations to apply between print messages (effective only when verbose=2)

methodstr, optional(default=’iteration’)

str in {‘iteration’, ‘imitation_game’}. Method of computing an approximate fixed point

args, kwargs

Other arguments and keyword arguments that are passed directly to the function T each time it is called


The approximate fixed point



A. McLennan and R. Tourky, “From Imitation Games to Kakutani,” 2006.