Package: poisson-approval
Poisson ApprovalPoisson Approval studies the Poisson Game of Approval Voting.Free software: GNU General Public License v3.Documentation:https://francois-durand.github.io/poisson_approval/.FeaturesImplement only the case of 3 candidates.Deal with ordinal or cardinal profiles.Compute the asymptotic developments of the probability of pivot events when the number of players tends to infinity.Compute the best response to a given tau-vector.Explore automatically a grid of ordinal profiles or a grid of tau-vectors.Perform Monte-Carlo experiments on profiles or tau-vectors.Search an equilibrium by iterated voting or fictitious play.In addition to Approval, implement Plurality and Anti-plurality as Poisson games.Perform numeric or symbolic computation.CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.31.0 (2022-06-16): Stability of EquilibriaAddProfileHistogram.is_equilibrium_stable: whether a forward-focused equilibrium strategy is stable in this
profile (which is a sufficient condition for it to be an equilibrium in the sense of Myerson).0.30.0 (2022-01-24): Equilibrium Properties in Monte Carlo Fictitious PlayAdd new Monte-Carlo settings:MCS_FOCUS: focus of the equilibrium.MCS_IS_ORDINAL_EQ: whether the equilibrium is ordinal.AddBestResponse.is_ordinal: whether the best response is purely ordinal.AddTauVector.is_best_response_ordinal: whether the best responses of all rankings are ordinal.Object of the classFocusare now hashable.For developers:Add a local coverage report.The run configuration to generate the documentation is stored as a project file.0.29.3 (2022-01-18): Patch test for latest release of SymPyCorrect a unit test due to a change of behavior in the latest release of SymPy.0.29.2 (2021-02-16): Notebook on Robustness to the Initial PollUpdate the notebook on the robustness to the initial poll in the documentation.0.29.1 (2021-02-16): Notebook on Confidence IntervalsUpdate the notebook on confidence intervals in the documentation.0.29.0 (2021-02-15): Monte-Carlo Fictitious PlayMonte-Carlo fictitious play:Addmonte_carlo_fictitious_play: Monte-Carlo analysis of fictitious play (or iterated voting).AddMonteCarloSetting: setting formonte_carlo_fictitious_play.AddMCS_BALLOT_STATISTICS,MCS_CANDIDATE_WINNING_FREQUENCY,MCS_CONVERGES,MCS_DECREASING_SCORES,MCS_FREQUENCY_CW_WINS,MCS_N_EPISODES,MCS_PROFILE,MCS_TAU_INIT,MCS_UTILITY_THRESHOLDS,MCS_WELFARE_LOSSES: pre-defined settings formonte_carlo_fictitious_play.Addplot_utility_thresholds: plot the distribution (CDF) of the utility threshold.Addplot_welfare_losses: plot the distribution (CDF) of the welfare losses, for each voting rule.Modifyplot_distribution_scores: the new syntax takes advantage ofmonte_carlo_fictitious_play.Improvement ofiterated_votingandfictitious_play:Both methods now takes additional parameters:other_statistics_update_ratio,other_statistics_tauandother_statistics_strategy, in order to compute long-run averages of any kind of statistics.New outputconverges: whether the process converges.New outputtau_init: the actual value of the tau-vector used at initialization (especially useful when
initialization is random).New results related to the “other statistics” are included in the output dictionary.Other tools for meta-analysis:Addconvergence_test: create a convergence test.Addis_condorcet: whether a profile has one Condorcet winner.Addis_not_condorcet: whether a profile has no Condorcet winner.heatmap_candidatesaccepts a new parameter,file_save_data, to save into a file the data computed in order
to prepare the plot. Same forternary_plot_winners_at_equilibrium.UtilPlotsmodule:Addplt_plot_with_error: adaptation ofplt.plotfor Monte-Carlo experiments, with error area.Addplt_step_with_error: adaptation ofplt.stepfor Monte-Carlo experiments, with error area.Addplt_cdf: plot a cumulative distribution function from Monte-Carlo experiments, with error area.Misc:Rename the moduleconstantstobasic_constants.Add constantVOTING_RULES: the three voting rules of the package, i.e. Approval, Plurality and Anti-Plurality.Add constantSETS_OF_RANKINGS_UP_TO_RELABELLING: all possible sets of rankings, up to relabelling the candidates.RenameBestResponse.threshold_utilitytoBestResponse.utility_threshold(for consistency with other
occurrences of the phrase “utility threshold”).Revision of the whole documentation, including the tutorials (typos, missing hyperlinks, etc).In the documentation, add the notebooks related to our research article:Voter Coordination in Elections: A Case for Approval Voting.Fix bugs:InEventTrio: solve a rare bug occurring when an offset ratio is greater but very close to 1.Profile.random_tau_undominateddid not take voters with weak orders into account.In Plurality, voters with a weak order of type “hate” (e.g.a~b>c) were treated incorrectly for strategic voting.
There was a similar bug in Anti-Plurality for voters with a weak order of type “love” (e.g.a>b~c). Fixing this bug
has consequences, in particular, for the methodtau_strategicof several subclasses ofProfile, but only
for profiles involving weak orders, in Plurality or Anti-Plurality.Fixing the latter bug lead to several collateral modifications concerning the strategies of the voters with a weak
order of preference:All subclasses ofStrategynow take an additional parameter:d_weak_order_ballot, that can be filled in
the few cases where strategic voting is not automatic for voters with a weak order: “haters” (e.g.a~b>c) in
Plurality and “lovers” (e.g.a>b~c) in Anti-Plurality. Note, in particular, that this parameter is not
used for Approval.AddProfile.d_ballot_share_weak_voters_strategic: ballot shares due to the weak orders if they vote
strategically.Profile.best_responses_to_strategynow takes as input a tau-vector (instead of a dictionary of best responses)
and an optional ratio of optimistic voters.0.28.0 (2020-12-11): Plurality and Anti-Plurality WelfareInProfile:Addd_candidate_plurality_welfare: plurality welfare of each candidate.Addd_candidate_anti_plurality_welfare: anti-plurality welfare of each candidate.Addd_candidate_relative_plurality_welfare: relative plurality welfare of each candidate.Addd_candidate_relative_anti_plurality_welfare: relative anti-plurality welfare of each candidate.InProfileCardinal:d_candidate_welfareandd_candidate_relative_welfarenow return aDictPrintingInOrderinstead of
a basicdict.0.27.1 (2020-11-26): Use GitHub actionsThis patch concerns only Poisson Approval’s developpers. To develop and maintain the package, it uses GitHub actions
instead of additional services such as Travis-CI and ReadTheDocs.0.27.0 (2020-11-11): Analysis toolsAddplot_distribution_scores: CDF of the score of the winner, the challenger and the loser (conditionally
on the convergence of fictitious play / iterated voting).AddTernaryAxesSubplotPoisson.f_point_values_: when a candidate heatmap has been drawn, this function gives
access to the computed values.AddTauVector.print_magnitudes_order: print the order of the magnitudes of the weak pivots.Infictitious_playanditerated_voting, in verbose mode, display also the order of the magnitudes of
the weak pivots.0.26.0 (2020-06-26): Descriptive Statistics of the BallotsInTauVector:Addshare_single_votes: share of single votes, i.e. votes for one candidate only.Addshare_double_votes: share of double votes, i.e. votes for two candidates.InProfileCardinal:Addshare_sincere_among_strategic_voters: share of strategic voters that happen to cast a sincere ballot (when
a strategy is given).Addshare_sincere_among_fanatic_voters: share of fanatic voters that happen to cast a sincere ballot.Addshare_sincere: share of voters that happen to cast a sincere ballot (when a strategy is given). This
takes sincere, fanatic and strategic voters into account.InStrategy:Addshare_single_votesandshare_double_votes: these shortcuts are defined when the strategy
is defined with an embedded profile.Addshare_sincere_among_strategic_votersandshare_sincere: these shortcuts are defined when the strategy
is defined with an embedded profile, provided the profile is cardinal.0.25.1 (2020-06-25): Welfare of a CandidateProfileCardinalnow has attributesd_candidate_welfareandd_candidate_relative_welfare: for each
candidate, it gives its welfare, i.e. its total utility. The relative welfare is normalized so that the candidate
with maximal welfare has 1 and the one with minimal welfare has 0.The functionprobabilitynow accepts a tuple of tests as inputs.Bug fix: the recent versions of the external packagescipychanged the behavior ofscipy.optimize.minimize.
SincePivotTriorelies on this function, its behavior changed in an unexpected way and it sometimes lead to
incorrect results, such as a positive magnitude. This version solves the problem:PivotTriohas regained its
former (correct) behavior.0.24.0 (2020-03-29): Plots for Convergence FrequencyAddternary_plot_convergenceandbinary_plot_convergence: plot the convergence frequency, which is defined
as the proportion of initializations where iterated voting or fictitious play lead to convergence withinn_max_episodesiterations.0.23.0 (2020-03-29): Improve Iterated Voting and Fictitious PlayRandom initialization of iterated voting and fictitious play:Add the option'random_tau': a random tau-vector that is consistent with the voting rule.Add the option'random_tau_undominated': a random tau-vector where each voter randomly uses an undominated
ballot. Relies on the new methodProfile.random_tau_undominated.Remove the option'random_strategy': it had an unnatural behavior for Plurality and Anti-Plurality.
Subsequently, remove also the methodProfile.random_strategy.In iterated voting and fictitious play, winning frequencies are computed from t=1 instead of t=0. The motivation is
twofold. Firstly, if the result at initialization is essentially arbitrary and, for example, candidateaalways
wins afterwards, we consider it more natural to have a winning frequency of 1 fora. Secondly, when using the
arithmetic average, the denominator is the number of steps, rather than the number of steps plus one. As a
consequence, we updated the helper functions in order to account for this time translation:Replaceone_over_t_plus_onewithone_over_t.Replaceone_over_sqrt_t_plus_onewithone_over_sqrt_t.Replaceone_over_log_t_plus_twowithone_over_log_t_plus_one.Replaceone_over_log_log_t_plus_fifteenwithone_over_log_log_t_plus_fourteen.Fix a rare bug: in some tau-vectors, when computing the trio event, an offset was found greater than 1, whereas theory
shows that it is lower than 1. This used to cause a collateral error when computing the best response with the
offset method.0.22.0 (2020-03-22): Binary PlotsImplementbinary plots, i.e. plots designed to study profiles based on two ranking with varying utilities. Cf. the
corresponding tutorial.Intensity heat maps.Candidate heat maps.Annotate the Condorcet regions.Utilities:Addd_candidate_ordinal_utility: ordinal utility of a candidate for a given preference order.Addmy_range: similar torange, but works also for fractions.Addmy_sign: sign of a number. Return an integer in {-1, 0, 1}, unlikenp.sign.0.21.0 (2020-03-12): Iterables and Random FactoriesAdd new iterables and random factories for profiles, tau-vectors and strategies. These iterables and random factories
are very flexible: you can specify that some types have a fixed share, that only some types have a variable share,
etc. Cf. the corresponding tutorials and the corresponding section in Reference.RemoveExploreGridProfilesOrdinalandExploreGridTaus: their features are included in the new iterables.Remove all classes whose name began withGenerator: their features are included in the new random factories.All the methods that had a parametergeneratornow have a parameterfactoryinstead. This choice is due to
the fact that the word “generator” has another meaning in Python, which could be misleading.SimplexToProfileworks similarly to the new iterables and random factories. In particular it is now allowed to
use the same type several times, for example in the fixed shares and in the variable shares.There is a new syntax option to define aProfileHistogram, which is especially convenient for
iterables and random factories.Utilities:Additerator_integers_fixed_sum: iterate over vectors of integers with a fixed sum.Additerate_simplex_grid: iterate over the points in the simplex, with rational coordinates of a given
denominator.Addallowed_ballots: allowed ballots in a voting rule.Complete revision of the tutorials.0.20.0 (2020-03-03): Symbolic ComputationProfileand its subclasses,TauVector,Asymptoticand its constructors (such asAsymptotic.poisson_value,Asymptotic.poisson_eq, etc.) accept an optional argumentsymbolic. If False
(default), then all computations are numeric as before. If True, then almost all computations are symbolic; the
only exception is when the trio event can be evaluated only via the Dual Magnitude Theorem. Please note that:This feature relies on the external packagesympyand works with its current version (1.5.1) but we cannot
guarantee that it will still work with future versions ofsympy.When activated, it slows downs the computation considerably. In particular, it is strongly advised not to use
fictitious play or iterated voting in symbolic mode.Equality and closeness tests:Asymptotic.iscloseis renamed tolook_equal: in numeric mode, it is still a closeness test, but in
symbolic mode, it is an equality test.RemoveStrategyThreshold.isclose: this method was not used anymore.Eventand its subclasses take aTauVectoras input, instead of the dictionary of its coefficients. Firstly, it
speeds up computation. Secondly, it avoids a minor bug in symbolic mode.Utilities:Add the classesComputationEngine,ComputationEngineNumericandComputationEngineSymbolic, defining
how some mathematical operations are performed.Add the functioncomputation_engine: choose the computation engine.Remove the utility functionbarycenterand include it as a method inComputationEngine.0.19.0 (2020-02-27): Mixed StrategiesStrategyThreshold: for each ranking, there is athreshold(like before) and an optionalratio_optimistic.
Voters whose utility for their second candidate is equal to the threshold of the strategy are split: a shareratio_optimisticbehave as if the threshold was higher (in Approval, they vote only for their top candidate)
and the rest behave as if the threshold was lower (in Approval, they vote for their two first candidates). Hence the
strategy is mixed. Note that this only makes a difference when the profile has “atoms” (concentration of voters on a
single utility point); currently, this is only the case inProfileDiscrete.ForProfileDiscrete, fictitious play and iterated voting consider that the responses use a ratio of optimistic
voters equal to 1/2.AddProfileCardinalContinuous: this abstract class is a child ofProfileCardinaland a parent class
ofProfileNoisyDiscreteandProfileHistogram. In these profiles, the ratios of optimistic voters are not
important because there is no “atom”.GeneratorStrategyThresholdUniform: for each ranking, the ratio of optimistic voters is also chosen uniformly.The utilityDictPrintingInOrderIgnoringNonenow also ignores values that are iterables containing only None.0.18.0 (2020-02-26): Improved Ternary PlotsNicer colors than before. For example, an equal mix of candidatea(red) andb(green) was brownish, whereas it
is now yellow. Similarly, a mix of the three candidates (red, green, blue) was gray, and it is now white. Etc.Improved ternary plot shortcutsternary_plot_n_equilibria,ternary_plot_winners_at_equilibriumandternary_plot_winning_frequencies:New versions of these functions with more options. Cf. the tutorial on ternary plots.Add classSimplexToProfileto map a point of the simplex to a profile. This includes the possibility of
having fixed additional voters.TernaryAxesSubplotPoisson:Add methodslegend_color_patchesandlegend_palette: two different styles of legends for candidate
heat maps.The methodheatmap_candidateshas a new parameterlegend_style.The methodannotate_condorcethas a new parameterd_order_fixed_shareto account for fixed additional
voters.In several methods, the old parameterscolor_a,color_bandcolor_care suppressed, because
the colors fora,b,care not modifiable anymore.Random strategies:AddGeneratorStrategyTwelveUniform.Add methodProfile.random_strategy: return a random strategy that is suitable for the profile (e.g. an ordinal
strategy for an ordinal profile, etc.).ProfileCardinal.iterated_votingandProfileCardinal.fictitious_playnow accept the parameterinit='random'for an initialization with a random strategy.AddProfile.order_and_label: order and label of a discrete type. This auxiliary function is used for the ternary
plots.0.17.0 (2020-02-24): Analyzed StrategiesProfileand its subclasses:The methodanalyzed_strategiesnow inputs an iterator of strategies: it perform an analysis on all the
strategies given by this iterator.Add pre-defined iterators of strategies:strategies_ordinalis defined for any profile.strategies_pureis defined for any discrete profile, such asProfileDiscreteorProfileTwelve.strategies_groupis defined for any profile where a reasonable notion of “group” is defined, such asProfileNoisyDiscreteorProfileHistogram.Add the attributesanalyzed_strategies_ordinal,analyzed_strategies_pure,analyzed_strategies_group.
Not only do they provide shortcuts combininganalyzed_strategieswith the relevant iterator, but they also have
the added value of being cached properties: if the user accesses the same attribute several times, it is only
computed once.Remove the attributewinners_at_equilibrium. Instead, the corresponding attribute is added to the classAnalyzedStrategies. This gives more flexibility because it is defined for anyAnalyzedStrategiesobject.The consequences on ternary plots are temporary and are likely to change in the near future, with a new release
focusing on improved ternary plots.ternary_plot_winners_at_equilibriumbecomesternary_plot_winners_at_equilibrium_ordinal.ternary_plot_n_bloc_equilibriabecomesternary_plot_n_equilibria_ordinal.Strategy.deepcopy_with_attached_profilenow also copies the voting rule of the given profile.0.16.1 (2020-02-24): More Flexible Initialization of ProfileNoisyDiscreteProfileNoisyDiscrete: add a parameternoisethat enables not to mention explicitly the value of the noise for
each group of voters. This is especially convenient in the quite common case where all groups of voters have the
same noise.0.16.0 (2020-02-22): ProfileNoisyDiscreteAddProfileNoisyDiscrete: a profile with a discrete distribution of voters, with noise.0.15.0 (2020-02-20): Weak OrdersImplement weak orders:Profilenow has attributesd_weak_order_share,support_in_weak_orders,contains_weak_orders,contains_rankings,d_ballot_weak_voters_sincere,d_ballot_weak_voters_fanatic.Subclasses of Profile have a parameterd_weak_order_share.Remove methodsProfileOrdinal.supportandProfileOrdinal.is_generic: with the presence of weak orders,
their names had become misleading, whereassupport_in_rankingsandis_generic_in_rankingis non-ambiguous.TernaryAxesSubplotPoisson.annotate_condorcetnow also works with weak orders. However, it may not work on
all distributions because it relies on the external packageshapely. If there are only rankings, it should still
work anyway.Add utilitiesis_weak_order,is_lover,is_hater,sort_weak_order.Add shortcut functions for some common ternary plots:ternary_plot_n_bloc_equilibria: number of bloc equilibria.ternary_plot_winners_at_equilibrium: winners at equilibrium.ternary_plot_winning_frequencies: winning frequencies in fictitious play.MethodsProfileCardinal.iterated_votingandProfileCardinal.fictitious_playhave a new parameterwinning_frequency_update_ratio, indicating how the winning frequencies are computed in case of non-convergence.
Note however that in case of convergence to a periodical orbit (for iterated voting), it remains the arithmetic
average anyway.Add utilitymy_division: division of two numbers, trying to be exact if it is reasonable.0.14.0 (2020-02-16): Flexible Initialization of Iterated Voting / Fictitious PlayInstead of a parameterstrategy_ini, the methodsProfileCardinal.iterated_votingandProfileCardinal.fictitious_playnow have a parameterinitthat can be either a strategy (like before), or a
tau-vector, or a string'sincere'or'fanatic'.0.13.0 (2020-02-16): Ternary PlotsDraw plots on the simplex where points have 3 coordinates summing to 1. Cf. the corresponding tutorial.Intensity heat maps.Candidate heat maps.Annotate the Condorcet regions.AddProfile.winners_at_equilibrium: for the classes of profile that have a methodanalyzed_strategies,
give the set of winners at equilibrium.0.12.0 (2020-02-09): GeneratorProfileHistogramSinglePeakedUniformAddGeneratorProfileHistogramSinglePeakedUniform: a generator of single-peaked histogram-profiles following
the uniform distribution.Add examples of functions to be used as update ratios forProfileCardinal.fictitious_play:one_over_t_plus_one,one_over_sqrt_t_plus_one,one_over_log_t_plus_two,one_over_log_log_t_plus_fifteen.0.11.0 (2020-02-09): Winning frequencies in iterated voting / fictitious playProfileCardinal.iterated_votingandProfileCardinal.fictitious_playnow also output the winning frequency of
each candidate (limit frequency in case of convergence, frequency over the history otherwise).New utilities:Addcandidates_to_d_candidate_probability: convert a set of candidates to a dictionary of probabilities (random
tie-break)Addcandidates_to_probabilities: convert a set of candidates to an array of probabilities (random tie-break).Addarray_to_d_candidate_value: convert an array to a dictionary of candidates and values.Addd_candidate_value_to_array: convert a dictionary of candidates and values to an array.0.10.0 (2020-02-09): ProfileDiscrete.analyzed_strategiesImplementProfileDiscrete.analyzed_strategies: exhaustive analysis of all pure strategies of the profile.0.9.0 (2020-02-09): Plurality and Anti-pluralityImplement Plurality and Anti-plurality (cf. the corresponding tutorial).Python 3.5 is not officially supported anymore. However, in practice, the package should still essentially work with
Python 3.5, the only notable difference being the order in which the dictionaries are printed.New utilities:Addballot_two: ballot for the second candidate of a ranking (used for Plurality).Addballot_one_three: ballot against the second candidate of a ranking (used for Anti-plurality).Addballot_low_uandballot_high_u: the ballot chosen by the voters who have a low (resp. high) utility
for their middle candidate, depending on the voting rule.Addproduct_dict: Cartesian product for a dictionary of iterables.AddDictPrintingInOrderIgnoringNone: dictionary that prints in the order of the keys, ignoring value None.In theUtilCachemodule, addproperty_deleting_cache: define a property that deletes the cache when set or
deleted. This is used for parameters likeratio_sincere,voting_rule, etc.0.8.1 (2020-02-04): Better Handling of Edge Cases in BestResponseBestResponse: the focus of this release is to correct rare bugs that used to happen when some offsets are very
close to 1.API change:BestResponsenow takes as parameters the tau-vector and the ranking, instead of all the events
that are used for the computation.Exchanged the justifications'Easy vs difficult pivot'and'Difficult vs easy pivot'(their usages
were switched, even if the result itself was correct).Use the asymptotic method only when there are two consecutive zeros in the “compass diagram” of the tau-vector
(instead of: whenever it gives a result). The motivation is that the asymptotic method may rely on events that rely
more on numerical approximation than the limit pivot theorem approach.To determine whether pivots are easy or difficult, we rely on expected scores in the duo events, instead of the
pseudo-offsets of the trio. The motivation is that in some cases, the trio is computed with a numerical optimizer
that relies more on numerical approximation than the duo events, which use only basic operations like addition,
multiplication, etc. In the rare cases where the two methods differ, the latter is thus more reliable.Add a sub-algorithm of the “Offset method”, called “Offset method with trio
approximation correction”. This is used in some rare cases where both pivots are difficult, but the numeric
approximations of the trio event lead to an offset that is equal or even slightly greater than 1 (which is abnormal
and leads to infinite geometric sums). In those cases, we now consider that the offset is lower and infinitely close
to 1.Corrected a bug in the asymptotic method that could happen when the two personalized pivots had very close
magnitudes. This uses the correction ofAsymptotic.limitmentioned below.TauVector: added the attributehas_two_consecutive_zeros.Event: now computes the pseudo-offsets, e.g.psi_a,psi_ab, etc.Asymptotic: handles some edge cases more nicely.__str__displays a coefficient as 0, 1 or -1 only if it is equal to that value. Close is not enough.limitdoes not use closeness to 0. It is not its role to decide what coefficients are negligible in the context.
Only operations like multiplication are allowed to use closeness: for example, ifmu_1and- mu_2are
relatively close, the multiplication operator is allowed to decide thatmu_1 + mu_2is equal to 0.In multiplication, when the two magnitudes are close, the resulting magnitude is now always equal to the maximum.
The same applies for the resultingnuwhen thenu’s are also equal.cached_property: corrected a bug. In the case of nested cached properties, the inner one was sometimes not
recorded in cache. It did not lead to incorrect results but slowed down the program.0.8.0 (2020-01-30): Fanatic votersImplement the notion of fanatic voting, a variant of sincere voting: a given ratio of voters vote for their top
candidate only. This is implemented for all subclasses ofProfile.The utilitybarycenternow accepts iterables.Corrected bug:Profile.standardized_versionnow takes into account the auxiliary parameters likeratio_sincere,well_informed_voters, etc.0.7.0 (2020-01-30): ProfileDiscreteAddProfileDiscrete: a profile with a discrete distribution of voters.Subclasses ofProfile: better handling of the additional parameters likewell_informed_votersorratio_sincere. In the conversions to string (strorrepr), they are now mentioned. They are also used in
the equality tests between two profiles.0.6.0 (2020-01-29): Fictitious PlayImplementProfileCardinal.fictitious_play, where the update ratios of the perceived tau-vector and the actual
tau-vector can be functions of the time. It is also faster thatProfileCardinal.iterated_voting, but can
not detect cycles (only convergence).ProfileCardinal.iterated_voting_tausis renamed toProfileCardinal.iterated_voting. It has been generalized
by implementing a notion of perceived tau-vector, like forProfileCardinal.fictitious_play. The syntax has been
modified in consequence.ProfileCardinal.iterated_voting_strategiesis deprecated and suppressed.Iterated voting and fictitious play do not need aStrategyThresholdas initial strategy, but any strategy that is
consistent with the profile subclass. For example, withProfileTwelve, you can use aStrategyTwelve.Strategy.profileis now a property that can be reassigned after the creation of the object.AddStrategy.deepcopy_with_attached_profile: make a deep copy and attach a given profile.Add the utilityto_callable: convert an object to a callable (making it a constant function if it is not
callable already).0.5.1 (2020-01-18): Configure Codecov and Improve CoverageConfigure Codecov.Reach 100% coverage for this version.0.5.0 (2020-01-11): Sincere Voting and Progressive Update in Iterated VotingIn iterated voting, implement the possibility to move onlyprogressivelytowards the best response:AddProfileCardinal.iterated_voting_taus: at each iteration, a given ratio of voters update their ballot.Replace the former methodProfileCardinal.iterated_votingbyProfileCardinal.iterated_voting_strategies:
as in former versions, at each iteration, the threshold utility of each ranking’s strategy is moved in the
direction of the best response’s threshold utility. The method now returns a cycle of tau-vectors and the
corresponding cycle of best response strategies, in order to be consistent withProfileCardinal.iterated_voting_taus.Add the utilitybarycenter: compute a barycenter while respecting the type of one input if the other input has
weight 0.Accelerate the algorithm used in iterated voting.InProfileCardinal, add the possibility of partial sincere voting:Add parameterratio_sincere: ratio of sincere voters.Add propertytau_sincere: the tau-vector if all voters vote sincerely.The former methodtauis renamedtau_strategic: the tau_vector if all voters vote strategically.The new methodtautakes both sincere and strategic voting into account.The methodis_equilibriumhas a new implementation to take this feature into account.AddTauVector.isclose: whether the tau-vector is close to another tau-vector (in the sense ofmath.isclose). This method is used by the new version ofProfileCardinal.is_equilibrium.AddProfile.best_responses_to_strategy: convert a dictionary of best responses to aStrategyThresholdthat
mentions only the rankings that are present in the profile.In random generators of profiles (GeneratorProfileOrdinalUniform,GeneratorProfileOrdinalGridUniform,GeneratorProfileOrdinalVariations,GeneratorProfileHistogramUniform): instead of having explicit arguments
likewell_informed_votersorratio_sincere, there are**kwargsthat are directly passed to the__init__of the relevant Profile subclass.Update the tutorials with these new features.0.4.0 (2020-01-08): Addimage_distributionAddimage_distribution: estimate the distribution off(something)for a randomsomething.Update the tutorial on mass simulations with this new feature.0.3.0 (2020-01-08): New Random GeneratorsAdd new random generators:GeneratorExamples: run another generator until the generated object meets a given test.GeneratorStrategyOrdinalUniform: draw a StrategyOrdinal uniformly.GeneratorProfileOrdinalGridUniform: draw a ProfileOrdinal uniformly on a grid of rational numbers.GeneratorTauVectorGridUniform: draw a TauVector uniformly on a grid of rational numbers.Utilities:Addrand_integers_fixed_sum: draw an array of integers with a given sum.Addrand_simplex_grid: draw a random point in the simplex, with rational coordinates of a given denominator.Updateprobability: allow for a tuple of generators.Tutorials:Add a tutorial on asymptotic developments.Update the tutorial on mass simulations with the new features.0.2.1 (2020-01-05): Fix Deployment on PyPIRelaunch deployment.0.2.0 (2020-01-05): Add Tutorials + Various Minor ImprovementsAddGeneratorProfileStrategyThreshold.AddProfileHistogram.plot_cdf.Modifymasks_distribution: remove the trailing zeros. This has the same impact onProfileOrdinal.distribution_equilibria.ModifyNiceStatsProfileOrdinal.plot_cutoff: center the textual indications.Replace all notationsrwithprofileandsigmawithstrategy.Add tutorials.0.1.1 (2019-12-24): Convert all the Documentation to NumPy FormatConvert all the documentation to NumPy format, making it more readable in plain text.0.1.0 (2019-12-20): First release on PyPIFirst release on PyPI.Implement only the case of 3 candidates.Deal with ordinal or cardinal profiles.Compute the asymptotic developments of the probability of pivot events when the number of players tends to infinity.Compute the best response to a given tau-vector.Explore automatically a grid of ordinal profiles or a grid of tau-vectors.Perform Monte-Carlo experiments on profiles or tau-vectors.