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
n_max_episodes (int) – Maximum number of episodes for the fictitious play / iterated voting.
init (Strategy or TauVector or str) – Cf.
fictitious_play()
oriterated_voting()
.perception_update_ratio (callable or Number) – Cf.
fictitious_play()
oriterated_voting()
.ballot_update_ratio (callable or Number) – Cf.
fictitious_play()
oriterated_voting()
.meth (str) – The name of the method (
'fictitious_play'
or'iterated_voting'
).
- 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()
.