User:Lucasvb/An upgrade to the spatial model of voters: Difference between revisions
User:Lucasvb/An upgrade to the spatial model of voters (view source)
Revision as of 00:44, 12 April 2020
, 4 years agosource formatting, interwiki links
Psephomancy (talk | contribs) (source formatting, interwiki links) |
|||
Line 122:
We would expect that if both opinions are already similar, not a lot of convincing is required. We would also expect that the further apart the "opinion units" need to be relocated, the more difficult it is to change someone's opinion.
In mathematics and engineering, this is a well-studied problem of [
The intuitive notion of how "difficult" it is to convince someone to believe something else, piece by piece, is captured by the '''''[
If you replace "dirt" with "opinion unit", you'll immediately arrive at our idea here.
Line 160:
Note that different issues are never compared with one another here. Only opinions on the same issue count towards each term.
It should be clear that that if the distributions are infinitely sharp (i.e. [
=== Why the Euclidean distance anyway? ===
We could have considered other distances (or "metrics") in the same way, but why single out the
:<math>d(a,b) = \sum_{i=1}^{N} \text{EMD}(a_i(x),b_i(x))), </math>
Line 198:
The following Python code generates the trapezoid distribution for a given opinion, with belief from -1 to +1, and importance from 0 to 1.
<syntaxhighlight lang="python">
def
return wasserstein_distance(_space,_space,dist1,dist2)
def
v = (w+1)/2 - L*abs(np.linspace(-1,1,W) - belief*importance)
v /= sum(v)
for w in range(1,W+1):▼
for
b1, b2 = np.random.rand()*2-1, np.random.rand()*2-1▼
▲ o1 = opinion(b1, i1)
o2 = opinion(b2, i2)
"vs",
</syntaxhighlight>
|