Estimates the flow of voters from one election to the next using a variant of gradient descent.
Formally: Given a previous set of voting choices in matrix O of size m x n and a new set of voting choices in matrix N of size m x p, a transition matrix T of size p x n is optimal if it minimizes the error defined as the squared difference between the predicted outcome in the second election (O T) and the actual outcome in the new election (N). All elements of T are non-negative and all row sums of T are 1.
Core function is optimTransition
, with a variant
optimTransitionCluster
supporting the split of the matrices by clusters.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.