Command line#
ljos-consensus settle [FLAGS]
Flag |
Meaning |
|---|---|
|
ballots from |
|
|
|
|
|
the diagonal when a row does not name it; default 0.5 |
|
1 is DeGroot; below 1 anchors each voter to its ballot; default 1 |
|
|
|
bounded confidence instead of the trust graph: each voter averages only voters within L1 distance |
|
the fixed-point budget; defaults 200 and 1e-9 |
|
write Seldon inputs, run |
Output: options sorted, shares in that order, rounds, settled,
engine (degroot-fj, bounded-confidence, seldon, or empty),
polarization (the sum over voters of the squared distance from the mean
final opinion) and disagreement (the sum over trust edges of weight times
the squared distance between the two ends), both after Musco, Musco and
Tsourakakis (doi:10.1145/3178876.3186103).
ljos-consensus surprising (--issue ID | --ballots JSON) --predictions JSON
The surprisingly popular answer (Prelec, Seung and McCoy,
doi:10.1038/nature21054). --predictions is an array of {agent, expect}
where expect is an option, or an object of option to the share the voter
expects the others to give it. Output: options, actual and predicted
shares, surprise (actual minus predicted), answer (the largest
surprise; absent below two predictors), predictors.
ljos-consensus reputation --trust JSON [--agents a,b,c] [--alpha A]
EigenTrust (Kamvar, Schlosser and Garcia-Molina,
doi:10.1145/775152.775242): a global standing per voter from the pairwise
rows, the principal eigenvector of the row-normalised trust matrix pulled
toward a uniform pre-trust by alpha (default 0.15). Output: standing
as an object of voter to a share of one.
ljos-consensus reliability (--items JSON | --project P) [--rounds N]
Dawid and Skene’s estimate (doi:10.2307/2346806) of each voter’s accuracy
from many items with no known truth: expectation maximisation over the
items’ hidden answers and the voters’ accuracies, twenty rounds by default.
--items is a JSON array of ballot arrays; --project reads every issue
of a tracker project that holds two or more ballots. Output: items,
rounds, and accuracy as an object of voter to a value in (0, 1),
Laplace smoothed so no voter reaches a certainty.
The step#
x(t+1) = (1 - s) x(0) + s W x(t), with W the row-stochastic trust matrix
and s the susceptibility. A voter’s opinion is a distribution over the
options, one-hot at the start. Missing self weight is filled with
--self-weight; a voter with no row of its own listens to everyone
equally, itself included. Shares are the
column sums of the fixed point, normalised.
Library#
The crate root exports Ballot, Outcome, roster,
influence_matrix, settle, settle_anchored, settle_bounded,
dawid_skene, surprisingly_popular, eigentrust,
ballots_from_json, trust_from_json, anchors_from_json,
predictions_from_json, and settle_seldon. The Seldon module
writes and reads the engine’s files and links nothing under a copyleft
licence.