convergence_test

poisson_approval.convergence_test(n_max_episodes, init='sincere', perception_update_ratio=<function one_over_log_t_plus_one>, ballot_update_ratio=<function one_over_log_t_plus_one>, meth='fictitious_play')[source]

Create a convergence test.

Parameters
Returns

A callable. Input: a profile. Output: a bool, which is True if the fictitious play / iterated voting converges (within the specified number of episodes).

Return type

callable

Examples

>>> converges = convergence_test(n_max_episodes=10)
>>> profile = ProfileHistogram({'abc': 0.7, 'bac': 0.3}, {'abc': [1.], 'bac': [1.]})
>>> converges(profile)
False

This function is especially convenient when a test function is required, for example when using probability().