Dynamic Process: Robustness to the Share of Updating Voters (with CW) (C.2)
[1]:
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from poisson_approval import *
[2]:
N_SAMPLES = 10000
N_MAX_EPISODES = 1000
[3]:
update_ratios = {
'1': 1,
'0.5': 0.5,
'one_over_log_log_t_plus_fourteen': one_over_log_log_t_plus_fourteen,
'one_over_log_t_plus_one': one_over_log_t_plus_one,
'one_over_sqrt_t': one_over_sqrt_t,
'one_over_t': one_over_t,
}
[4]:
rand_profile = RandConditional(
RandProfileHistogramUniform(n_bins=1),
test=is_condorcet, n_trials_max=None
)
Condorcet consistency:
[5]:
table_cond = pd.DataFrame()
table_cond.index.name = 'Share of updating voters'
for update_ratio_name, update_ratio in update_ratios.items():
results = monte_carlo_fictitious_play(
factory=rand_profile,
n_samples=N_SAMPLES,
n_max_episodes=N_MAX_EPISODES,
voting_rules=VOTING_RULES,
init='random_tau',
ballot_update_ratio=update_ratio,
monte_carlo_settings=[
MCS_FREQUENCY_CW_WINS,
],
file_save='sav/ballot_update_%s_with_CW.sav' % update_ratio_name,
)
for voting_rule in VOTING_RULES:
table_cond.loc[update_ratio_name, voting_rule] = float(results[voting_rule]['mean_frequency_cw_wins'])
table_cond
[5]:
Approval | Plurality | Anti-plurality | |
---|---|---|---|
Share of updating voters | |||
1 | 0.997838 | 0.6670 | 0.102871 |
0.5 | 0.999552 | 0.6697 | 0.267519 |
one_over_log_log_t_plus_fourteen | 0.999749 | 0.6730 | 0.257903 |
one_over_log_t_plus_one | 0.999908 | 0.6628 | 0.496961 |
one_over_sqrt_t | 0.999800 | 0.6697 | 0.570528 |
one_over_t | 0.999700 | 0.6573 | 0.603082 |