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


upc_sequence Class

In the discrete choice modeling framework, there is a certain order of steps that need to be evaluated, namely computing utilities, computing probabilities and selecting choices. This class allows to perform these steps using just one method call.

The class upc_sequence is composed by an object of Utilities, an object of Probabilities and an object of Choices. The objects are passed to the constructor. Alternatively, one can use the UPCFactory class, which creates an upc_sequence object from names (character strings) of the components.

The run() method calls the run() methods of the component classes in the order given above, passing results from one class to the next one as input values. Thus, the method takes a 3-d array of data and a 2-d array of coefficients as arguments and returns an array of choices. Any of the components can be eliminated by setting it to None. In such a case, the components receive results of the previously running component as input and the results of the very last running method is the return value of the run() method of upc_sequence.


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