next up previous index
Next: Probabilities Class Up: Model Components Previous: Model Components   Index


Utilities Class

The Utilities class is used for computing utilities in discrete choice modeling. In opus_core there is a Utilities class implemented, called linear_utilities, which computes linear utilities:

$\displaystyle U_{ni} = \sum_{j=1}^J \beta_{ij}x_{nij}\,.
$

Here $ i=1,\dots,I$ denotes the $ I$ different alternatives, $ n$ is an index for observations (agents), $ x$ denotes values of $ J$ variables (including constants) for each agent and alternative, and $ \beta$ is a coefficient matrix of size $ I\times J$ . The run() method gets a 3-d array of data and a 2-d array of coefficients as arguments and returns a 2-d array of utilities.

A child class of linear_utilities, called linear_utilities_diagnose, serves analyzing changes in utilities due to changes in the data. For each variable set to its 5%- and 95%-quantile, respectively, while keeping the remaining variables at their median, it runs the linear_utilities module. Results are stored in a file. First line of the file corresponds to the 5%-quantile, second line to the 95%-quantile, and third line contains the difference between lines one and two. The name of the file can be passed to the run() method in its argument resources as a dictionary key 'utilities_diagnose_file'. Default name is 'util'.


next up previous index
Next: Probabilities Class Up: Model Components Previous: Model Components   Index
info (at) urbansim.org