This helper function calculates the error, defined as the sum of squared differences between the modelled results and the actual results
| 1 | errorCalculation(Old, New, Transition)
 | 
| Old | m by n matrix of values for n choices in m districts | 
| New | m by p matrix of values for n choices in m districts | 
| Transition | n by b matrix of transition values, all should be positive, row sums should be one | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.