POLL(1) POLL(1)
NAME
poll - compute the chances of winning a multiplayer election
SYNOPSIS
poll [-l] [-N] [-r rms] [-t time] [-V] [-v] poll1 poll2 ...
DESCRIPTION
Poll is for computing the chances of winning multiplayer polls, (i.e.,
predicting election results,) based on favorability/approval ratings.
Favorability ratings are assumed to be a simple fractal with Gaus-
sian/normal distributed increments. The distribution of the players
favorability ratings in the future will be a Gaussian/normal distribu-
tion. If elements, Ea, and Eb, are picked, respectively, from indepen-
dent, (iid is assumed,) random processes, Ra and Rb, where Ra and Rb
have a Gaussian/normal PDF with STD Sa and Sb, and medians Ma and Mb,
with Ma >= Mb, the probability that Ea >= Eb, we are considering Ea -
Eb >= 0. The z- score of 0 is:
z = (0 - mean) / std = (Mb - Ma) / sqrt (Sa^2 + Sb^2)
and the probability is 1 - Phi (z) where Phi (z) is the cumulative
probability distribution of the Gaussian/normal distribution.
If Sa = Sb = S:
z = (0 - mean) / std = (Mb - Ma) / (sqrt (2) * S)
What this means is to build a table of the cumulative of the Gaus-
sian/normal distribution, and look up the value of the cumulative for
(Mb - Ma) / (sqrt (2) * S), which is what this program does for each
player, multiplying the chances of a player winning over all the other
players together, to get the chance of the player winning.
Note that the fractal probably has a log-normal distribution, since
negative favoribility ratings are impossible, and there is no bounds on
the upper limit, (more voters vote in the future, or those that usually
don't vote do,) and the values should be number of voters, instead of
favoribilities in percentages. Additionally, if there are only two
players, the distributions of the two players are not independent,
(since it is a zero sum game, and what one player wins, the other
loses-a negative correlation, effectively doubling the root-mean-square
of the increments of the favorability ratings.)
The tsinvest(1) program should be used for such scenarios, (that's its
forte-the "currency" would be percentage points of favorability,) but
such a precision methodology would require far more data than is nor-
mally available in elections. This program uses the log-normal and
cumulative of the Gaussian/normal probability distribution computations
from the tsinvest program to provide an estimation of future election
winner(s) based on current favorability ratings.
The command line arguments are the favoribility ratings of the players,
and the chances of each player winning is printed to stdout.
A note about the method of calculation of the combined probabilities
for a player:
For two players, the possibilities are:
A > B
B > A *
For three players, the possibilities are:
A > B
A > C
B > A *
B > C
C > A *
C > B *
For four players, the possibilities are:
A > B
A > C
A > D
B > A *
B > C
B > D
C > A *
C > B *
C > D
D > A *
D > B *
D > C *
In general, for n players, there are N(N - 1) rows, where N is the num-
ber of poll values on the command line. The rows with an asterisk are
the compliment, (inverse,) of another row, (i.e., A > B and B > A,) and
the combined probability of a row and its compliment is unity. There-
fore, the sum of all rows is N(N - 1) / 2-which could be calculated by
making a pass of the data to calculate the sum of all rows, and another
pass, multiplying by the reciprocal of the sum of all rows. Thus the
program will present answers, (subject to interpretation-for example,
Player X has twice the probability of winning as Player Y, etc.,) when
the poll numbers do not total to unity, (and the program is ratio met-
ric so long as the "-r rms" dimension and poll numbers on the command
line are the same, i.e., both percent, both fractional, etc.)
For example, using fractional:
poll -r 0.02 -t 365 0.50 0.25 0.125 0.0625 0.0625
Player 1's chances of winning = 0.320796
Player 2's chances of winning = 0.076919
Player 3's chances of winning = 0.029703
Player 4's chances of winning = 0.017288
Player 5's chances of winning = 0.017288
Or, using percent:
poll -r 2 -t 365 50 25 12.5 6.25 6.25
Player 1's chances of winning = 0.320796
Player 2's chances of winning = 0.076919
Player 3's chances of winning = 0.029703
Player 4's chances of winning = 0.017288
Player 5's chances of winning = 0.017288
means the root-mean-square of the increments of the poll data is 2 per-
centage points, (-r 2,) a day, it is one year to the election, (-t =
365 days,) and the first player has 50% favorability, the second 25%,
and so on.
By comparison, using the log-normal distribution evolution, (which
should be used with actual voter counts, instead of fractional; per-
centages will often yield adequate estimations):
poll -l -r 2 -t 365 50 25 12.5 6.25 6.25
Player 1's chances of winning = 0.176716
Player 2's chances of winning = 0.099164
Player 3's chances of winning = 0.050807
Player 4's chances of winning = 0.023629
Player 5's chances of winning = 0.023629
Note that the player's chances are pure probabilities. To normalize the
probabilities, (i.e., they sum to unity,) use the -N option:
poll -N -l -r 2 -t 365 50 25 12.5 6.25 6.25
Player 1's chances of winning = 0.472572
Player 2's chances of winning = 0.265182
Player 3's chances of winning = 0.135867
Player 4's chances of winning = 0.063189
Player 5's chances of winning = 0.063189
The normalization can be calculated, (but the poll value arguments on
the command line should sum to unity,) by noting the 50/50, (or 1 and
its complement, 0, and vice versa,) values of a player winning, P, for
the number of poll values, N, n = 2, n = 3, n = 4, ... n = N. For N =
2, P = 0.5^(2-1) = 0.5; for N = 3, P = 0.5^(3-1) = 0.25; for N = 4, P =
0.5^(4-1) = 0.125; ...; for N = n, P = 0.5^(n-1), which would corre-
spond to a normalizer of 2(0.5^(2-1)) = 1 for N = 2; 3(0.5^(3-1)) =
0.75 for N = 3; 4(0.5^(4-1)) = 0.5 for N = 4; ...; n(0.5^(n-1)) for N =
n.
OPTIONS
-l Log-normal distibution evolves over time, (normal distribution).
-N Normalize election probabilities to total unity.
-r rms Root-mean-square of increments of favoribility ratings, (1).
-t time
Time to election, (1).
-V Verbose output.
-v Print the version and copyright banner of the program.
poll1 poll2 ...
Current poll favorability/approval ratings.
WARNINGS
There is little or no provision for handling numerical exceptions.
SEE ALSO
sigma(1), cumulativenormal(1), tsinvest(1)
DIAGNOSTICS
Error messages for incompatible arguments, failure to allocate memory,
inaccessible files, and opening and closing files.
AUTHORS
----------------------------------------------------------------------
A license is hereby granted to reproduce this software source code and
to create executable versions from this source code for personal,
non-commercial use. The copyright notice included with the software
must be maintained in all copies produced.
THIS PROGRAM IS PROVIDED "AS IS". THE AUTHOR PROVIDES NO WARRANTIES
WHATSOEVER, EXPRESSED OR IMPLIED, INCLUDING WARRANTIES OF
MERCHANTABILITY, TITLE, OR FITNESS FOR ANY PARTICULAR PURPOSE. THE
AUTHOR DOES NOT WARRANT THAT USE OF THIS PROGRAM DOES NOT INFRINGE THE
INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY IN ANY COUNTRY.
Copyright (c) 1994-2007, John Conover, All Rights Reserved.
Comments and/or bug reports should be addressed to:
john@email.johncon.com (John Conover)
----------------------------------------------------------------------
January 17, 2007 POLL(1)