urbansim
urbansim copied to clipboard
Configurable MNL coefficient bounds
In the MNL estimation code there are bounds set on the coefficient values, i guess so that unstable models will converge on something. The default bounds are (-3, 3), which is often too restrictive, especially if the estimation data isn't normalized.
https://github.com/UDST/urbansim/blob/master/urbansim/urbanchoice/mnl.py#L178 https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin_l_bfgs_b.html
The bounds are configurable if you call the estimation function directly, but not if you’re using higher-level tools like the MNLDiscreteChoiceModel
class.
We should consider adding a global setting for this. The user would control it by calling something like urbansim.MNL_ESTIMATION_COEF_BOUNDS = (-10,10)
, and it would persist for the length of the Python session. This is not super elegant, but it would be easy to add into the codebase without making very many changes and without breaking any downstream code.
See also: https://github.com/UDST/urbansim_templates/issues/116