This helper function calculates the partial gradient numerically for each element of Transition
1 | errorGradient(Old, New, Transition, n, p, epsilon = 1e-07)
|
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 |
n |
the number of outcomes in Old and the number of rows in Transition, provided for performance reasons |
p |
the number of outcomes in New and the number of rows in Transition, provided for performance reasons |
epsilon |
'ε'-value for numerical approximation of gradient, defaults to 0.0000001 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.