compute_fp¶
Compute an approximate fixed point of a given operator T, starting from specified initial condition v.

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^{k1} 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 twoplayer games called imitation games and utilizes their Nash equilibria, computed by the LemkeHowson 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 theorm, i.e., a continuous function that maps a compact and convex set to itself.
Parameters:  T : callable
A callable object (e.g., function) that acts on v
 v : object
An object such that T(v) is defined; modified in place if method=’iteration’ and `v is an array
 error_tol : scalar(float), optional(default=1e3)
Error tolerance
 max_iter : scalar(int), optional(default=50)
Maximum number of iterations
 verbose : scalar(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_skip : scalar(int), optional(default=5)
How many iterations to apply between print messages (effective only when verbose=2)
 method : str, 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
Returns:  v : object
The approximate fixed point
References
[1] (1, 2) A. McLennan and R. Tourky, “From Imitation Games to Kakutani,” 2006.