API reference

Gravity-type spatial interaction models

spint.gravity.BaseGravity(flows, cost[, …])

Base class to set up gravity-type spatial interaction models and dispatch estimaton technqiues.

spint.gravity.Gravity(flows, o_vars, d_vars, …)

Unconstrained (traditional gravity) gravity-type spatial interaction model

spint.gravity.Production(flows, origins, …)

Production-constrained (origin-constrained) gravity-type spatial interaction model

spint.gravity.Attraction(flows, …[, …])

Attraction-constrained (destination-constrained) gravity-type spatial interaction model

spint.gravity.Doubly(flows, origins, …[, …])

Doubly-constrained gravity-type spatial interaction model

Tests for overdispersion

spint.dispersion.alpha_disp(model[, alt_var])

Test the hypothesis that var[y] = mu (equidispersion) against the alternative hypothesis that var[y] = mu + alpha * alt_var(mu) where mu is the expected value of y, alpha is an estimated coefficient, and alt_var() specifies an alternative variance as a function of mu.

spint.dispersion.phi_disp(model)

Test the hypothesis that var[y] = mu (equidispersion) against the alternative hypothesis (quasi-Poisson) that var[y] = phi * mu where mu is the expected value of y and phi is an estimated overdispersion coefficient which is equivalent to 1+alpha in the alternative alpha dispersion test.